Bug 32112 - [4.1/4.2 regression] #'unbound_class_template' not supported by dump_decl#
Summary: [4.1/4.2 regression] #'unbound_class_template' not supported by dump_decl#
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.3.0
: P2 normal
Target Milestone: 4.1.3
Assignee: Paolo Carlini
URL:
Keywords: diagnostic, monitored
Depends on:
Blocks:
 
Reported: 2007-05-27 21:54 UTC by Volker Reichelt
Modified: 2007-08-18 10:09 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2007-08-10 09:51:55


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Volker Reichelt 2007-05-27 21:54:28 UTC
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
Comment 1 Volker Reichelt 2007-05-27 21:59:59 UTC
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#'
Comment 2 Paolo Carlini 2007-08-10 09:51:55 UTC
Seems manageable...
Comment 3 paolo@gcc.gnu.org 2007-08-17 20:47:15 UTC
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

Comment 4 paolo@gcc.gnu.org 2007-08-18 10:08:04 UTC
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

Comment 5 paolo@gcc.gnu.org 2007-08-18 10:08:22 UTC
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

Comment 6 Paolo Carlini 2007-08-18 10:09:02 UTC
Fixed.