Bug 24052 - [3.4/4.0/4.1 Regression] &#`label_decl' not supported by dump_expr#<expression error>
Summary: [3.4/4.0/4.1 Regression] &#`label_decl' not supported by dump_expr#<expressio...
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.1.0
: P2 minor
Target Milestone: 4.0.3
Assignee: Paolo Bonzini
URL:
Keywords: diagnostic
Depends on:
Blocks:
 
Reported: 2005-09-25 08:48 UTC by Guillaume Melquiond
Modified: 2005-10-12 13:46 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work: 3.2.3 3.0.4 2.95.3 3.4.5 4.0.3 4.1.0
Known to fail: 3.3.3 3.4.4 4.0.2
Last reconfirmed: 2005-10-11 16:28:09


Attachments
Trivial fix (223 bytes, patch)
2005-09-25 08:49 UTC, Guillaume Melquiond
Details | Diff
another patch (448 bytes, patch)
2005-10-07 07:21 UTC, Paolo Bonzini
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Guillaume Melquiond 2005-09-25 08:48:14 UTC
I do not think labels as values are widely used with C++ operators; I stumbled
over it only because of a typo (double &&). But in case of error, it will
produce a garbled message (tested from 3.3 to 4.1). For example,

a.cpp:3:no match for 'operator&&' in 'A() && &#'label_decl' not supported by
dump_expr#<expression error>'

Testcase:

struct A {};
bool operator&&(A const &, A const &);
int main() { A() && && b; }
Comment 1 Guillaume Melquiond 2005-09-25 08:49:37 UTC
Created attachment 9803 [details]
Trivial fix

The error message is a bit better now:

a.cpp:3: error: no match for 'operator&&' in 'A() && & b'
Comment 2 Andrew Pinski 2005-09-25 14:51:31 UTC
Confirmed a regression from 3.2.3 which gave:
t.cc: In function `int main()':
t.cc:3: no match for `A && void*' operator
t.cc:3: candidates are: operator&&(bool, bool) <built-in>
t.cc:2:                 bool operator&&(const A&, const A&)
t.cc:3: label `b' used but not defined
Comment 3 Paolo Bonzini 2005-10-07 07:21:34 UTC
Created attachment 9916 [details]
another patch

Similar to the previous patch, but also prints && correctly for ADDR_EXPR of a LABEL_DECL.
Comment 4 GCC Commits 2005-10-12 13:16:27 UTC
Subject: Bug 24052

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	bonzini@gcc.gnu.org	2005-10-12 13:16:23

Modified files:
	gcc/cp         : ChangeLog error.c 
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/g++.dg/ext: label5.C 

Log message:
	==> cp/ChangeLog <==
	2005-10-12  Paolo Bonzini  <bonzini@gnu.org>
	
	PR c++/24052
	* error.c (dump_expr): Pass LABEL_DECL to dump_decl.  Print
	an ADDR_EXPR of a LABEL_DECL as &&.
	
	==> testsuite/ChangeLog <==
	2005-10-12  Paolo Bonzini  <bonzini@gnu.org>
	
	PR c++/24052
	* g++.dg/ext/label5.C: New.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.4922&r2=1.4923
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/error.c.diff?cvsroot=gcc&r1=1.294&r2=1.295
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.6175&r2=1.6176
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/ext/label5.C.diff?cvsroot=gcc&r1=NONE&r2=1.1

Comment 5 GCC Commits 2005-10-12 13:35:44 UTC
Subject: Bug 24052

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-4_0-branch
Changes by:	bonzini@gcc.gnu.org	2005-10-12 13:35:41

Modified files:
	gcc/cp         : ChangeLog error.c 
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/g++.dg/ext: label5.C 

Log message:
	==> cp/ChangeLog <==
	2005-10-12  Paolo Bonzini  <bonzini@gnu.org>
	
	PR c++/24052
	* error.c (dump_expr): Pass LABEL_DECL to dump_decl.  Print
	an ADDR_EXPR of a LABEL_DECL as &&.
	
	==> testsuite/ChangeLog <==
	2005-10-12  Paolo Bonzini  <bonzini@gnu.org>
	
	PR c++/24052
	* g++.dg/ext/label5.C: New.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.4648.2.126&r2=1.4648.2.127
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/error.c.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.279.2.4&r2=1.279.2.5
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=1.5084.2.449&r2=1.5084.2.450
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/ext/label5.C.diff?cvsroot=gcc&only_with_tag=gcc-4_0-branch&r1=NONE&r2=1.1.2.1

Comment 6 GCC Commits 2005-10-12 13:45:14 UTC
Subject: Bug 24052

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-3_4-branch
Changes by:	bonzini@gcc.gnu.org	2005-10-12 13:45:10

Modified files:
	gcc/cp         : error.c ChangeLog 
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/g++.dg/ext: label5.C 

Log message:
	==> cp/ChangeLog <==
	2005-10-12  Paolo Bonzini  <bonzini@gnu.org>
	
	PR c++/24052
	* error.c (dump_expr): Pass LABEL_DECL to dump_decl.  Print
	an ADDR_EXPR of a LABEL_DECL as &&.
	
	==> testsuite/ChangeLog <==
	2005-10-12  Paolo Bonzini  <bonzini@gnu.org>
	
	PR c++/24052
	* g++.dg/ext/label5.C: New.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/ext/label5.C.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=NONE&r2=1.1.4.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/error.c.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.241.4.9&r2=1.241.4.10
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.3892.2.246&r2=1.3892.2.247
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_4-branch&r1=1.3389.2.441&r2=1.3389.2.442

Comment 7 Paolo Bonzini 2005-10-12 13:46:12 UTC
Patch committed to all open branches.