public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/35334] New: [4.1/4.2/4.3/4.4 regression] Broken diagnostic for complex cast
@ 2008-02-23 19:42 reichelt at gcc dot gnu dot org
2008-02-24 22:02 ` [Bug c++/35334] " rguenth at gcc dot gnu dot org
` (9 more replies)
0 siblings, 10 replies; 11+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2008-02-23 19:42 UTC (permalink / raw)
To: gcc-bugs
A broken diagnostic is issued for the following invalid code snippet since
at least GCC 2.95.3:
====================================================
void foo(__complex__ unsigned int i)
{
((__complex__ int)i)();
}
====================================================
bug.cc: In function 'void foo(unsigned int __complex__)':
bug.cc:3: error: '#'complex_expr' not supported by dump_expr#<expression
error>' cannot be used as a function
--
Summary: [4.1/4.2/4.3/4.4 regression] Broken diagnostic for
complex cast
Product: gcc
Version: 4.4.0
Status: UNCONFIRMED
Keywords: diagnostic, monitored
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: reichelt at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35334
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug c++/35334] [4.1/4.2/4.3/4.4 regression] Broken diagnostic for complex cast
2008-02-23 19:42 [Bug c++/35334] New: [4.1/4.2/4.3/4.4 regression] Broken diagnostic for complex cast reichelt at gcc dot gnu dot org
@ 2008-02-24 22:02 ` rguenth at gcc dot gnu dot org
2008-05-19 20:34 ` jsm28 at gcc dot gnu dot org
` (8 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2008-02-24 22:02 UTC (permalink / raw)
To: gcc-bugs
------- Comment #1 from rguenth at gcc dot gnu dot org 2008-02-24 22:01 -------
Confirmed.
--
rguenth at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed|0 |1
Priority|P3 |P2
Last reconfirmed|0000-00-00 00:00:00 |2008-02-24 22:01:18
date| |
Target Milestone|--- |4.2.4
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35334
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug c++/35334] [4.1/4.2/4.3/4.4 regression] Broken diagnostic for complex cast
2008-02-23 19:42 [Bug c++/35334] New: [4.1/4.2/4.3/4.4 regression] Broken diagnostic for complex cast reichelt at gcc dot gnu dot org
2008-02-24 22:02 ` [Bug c++/35334] " rguenth at gcc dot gnu dot org
@ 2008-05-19 20:34 ` jsm28 at gcc dot gnu dot org
2008-07-04 23:03 ` [Bug c++/35334] [4.2/4.3/4.4 " jsm28 at gcc dot gnu dot org
` (7 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: jsm28 at gcc dot gnu dot org @ 2008-05-19 20:34 UTC (permalink / raw)
To: gcc-bugs
------- Comment #2 from jsm28 at gcc dot gnu dot org 2008-05-19 20:25 -------
4.2.4 is being released, changing milestones to 4.2.5.
--
jsm28 at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Target Milestone|4.2.4 |4.2.5
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35334
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug c++/35334] [4.2/4.3/4.4 regression] Broken diagnostic for complex cast
2008-02-23 19:42 [Bug c++/35334] New: [4.1/4.2/4.3/4.4 regression] Broken diagnostic for complex cast reichelt at gcc dot gnu dot org
2008-02-24 22:02 ` [Bug c++/35334] " rguenth at gcc dot gnu dot org
2008-05-19 20:34 ` jsm28 at gcc dot gnu dot org
@ 2008-07-04 23:03 ` jsm28 at gcc dot gnu dot org
2008-10-25 14:54 ` manu at gcc dot gnu dot org
` (6 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: jsm28 at gcc dot gnu dot org @ 2008-07-04 23:03 UTC (permalink / raw)
To: gcc-bugs
------- Comment #3 from jsm28 at gcc dot gnu dot org 2008-07-04 23:02 -------
Closing 4.1 branch.
--
jsm28 at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Summary|[4.1/4.2/4.3/4.4 regression]|[4.2/4.3/4.4 regression]
|Broken diagnostic for |Broken diagnostic for
|complex cast |complex cast
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35334
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug c++/35334] [4.2/4.3/4.4 regression] Broken diagnostic for complex cast
2008-02-23 19:42 [Bug c++/35334] New: [4.1/4.2/4.3/4.4 regression] Broken diagnostic for complex cast reichelt at gcc dot gnu dot org
` (2 preceding siblings ...)
2008-07-04 23:03 ` [Bug c++/35334] [4.2/4.3/4.4 " jsm28 at gcc dot gnu dot org
@ 2008-10-25 14:54 ` manu at gcc dot gnu dot org
2008-11-03 10:40 ` manu at gcc dot gnu dot org
` (5 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: manu at gcc dot gnu dot org @ 2008-10-25 14:54 UTC (permalink / raw)
To: gcc-bugs
[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain, Size: 825 bytes --]
------- Comment #4 from manu at gcc dot gnu dot org 2008-10-25 14:52 -------
The C front-end prints:
error: called object (int __complex__){(int)__real__ (i), (int)__imag__ (i)}
is not a function
which is not great either.
We could try to dump the complex expression as a CONVERT_EXPR:
error: (int __complex__)((int)__real__ i) cannot be used as a function
or we can just print something like
error: __complex__ expression cannot be used as a function
I think I prefer the latter. Any opinions?
--
manu at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |manu at gcc dot gnu dot org
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35334
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug c++/35334] [4.2/4.3/4.4 regression] Broken diagnostic for complex cast
2008-02-23 19:42 [Bug c++/35334] New: [4.1/4.2/4.3/4.4 regression] Broken diagnostic for complex cast reichelt at gcc dot gnu dot org
` (3 preceding siblings ...)
2008-10-25 14:54 ` manu at gcc dot gnu dot org
@ 2008-11-03 10:40 ` manu at gcc dot gnu dot org
2008-11-03 11:05 ` jakub at gcc dot gnu dot org
` (4 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: manu at gcc dot gnu dot org @ 2008-11-03 10:40 UTC (permalink / raw)
To: gcc-bugs
------- Comment #5 from manu at gcc dot gnu dot org 2008-11-03 10:38 -------
What we want to do about this?
Anyway, P2 is probably is too high severity. This obviously doesn't have a high
priority. And I would argue that this is probably not a regression.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35334
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug c++/35334] [4.2/4.3/4.4 regression] Broken diagnostic for complex cast
2008-02-23 19:42 [Bug c++/35334] New: [4.1/4.2/4.3/4.4 regression] Broken diagnostic for complex cast reichelt at gcc dot gnu dot org
` (4 preceding siblings ...)
2008-11-03 10:40 ` manu at gcc dot gnu dot org
@ 2008-11-03 11:05 ` jakub at gcc dot gnu dot org
2008-11-03 11:13 ` manu at gcc dot gnu dot org
` (3 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu dot org @ 2008-11-03 11:05 UTC (permalink / raw)
To: gcc-bugs
------- Comment #6 from jakub at gcc dot gnu dot org 2008-11-03 11:04 -------
I think the "cannot be used as a function" error should print the exact object
only if it is a DECL_P, otherwise just print error: expression cannot be used
as a function". Imagine if the object is a 100KB statement expression, do we
want to print that? When we have to start/end location information, we'd just
print a caret range.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35334
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug c++/35334] [4.2/4.3/4.4 regression] Broken diagnostic for complex cast
2008-02-23 19:42 [Bug c++/35334] New: [4.1/4.2/4.3/4.4 regression] Broken diagnostic for complex cast reichelt at gcc dot gnu dot org
` (5 preceding siblings ...)
2008-11-03 11:05 ` jakub at gcc dot gnu dot org
@ 2008-11-03 11:13 ` manu at gcc dot gnu dot org
2008-11-11 14:09 ` jakub at gcc dot gnu dot org
` (2 subsequent siblings)
9 siblings, 0 replies; 11+ messages in thread
From: manu at gcc dot gnu dot org @ 2008-11-03 11:13 UTC (permalink / raw)
To: gcc-bugs
------- Comment #7 from manu at gcc dot gnu dot org 2008-11-03 11:12 -------
(In reply to comment #6)
> I think the "cannot be used as a function" error should print the exact object
> only if it is a DECL_P, otherwise just print error: expression cannot be used
> as a function". Imagine if the object is a 100KB statement expression, do we
> want to print that? When we have to start/end location information, we'd just
> print a caret range.
This doesn't only apply to that particular error but anywhere that tries to
print a complex_expr. So it cannot be solved at that level. It must be solved
inside pretty-printer.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35334
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug c++/35334] [4.2/4.3/4.4 regression] Broken diagnostic for complex cast
2008-02-23 19:42 [Bug c++/35334] New: [4.1/4.2/4.3/4.4 regression] Broken diagnostic for complex cast reichelt at gcc dot gnu dot org
` (6 preceding siblings ...)
2008-11-03 11:13 ` manu at gcc dot gnu dot org
@ 2008-11-11 14:09 ` jakub at gcc dot gnu dot org
2008-11-12 8:21 ` jakub at gcc dot gnu dot org
2008-12-31 14:12 ` [Bug c++/35334] " reichelt at gcc dot gnu dot org
9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu dot org @ 2008-11-11 14:09 UTC (permalink / raw)
To: gcc-bugs
------- Comment #8 from jakub at gcc dot gnu dot org 2008-11-11 14:08 -------
Patch posted.
--
jakub at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
AssignedTo|unassigned at gcc dot gnu |jakub at gcc dot gnu dot org
|dot org |
URL| |http://gcc.gnu.org/ml/gcc-
| |patches/2008-
| |11/msg00415.html
Status|NEW |ASSIGNED
Last reconfirmed|2008-02-24 22:01:18 |2008-11-11 14:08:19
date| |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35334
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug c++/35334] [4.2/4.3/4.4 regression] Broken diagnostic for complex cast
2008-02-23 19:42 [Bug c++/35334] New: [4.1/4.2/4.3/4.4 regression] Broken diagnostic for complex cast reichelt at gcc dot gnu dot org
` (7 preceding siblings ...)
2008-11-11 14:09 ` jakub at gcc dot gnu dot org
@ 2008-11-12 8:21 ` jakub at gcc dot gnu dot org
2008-12-31 14:12 ` [Bug c++/35334] " reichelt at gcc dot gnu dot org
9 siblings, 0 replies; 11+ messages in thread
From: jakub at gcc dot gnu dot org @ 2008-11-12 8:21 UTC (permalink / raw)
To: gcc-bugs
------- Comment #9 from jakub at gcc dot gnu dot org 2008-11-12 08:20 -------
Subject: Bug 35334
Author: jakub
Date: Wed Nov 12 08:18:45 2008
New Revision: 141783
URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=141783
Log:
PR c++/35334
* c-pretty-print.c (pp_c_complex_expr): New function.
(pp_c_postfix_expression) <case COMPLEX_EXPR>: Call it.
* error.c (dump_expr): Handle COMPLEX_EXPR.
* gcc.dg/pr35334.c: New test.
* g++.dg/other/error29.C: New test.
Added:
trunk/gcc/testsuite/g++.dg/other/error29.C
trunk/gcc/testsuite/gcc.dg/pr35334.c
Modified:
trunk/gcc/ChangeLog
trunk/gcc/c-pretty-print.c
trunk/gcc/cp/ChangeLog
trunk/gcc/cp/error.c
trunk/gcc/testsuite/ChangeLog
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35334
^ permalink raw reply [flat|nested] 11+ messages in thread
* [Bug c++/35334] Broken diagnostic for complex cast
2008-02-23 19:42 [Bug c++/35334] New: [4.1/4.2/4.3/4.4 regression] Broken diagnostic for complex cast reichelt at gcc dot gnu dot org
` (8 preceding siblings ...)
2008-11-12 8:21 ` jakub at gcc dot gnu dot org
@ 2008-12-31 14:12 ` reichelt at gcc dot gnu dot org
9 siblings, 0 replies; 11+ messages in thread
From: reichelt at gcc dot gnu dot org @ 2008-12-31 14:12 UTC (permalink / raw)
To: gcc-bugs
------- Comment #10 from reichelt at gcc dot gnu dot org 2008-12-31 14:09 -------
This bug is not a regression.
Closing it because it's now fixed on trunk.
--
reichelt at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|ASSIGNED |RESOLVED
Resolution| |FIXED
Summary|[4.2/4.3 regression] Broken |Broken diagnostic for
|diagnostic for complex cast |complex cast
Target Milestone|4.2.5 |4.4.0
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=35334
^ permalink raw reply [flat|nested] 11+ messages in thread
end of thread, other threads:[~2008-12-31 14:12 UTC | newest]
Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-02-23 19:42 [Bug c++/35334] New: [4.1/4.2/4.3/4.4 regression] Broken diagnostic for complex cast reichelt at gcc dot gnu dot org
2008-02-24 22:02 ` [Bug c++/35334] " rguenth at gcc dot gnu dot org
2008-05-19 20:34 ` jsm28 at gcc dot gnu dot org
2008-07-04 23:03 ` [Bug c++/35334] [4.2/4.3/4.4 " jsm28 at gcc dot gnu dot org
2008-10-25 14:54 ` manu at gcc dot gnu dot org
2008-11-03 10:40 ` manu at gcc dot gnu dot org
2008-11-03 11:05 ` jakub at gcc dot gnu dot org
2008-11-03 11:13 ` manu at gcc dot gnu dot org
2008-11-11 14:09 ` jakub at gcc dot gnu dot org
2008-11-12 8:21 ` jakub at gcc dot gnu dot org
2008-12-31 14:12 ` [Bug c++/35334] " reichelt at gcc dot gnu dot org
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).