public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/11332] New: [3.3?/3.4 regression] Spurious error with casts in ?: expression
@ 2003-06-26 16:45 bangerth at dealii dot org
  2003-06-26 16:46 ` [Bug c++/11332] " bangerth at dealii dot org
                   ` (5 more replies)
  0 siblings, 6 replies; 7+ messages in thread
From: bangerth at dealii dot org @ 2003-06-26 16:45 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11332

           Summary: [3.3?/3.4 regression] Spurious error with casts in ?:
                    expression
           Product: gcc
           Version: 3.3.1
            Status: UNCONFIRMED
          Severity: critical
          Priority: P1
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: bangerth at dealii dot org
                CC: gcc-bugs at gcc dot gnu dot org,mark at codesourcery dot
                    com

Mark, I think this is due to your fixes for 10931/10990/... yesterday:
this doesn't compile any more though I think it should
---------------------------
struct B {};

int main () {
  B a;
  (i ? static_cast<B&>(a) :
       *static_cast<B*>(&a));
}
----------------------------

tmp/gg> ~/tmp/build-gcc/gcc-install/bin/c++ -c x.cc
x.cc: In function `int main()':
x.cc:5: error: `i' undeclared (first use this function)
x.cc:5: error: (Each undeclared identifier is reported only once for each
   function it appears in.)

I don't have a recent enough 3.3 branch, but if your patch went to
the branch as well, it should be investigated for 3.3.1 as well. The error
above is from mainline.

W.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug c++/11332] [3.3?/3.4 regression] Spurious error with casts in ?: expression
  2003-06-26 16:45 [Bug c++/11332] New: [3.3?/3.4 regression] Spurious error with casts in ?: expression bangerth at dealii dot org
@ 2003-06-26 16:46 ` bangerth at dealii dot org
  2003-06-26 22:47 ` mark at codesourcery dot com
                   ` (4 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: bangerth at dealii dot org @ 2003-06-26 16:46 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11332



------- Additional Comments From bangerth at dealii dot org  2003-06-26 16:46 -------
Forget the code and the error message, of course. On shouldn't change it
in the last minute. Here's the correct code and message:

------------------------------------
struct B {};

int main () {
  B a;
  (1 ? static_cast<B&>(a) :
       *static_cast<B*>(&a));
}
-------------------------------------

tmp/gg> ~/tmp/build-gcc/gcc-install/bin/c++ -c x.cc
x.cc: In function `int main()':
x.cc:6: error: operands to ?: have different types


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug c++/11332] [3.3?/3.4 regression] Spurious error with casts in ?: expression
  2003-06-26 16:45 [Bug c++/11332] New: [3.3?/3.4 regression] Spurious error with casts in ?: expression bangerth at dealii dot org
  2003-06-26 16:46 ` [Bug c++/11332] " bangerth at dealii dot org
@ 2003-06-26 22:47 ` mark at codesourcery dot com
  2003-06-27 16:24 ` cvs-commit at gcc dot gnu dot org
                   ` (3 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: mark at codesourcery dot com @ 2003-06-26 22:47 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11332



------- Additional Comments From mark at codesourcery dot com  2003-06-26 22:47 -------
Subject: Re:  [3.3?/3.4 regression] Spurious error with casts
	in ?: expression

On Thu, 2003-06-26 at 09:46, bangerth at dealii dot org wrote:
> PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
> 
> http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11332
> 
> 
> 
> ------- Additional Comments From bangerth at dealii dot org  2003-06-26 16:46 -------
> Forget the code and the error message, of course. On shouldn't change it
> in the last minute. Here's the correct code and message:

I think I know what's wrong, and I'll get it fixed ASAP.

Thanks,


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug c++/11332] [3.3?/3.4 regression] Spurious error with casts in ?: expression
  2003-06-26 16:45 [Bug c++/11332] New: [3.3?/3.4 regression] Spurious error with casts in ?: expression bangerth at dealii dot org
  2003-06-26 16:46 ` [Bug c++/11332] " bangerth at dealii dot org
  2003-06-26 22:47 ` mark at codesourcery dot com
@ 2003-06-27 16:24 ` cvs-commit at gcc dot gnu dot org
  2003-06-27 16:27 ` cvs-commit at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2003-06-27 16:24 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11332



------- Additional Comments From cvs-commit at gcc dot gnu dot org  2003-06-27 16:24 -------
Subject: Bug 11332

CVSROOT:	/cvs/gcc
Module name:	gcc
Changes by:	mmitchel@gcc.gnu.org	2003-06-27 16:24:50

Modified files:
	gcc/cp         : typeck.c ChangeLog 
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/g++.dg/expr: static_cast2.C 

Log message:
	PR c++/11332
	* typeck.c (build_static_cast): Avoid returning expressions with
	reference type.
	
	PR c++/11332
	* g++.dg/expr/static_cast2.C: New test.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/typeck.c.diff?cvsroot=gcc&r1=1.468&r2=1.469
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&r1=1.3459&r2=1.3460
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/expr/static_cast2.C.diff?cvsroot=gcc&r1=NONE&r2=1.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&r1=1.2807&r2=1.2808


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug c++/11332] [3.3?/3.4 regression] Spurious error with casts in ?: expression
  2003-06-26 16:45 [Bug c++/11332] New: [3.3?/3.4 regression] Spurious error with casts in ?: expression bangerth at dealii dot org
                   ` (2 preceding siblings ...)
  2003-06-27 16:24 ` cvs-commit at gcc dot gnu dot org
@ 2003-06-27 16:27 ` cvs-commit at gcc dot gnu dot org
  2003-06-27 16:29 ` pinskia at physics dot uc dot edu
  2003-06-27 16:46 ` mmitchel at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2003-06-27 16:27 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11332



------- Additional Comments From cvs-commit at gcc dot gnu dot org  2003-06-27 16:27 -------
Subject: Bug 11332

CVSROOT:	/cvs/gcc
Module name:	gcc
Branch: 	gcc-3_3-branch
Changes by:	mmitchel@gcc.gnu.org	2003-06-27 16:27:07

Modified files:
	gcc/cp         : typeck.c ChangeLog 
	gcc/testsuite  : ChangeLog 
Added files:
	gcc/testsuite/g++.dg/expr: static_cast2.C 

Log message:
	PR c++/11332
	* typeck.c (build_static_cast): Avoid returning expressions with
	reference type.
	
	PR c++/11332
	* g++.dg/expr/static_cast2.C: New test.

Patches:
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/typeck.c.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.436.2.9&r2=1.436.2.10
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/cp/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.3076.2.164&r2=1.3076.2.165
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/g++.dg/expr/static_cast2.C.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=NONE&r2=1.1.2.1
http://gcc.gnu.org/cgi-bin/cvsweb.cgi/gcc/gcc/testsuite/ChangeLog.diff?cvsroot=gcc&only_with_tag=gcc-3_3-branch&r1=1.2261.2.203&r2=1.2261.2.204


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug c++/11332] [3.3?/3.4 regression] Spurious error with casts in ?: expression
  2003-06-26 16:45 [Bug c++/11332] New: [3.3?/3.4 regression] Spurious error with casts in ?: expression bangerth at dealii dot org
                   ` (3 preceding siblings ...)
  2003-06-27 16:27 ` cvs-commit at gcc dot gnu dot org
@ 2003-06-27 16:29 ` pinskia at physics dot uc dot edu
  2003-06-27 16:46 ` mmitchel at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: pinskia at physics dot uc dot edu @ 2003-06-27 16:29 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11332


pinskia at physics dot uc dot edu changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|3.4                         |3.3.1


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [Bug c++/11332] [3.3?/3.4 regression] Spurious error with casts in ?: expression
  2003-06-26 16:45 [Bug c++/11332] New: [3.3?/3.4 regression] Spurious error with casts in ?: expression bangerth at dealii dot org
                   ` (4 preceding siblings ...)
  2003-06-27 16:29 ` pinskia at physics dot uc dot edu
@ 2003-06-27 16:46 ` mmitchel at gcc dot gnu dot org
  5 siblings, 0 replies; 7+ messages in thread
From: mmitchel at gcc dot gnu dot org @ 2003-06-27 16:46 UTC (permalink / raw)
  To: gcc-bugs

PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11332


mmitchel at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |FIXED


------- Additional Comments From mmitchel at gcc dot gnu dot org  2003-06-27 16:46 -------
Fixed in GCC 3.3.1, GCC 3.4 with attached patches.


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2003-06-27 16:46 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-06-26 16:45 [Bug c++/11332] New: [3.3?/3.4 regression] Spurious error with casts in ?: expression bangerth at dealii dot org
2003-06-26 16:46 ` [Bug c++/11332] " bangerth at dealii dot org
2003-06-26 22:47 ` mark at codesourcery dot com
2003-06-27 16:24 ` cvs-commit at gcc dot gnu dot org
2003-06-27 16:27 ` cvs-commit at gcc dot gnu dot org
2003-06-27 16:29 ` pinskia at physics dot uc dot edu
2003-06-27 16:46 ` mmitchel 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).