------- Comment #1 from rodolfo at rodsoft dot org 2010-07-21 02:49 ------- The code I posted was meant to be compiled in c++0x mode, but if we write directly the definition of std::enable_if, it also happens in c++03 mode. So, instead of #include , one should write: template struct enable_if; template struct enable_if { typedef T type; }; Of course, I forgot to add the error messages: teste.cpp:30: error: ambiguous class template instantiation for ‘struct foo, bar<2>, void>’ teste.cpp:19: error: candidates are: struct foo, V, typename enable_if<((M == RUNTIME) || (M == 2)), void>::type> teste.cpp:25: error: struct foo, V2, typename enable_if<((M == RUNTIME) || (M == 2)), void>::type> teste.cpp:30: error: aggregate ‘foo, bar<2>, void> x’ has incomplete type and cannot be defined -- rodolfo at rodsoft dot org changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |rodolfo at rodsoft dot org Keywords| |rejects-valid Known to fail| |4.4.3 4.5.0 http://gcc.gnu.org/bugzilla/show_bug.cgi?id=45012