Created attachment 25495 [details] The .ii version of the code in the bug report gcc version: gcc (Ubuntu/Linaro 4.5.2-8ubuntu4) 4.5.2 Compile line: gcc -std="c++0x" test.cpp -save-temps test.cpp:11:16: internal compiler error: in constructor_name_p, at cp/name-lookup.c:1809 Please submit a full bug report, with preprocessed source if appropriate. See <file:///usr/share/doc/gcc-4.5/README.Bugs> for instructions. The .ii file is attached, but here is the source code: enum class Foo { Val1, Val2 }; template <Foo val> void do_something() { } template <Foo::Val1> //Error at this line void do_something() { } int main() { return 0; } Possibly a duplicate of this bug: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47627, but the code is still different.
Has been fixed in 4.6.1, anyway.