http://gcc.gnu.org/bugzilla/show_bug.cgi?id=49701
Summary: Parser confusion between operator< and template specialization Product: gcc Version: 4.5.2 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ AssignedTo: unassig...@gcc.gnu.org ReportedBy: mdpo...@troilus.org Created attachment 24737 --> http://gcc.gnu.org/bugzilla/attachment.cgi?id=24737 precompiled minimal test case for the parsing error The attached code generates a compiler error on my system (using Ubuntu 11.04's version of gcc 4.5.2; gcc 4.6.1 compiled from source does the same thing). If the template_1 class is changed to not be a template, it compiles with no error. $ g++ -v -save-temps -std=c++0x -c template_delegate_parsing.cpp Using built-in specs. COLLECT_GCC=/usr/bin/g++ COLLECT_LTO_WRAPPER=/usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/4.5.2/lto-wrapper Target: x86_64-linux-gnu Configured with: ../src/configure -v --with-pkgversion='Ubuntu/Linaro 4.5.2-8ubuntu4' --with-bugurl=file:///usr/share/doc/gcc-4.5/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.5 --enable-shared --enable-multiarch --with-multiarch-defaults=x86_64-linux-gnu --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib/x86_64-linux-gnu --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.5 --libdir=/usr/lib/x86_64-linux-gnu --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-plugin --enable-gold --enable-ld=default --with-plugin-ld=ld.gold --enable-objc-gc --disable-werror --with-arch-32=i686 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu Thread model: posix gcc version 4.5.2 (Ubuntu/Linaro 4.5.2-8ubuntu4) COLLECT_GCC_OPTIONS='-v' '-save-temps' '-std=c++0x' '-c' '-shared-libgcc' '-mtune=generic' '-march=x86-64' /usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/4.5.2/cc1plus -E -quiet -v -D_GNU_SOURCE template_delegate_parsing.cpp -D_FORTIFY_SOURCE=2 -mtune=generic -march=x86-64 -std=c++0x -fpch-preprocess -fstack-protector -o template_delegate_parsing.ii ignoring nonexistent directory "/usr/local/include/x86_64-linux-gnu" ignoring nonexistent directory "/usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/4.5.2/../../../../../x86_64-linux-gnu/include" #include "..." search starts here: #include <...> search starts here: /usr/include/c++/4.5 /usr/include/c++/4.5/x86_64-linux-gnu /usr/include/c++/4.5/backward /usr/local/include /usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/4.5.2/include /usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/4.5.2/include-fixed /usr/include/x86_64-linux-gnu /usr/include End of search list. COLLECT_GCC_OPTIONS='-v' '-save-temps' '-std=c++0x' '-c' '-shared-libgcc' '-mtune=generic' '-march=x86-64' /usr/lib/x86_64-linux-gnu/gcc/x86_64-linux-gnu/4.5.2/cc1plus -fpreprocessed template_delegate_parsing.ii -quiet -dumpbase template_delegate_parsing.cpp -mtune=generic -march=x86-64 -auxbase template_delegate_parsing -std=c++0x -version -fstack-protector -o template_delegate_parsing.s GNU C++ (Ubuntu/Linaro 4.5.2-8ubuntu4) version 4.5.2 (x86_64-linux-gnu) compiled by GNU C version 4.5.2, GMP version 4.3.2, MPFR version 3.0.0-p8, MPC version 0.9 GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 GNU C++ (Ubuntu/Linaro 4.5.2-8ubuntu4) version 4.5.2 (x86_64-linux-gnu) compiled by GNU C version 4.5.2, GMP version 4.3.2, MPFR version 3.0.0-p8, MPC version 0.9 GGC heuristics: --param ggc-min-expand=100 --param ggc-min-heapsize=131072 Compiler executable checksum: 1a8763bcd4db37297f4ae8b8aab36cf0 template_delegate_parsing.cpp: In constructor ‘c<T>::c() [with T = int]’: template_delegate_parsing.cpp:14:9: instantiated from here template_delegate_parsing.cpp:9:8: error: invalid operands of types ‘<unresolved overloaded function type>’ and ‘void (c<int>::*)()’ to binary ‘operator<’