I discovered a bug on new mainline tree. Use option -O3 to see the bug > cat a.cpp #include <string> struct a { int f ( const std::string& Id ) const; int f ( void ) const { return f ( "default" ); } }; int a :: f ( const std::string& id ) const { if ( id == "" ) return f (); return 0; } > /mnt/d/gcc/bin/g++-4.0 -v -save-temps -O3 -c a.cpp Reading specs from /mnt/d/gcc/lib/gcc/i686-pc-linux-gnu/4.0.0/specs Configured with: ../gcc/configure --prefix=/mnt/d/gcc --enable-shared --enable-threads --program-suffix=-4.0 --enable-__cxa_at xit --disable-nls --enable-languages=c,c++,java : (reconfigured) ../gcc/configure --prefix=/mnt/d/gcc --enable-shared --enable threads --program-suffix=-4.0 --enable-__cxa_atexit --disable-nls --with-gcc-version-trigger=/mnt/d/.src/gcc-cvs/gcc/gcc/versi n.c --enable-languages=c,c++,java --no-create --no-recursion Thread model: posix gcc version 4.0.0 20041202 (experimental) /mnt/d/gcc/libexec/gcc/i686-pc-linux-gnu/4.0.0/cc1plus -E -quiet -v -D_GNU_SOURCE a.cpp -mtune=pentiumpro -O3 -fpch-preproces -o a.ii ignoring nonexistent directory "/mnt/d/gcc/lib/gcc/i686-pc-linux-gnu/4.0.0/../../../../i686-pc-linux-gnu/include" #include "..." search starts here: #include <...> search starts here: /mnt/d/gcc/lib/gcc/i686-pc-linux-gnu/4.0.0/../../../../include/c++/4.0.0 /mnt/d/gcc/lib/gcc/i686-pc-linux-gnu/4.0.0/../../../../include/c++/4.0.0/i686-pc-linux-gnu /mnt/d/gcc/lib/gcc/i686-pc-linux-gnu/4.0.0/../../../../include/c++/4.0.0/backward /usr/local/include /mnt/d/gcc/include /mnt/d/gcc/lib/gcc/i686-pc-linux-gnu/4.0.0/include /usr/include End of search list. /mnt/d/gcc/libexec/gcc/i686-pc-linux-gnu/4.0.0/cc1plus -fpreprocessed a.ii -quiet -dumpbase a.cpp -mtune=pentiumpro -auxbase -O3 -version -o a.s GNU C++ version 4.0.0 20041202 (experimental) (i686-pc-linux-gnu) compiled by GNU C version 4.0.0 20041202 (experimental). GGC heuristics: --param ggc-min-expand=30 --param ggc-min-heapsize=4096 /mnt/d/gcc/lib/gcc/i686-pc-linux-gnu/4.0.0/../../../../include/c++/4.0.0/bits/basic_string.h: In member function 'int a::f(con t std::string&) const': /mnt/d/gcc/lib/gcc/i686-pc-linux-gnu/4.0.0/../../../../include/c++/4.0.0/bits/basic_string.h:2140: internal compiler error: in make_decl_rtl, at varasm.c:867 Please submit a full bug report, with preprocessed source if appropriate. See <URL:http://gcc.gnu.org/bugs.html> for instructions.
Created attachment 7662 [details] Preprocessed sources
*** This bug has been marked as a duplicate of 16951 ***