Bug 33463 - [4.1 regression] Broken diagnostic: 'typeid_expr' not supported by dump_expr
Summary: [4.1 regression] Broken diagnostic: 'typeid_expr' not supported by dump_expr
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.3.0
: P4 normal
Target Milestone: 4.2.3
Assignee: Not yet assigned to anyone
URL:
Keywords: diagnostic, monitored
Depends on:
Blocks:
 
Reported: 2007-09-17 22:20 UTC by Volker Reichelt
Modified: 2008-07-04 16:13 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work: 4.2.3
Known to fail: 4.1.3
Last reconfirmed: 2007-09-18 14:44:59


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Volker Reichelt 2007-09-17 22:20:43 UTC
The following invalid testcase triggers a broken diagnostic since GCC 3.4.0:

===================================
namespace std
{
  class type_info {};
}

template<int> void foo()
{
  !typeid(void);
}
===================================

bug.cc: In function 'void foo()':
bug.cc:8: error: no match for 'operator!' in '!#'typeid_expr' not supported by dump_expr#<expression error>'
bug.cc:8: note: candidates are: operator!(bool) <built-in>
Comment 1 paolo@gcc.gnu.org 2007-09-18 15:38:15 UTC
Subject: Bug 33463

Author: paolo
Date: Tue Sep 18 15:38:02 2007
New Revision: 128582

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=128582
Log:
/cp
2007-09-18  Paolo Carlini  <pcarlini@suse.de>

	PR c++/33463
	* cxx-pretty-print.c (pp_cxx_postfix_expression): Split
	out case TYPEID_EXPR to...
	(pp_cxx_typeid_expression): ... here; use pp_cxx_left_paren
	and pp_cxx_right_paren.
	* cxx-pretty-print.h (pp_cxx_typeid_expression): Declare.
	* error.c (dump_expr): Use it.

/testsuite
2007-09-18  Paolo Carlini  <pcarlini@suse.de>

	PR c++/33463
	* g++.dg/rtti/typeid6.C: New.

Added:
    trunk/gcc/testsuite/g++.dg/rtti/typeid6.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/cxx-pretty-print.c
    trunk/gcc/cp/cxx-pretty-print.h
    trunk/gcc/cp/error.c
    trunk/gcc/testsuite/ChangeLog

Comment 2 Paolo Carlini 2007-09-18 15:40:19 UTC
Fixed in mainline.
Comment 3 Volker Reichelt 2008-01-02 23:41:46 UTC
Subject: Bug 33463

Author: reichelt
Date: Wed Jan  2 23:40:41 2008
New Revision: 131265

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=131265
Log:
	Backport:
	2007-09-18  Paolo Carlini  <pcarlini@suse.de>
 
	PR c++/33463
	* cxx-pretty-print.c (pp_cxx_postfix_expression): Split
	out case TYPEID_EXPR to...
	(pp_cxx_typeid_expression): ... here; use pp_cxx_left_paren
	and pp_cxx_right_paren.
	* cxx-pretty-print.h (pp_cxx_typeid_expression): Declare.
	* error.c (dump_expr): Use it.

	* g++.dg/rtti/typeid6.C: New.

Added:
    branches/gcc-4_2-branch/gcc/testsuite/g++.dg/rtti/typeid6.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/cxx-pretty-print.h
    branches/gcc-4_2-branch/gcc/cp/error.c
    branches/gcc-4_2-branch/gcc/testsuite/ChangeLog

Comment 4 Volker Reichelt 2008-01-02 23:54:24 UTC
Now also fixed in GCC 4.2.3.
Comment 5 Joseph S. Myers 2008-07-04 16:13:56 UTC
Closing 4.1 branch.