A garbled diagnostic is issued for the following invalid code snippet since GCC 4.1.0: ==================================================== template<int> struct A; template<typename T> void foo (A<&T::template>); ==================================================== bug.cc:3: error: '#'unbound_class_template' not supported by dump_decl#<declaration error>' is not a template
Oops, I hosed the last line of the testcase. The testcase should read: ======================================================= template<int> struct A; template<typename T> void foo (A<&T::template i>); ======================================================= Btw, a slightly modified version causes two garbled diagnostics: ==================================================== template<typename> struct A; template<typename T> void foo (A<&T::template i>); ==================================================== bug.cc:3: error: '#'unbound_class_template' not supported by dump_decl#<declaration error>' is not a template bug.cc:3: error: type/value mismatch at argument 1 in template parameter list for 'template<class> struct A' bug.cc:3: error: expected a type, got '& T::#'unbound_class_template' not supported by pp_cxx_unqualified_id#'
Seems manageable...
Subject: Bug 32112 Author: paolo Date: Fri Aug 17 20:46:59 2007 New Revision: 127596 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=127596 Log: /cp 2007-08-17 Paolo Carlini <pcarlini@suse.de> PR c++/32112 * error.c (dump_decl): Deal with UNBOUND_CLASS_TEMPLATE. * cxx-pretty-print.c (pp_cxx_unqualified_id): Likewise. /testsuite 2007-08-17 Paolo Carlini <pcarlini@suse.de> PR c++/32112 * g++.dg/template/error26.C: New. Added: trunk/gcc/testsuite/g++.dg/template/error26.C Modified: trunk/gcc/cp/ChangeLog trunk/gcc/cp/cxx-pretty-print.c trunk/gcc/cp/error.c trunk/gcc/testsuite/ChangeLog
Subject: Bug 32112 Author: paolo Date: Sat Aug 18 10:07:42 2007 New Revision: 127609 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=127609 Log: /cp 2007-08-18 Paolo Carlini <pcarlini@suse.de> PR c++/32112 * error.c (dump_decl): Deal with UNBOUND_CLASS_TEMPLATE. * cxx-pretty-print.c (pp_cxx_unqualified_id): Likewise. /testsuite 2007-08-18 Paolo Carlini <pcarlini@suse.de> PR c++/32112 * g++.dg/template/error26.C: New. Added: branches/gcc-4_2-branch/gcc/testsuite/g++.dg/template/error26.C Modified: branches/gcc-4_2-branch/gcc/cp/ChangeLog branches/gcc-4_2-branch/gcc/cp/cxx-pretty-print.c branches/gcc-4_2-branch/gcc/cp/error.c branches/gcc-4_2-branch/gcc/testsuite/ChangeLog
Subject: Bug 32112 Author: paolo Date: Sat Aug 18 10:08:03 2007 New Revision: 127610 URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=127610 Log: /cp 2007-08-18 Paolo Carlini <pcarlini@suse.de> PR c++/32112 * error.c (dump_decl): Deal with UNBOUND_CLASS_TEMPLATE. * cxx-pretty-print.c (pp_cxx_unqualified_id): Likewise. /testsuite 2007-08-18 Paolo Carlini <pcarlini@suse.de> PR c++/32112 * g++.dg/template/error26.C: New. Added: branches/gcc-4_1-branch/gcc/testsuite/g++.dg/template/error26.C Modified: branches/gcc-4_1-branch/gcc/cp/ChangeLog branches/gcc-4_1-branch/gcc/cp/cxx-pretty-print.c branches/gcc-4_1-branch/gcc/cp/error.c branches/gcc-4_1-branch/gcc/testsuite/ChangeLog
Fixed.