Created attachment 22070 [details] Preprocessed c++ source that triggers the Bug This is the output of "gcc -v -save-temps -c -o commands.o commands.cpp" Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/lib/gcc/i686-pc-linux-gnu/4.5.1/lto-wrapper Target: i686-pc-linux-gnu Configured with: ../configure --prefix=/usr --enable-languages=c,c++,fortran,objc,obj-c++,ada --enable-shared --enable-threads=posix --enable-__cxa_atexit --enable-clocale=gnu --enable-gnu-unique-object --enable-lto --enable-plugin --disable-multilib --disable-libstdcxx-pch --with-system-zlib --with-ppl --with-cloog --libdir=/usr/lib --libexecdir=/usr/lib --mandir=/usr/share/man --infodir=/usr/share/info Thread model: posix gcc version 4.5.1 (GCC) COLLECT_GCC_OPTIONS='-v' '-save-temps' '-c' '-o' 'commands.o' '-mtune=generic' '-march=pentiumpro' /usr/lib/gcc/i686-pc-linux-gnu/4.5.1/cc1plus -E -quiet -v -D_GNU_SOURCE commands.cpp -mtune=generic -march=pentiumpro -fpch-preprocess -o commands.ii ignoring nonexistent directory "/usr/lib/gcc/i686-pc-linux-gnu/4.5.1/../../../../i686-pc-linux-gnu/include" #include "..." search starts here: #include <...> search starts here: /usr/lib/gcc/i686-pc-linux-gnu/4.5.1/../../../../include/c++/4.5.1 /usr/lib/gcc/i686-pc-linux-gnu/4.5.1/../../../../include/c++/4.5.1/i686-pc-linux-gnu /usr/lib/gcc/i686-pc-linux-gnu/4.5.1/../../../../include/c++/4.5.1/backward /usr/local/include /usr/lib/gcc/i686-pc-linux-gnu/4.5.1/include /usr/lib/gcc/i686-pc-linux-gnu/4.5.1/include-fixed /usr/include End of search list. COLLECT_GCC_OPTIONS='-v' '-save-temps' '-c' '-o' 'commands.o' '-mtune=generic' '-march=pentiumpro' /usr/lib/gcc/i686-pc-linux-gnu/4.5.1/cc1plus -fpreprocessed commands.ii -quiet -dumpbase commands.cpp -mtune=generic -march=pentiumpro -auxbase-strip commands.o -version -o commands.s GNU C++ (GCC) version 4.5.1 (i686-pc-linux-gnu) compiled by GNU C version 4.5.1, GMP version 5.0.1, MPFR version 3.0.0-p3, MPC version 0.8.2 GGC heuristics: --param ggc-min-expand=97 --param ggc-min-heapsize=126654 GNU C++ (GCC) version 4.5.1 (i686-pc-linux-gnu) compiled by GNU C version 4.5.1, GMP version 5.0.1, MPFR version 3.0.0-p3, MPC version 0.8.2 GGC heuristics: --param ggc-min-expand=97 --param ggc-min-heapsize=126654 Compiler executable checksum: 09c286d6478a532084f45ddd675021da commands.cpp:12:67: internal compiler error: in lvalue_p_1, at cp/tree.c:156 Please submit a full bug report, with preprocessed source if appropriate. See <http://gcc.gnu.org/bugs.html> for instructions.
Forgot to mention, it works with gcc 4.3 and clang
<<< Unknown tree: scope_ref struct StringLiterals dec >>> StringLiterals is not dependent so the scope_ref should have been resolved. 4.3.2 gave: t.cc:12: error: ‘StringLiterals::dec’ cannot appear in a constant-expression t.cc:12: error: template argument 3 is invalid But I think that is incorrect as that is a static field. Note 4.5.0 20100401 (experimental) [trunk revision 157933] accepted the code though.
It is caused by revision 161559: http://gcc.gnu.org/ml/gcc-cvs/2010-06/msg01477.html
Author: jason Date: Fri Dec 3 16:56:37 2010 New Revision: 167435 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=167435 Log: PR c++/46058 * tree.c (lvalue_kind) [SCOPE_REF]: Handle non-dependent case. Added: trunk/gcc/testsuite/g++.dg/template/scope4.C Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/tree.c trunk/gcc/testsuite/ChangeLog
Author: jason Date: Fri Dec 3 18:44:04 2010 New Revision: 167438 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=167438 Log: PR c++/46058 * tree.c (lvalue_kind) [SCOPE_REF]: Handle non-dependent case. Added: branches/gcc-4_5-branch/gcc/testsuite/g++.dg/template/scope4.C Modified: branches/gcc-4_5-branch/gcc/cp/ChangeLog branches/gcc-4_5-branch/gcc/cp/tree.c branches/gcc-4_5-branch/gcc/testsuite/ChangeLog
Fixed.