Bug 42218 - [4.5 Regression] Broken diagnostic: 'tree_vec' not supported by pp_c_expression
Summary: [4.5 Regression] Broken diagnostic: 'tree_vec' not supported by pp_c_expression
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.5.0
: P2 normal
Target Milestone: 4.5.0
Assignee: Dodji Seketeli
URL:
Keywords: diagnostic, monitored
Depends on:
Blocks:
 
Reported: 2009-11-29 15:31 UTC by Volker Reichelt
Modified: 2009-12-04 07:40 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2009-12-03 17:22:23


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Volker Reichelt 2009-11-29 15:31:36 UTC
A broken diagnostic is issued for the following invalid code snippet on trunk:

================================
template<int> struct A
{
  template<int> struct B;
};

int i = A<0>::B<0>::X::Y;
================================

bug.cc:6:21: error: 'A<0>::B<#'tree_vec' not supported by pp_c_expression#, #'tree_vec' not supported by pp_c_expression#>::X' has not been declared

GCC 4.3.x and 4.4.x issue a sensible error message:

bug.cc:6: error: 'A::B::X' has not been declared

GCC 4.2.x issues an even better error message:

bug.cc:6: error: 'struct A<0>::B<0>::X' has not been declared
Comment 1 Richard Biener 2009-11-29 15:42:20 UTC
Confirmed.
Comment 2 Dodji Seketeli 2009-12-03 18:25:14 UTC
A patch got submitted to http://gcc.gnu.org/ml/gcc-patches/2009-12/msg00208.html
Comment 3 Dodji Seketeli 2009-12-04 07:38:57 UTC
Subject: Bug 42218

Author: dodji
Date: Fri Dec  4 07:38:42 2009
New Revision: 154972

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=154972
Log:
Fix PR c++/42218

gcc/cp/ChangeLog:
	PR c++/42218
	* cxx-pretty-print.c (pp_cxx_unqualified_id): Print only innermost
	template arguments.

gcc/testsuite/ChangeLog:
	PR c++/42218
	* g++.dg/other/error33.C: New test.

Added:
    trunk/gcc/testsuite/g++.dg/other/error33.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/cxx-pretty-print.c
    trunk/gcc/testsuite/ChangeLog

Comment 4 Dodji Seketeli 2009-12-04 07:40:03 UTC
Fixed in 4.5