http://gcc.gnu.org/bugzilla/show_bug.cgi?id=51989
Jonathan Wakely <redi at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |jason at gcc dot gnu.org
--- Comment #5 from Jonathan Wakely <redi at gcc dot gnu.org> 2012-01-25
09:55:25 UTC ---
However, I think it is a bug that this is rejected.
template <typename T>
struct is_container {
template <typename U, typename V = decltype(((U*)0)->begin())>
static char test( U* u);
template <typename U> static long test(...);
enum { value = sizeof test<T>(0) == 1 };
};
int main() {
return is_container< void >::value;
}
c.cc: In instantiation of ‘struct is_container<void>’:
c.cc:12:32: required from here
c.cc:3:27: error: ‘void*’ is not a pointer-to-object type
Jason, shouldn't deduction fail for ((U*)0)->foo() with U=void instead of
giving an error?