Explicit template arguments cause type disagreement for types that decay to pointers (function types and array types). Based on the function-type specific code in the "Steps to reproduce" section, since we have F ff as the parameter of the is_F_same_as_decltype_ff() function, it seems like F should __always__ agree with decltype( ff ). In other words, the bug is that there is type disagreement when explicit template arguments are used (esp. when there is no type disagreement when implicit template arguments are deduced). Perhaps both F and decltype( ff ) should both decay to pointer types ... even if F is an explicit template argument that is not a pointer type. Or perhaps both F and decltype( ff ) should both be of type F ... irregardless of the adjustment that takes function & array types down to pointers. Either way, this type disgreement is currently inconsistent and non-intuitive.
The same can be shown for array types as well ... in other words, if we use say char (i.e. a c string) instead of void (), then we get the same type of type disagreement ( char versus char * ). See my main.cpp file from 2/24/2011 for an example of type disagreement using character arrays.
Note: If we compile and run the code in the "Steps to reproduce" section with g++ 4.5.2, then we get the expected output (i.e. the output in the "Expected results" section) ... which is currently different than what VC++ 2010 currently produces (i.e. the output in the "Actual results" section).
This type disagreement effects the use of sizeof() as well. See my main.cpp from 2/25/2011 for an example sizeof() disagreement. Both VC++ 2010 and g++ 4.5.2 seem to suffer from this inconsistency ... albeit, in different ways.