public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/772] Statement expressions issues
       [not found] <bug-772-4@http.gcc.gnu.org/bugzilla/>
@ 2011-11-23 19:39 ` 3dw4rd at verizon dot net
  2021-01-19 13:57 ` jakub at gcc dot gnu.org
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 15+ messages in thread
From: 3dw4rd at verizon dot net @ 2011-11-23 19:39 UTC (permalink / raw)
  To: gcc-bugs

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

Ed Smith-Rowland <3dw4rd at verizon dot net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |3dw4rd at verizon dot net

--- Comment #14 from Ed Smith-Rowland <3dw4rd at verizon dot net> 2011-11-23 18:57:25 UTC ---
I wonder what the relationship of these expression statements are to lambdas.

Is ({int _a = (a), _b = (b); _a > _b ? _a : _b; })
equivalent to
[](){int _a = (a), _b = (b); _a > _b ? _a : return _b; }}

Can expression statements change enclosing scope variables?  It seems like they
could.  The lambda may need to be mutable.

Maybe these could route to the lambda code.

Just an idle thought.


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

* [Bug c++/772] Statement expressions issues
       [not found] <bug-772-4@http.gcc.gnu.org/bugzilla/>
  2011-11-23 19:39 ` [Bug c++/772] Statement expressions issues 3dw4rd at verizon dot net
@ 2021-01-19 13:57 ` jakub at gcc dot gnu.org
  2021-01-19 13:58 ` jakub at gcc dot gnu.org
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 15+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-01-19 13:57 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=772

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |nbkolchin at gmail dot com

--- Comment #15 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
*** Bug 98682 has been marked as a duplicate of this bug. ***

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

* [Bug c++/772] Statement expressions issues
       [not found] <bug-772-4@http.gcc.gnu.org/bugzilla/>
  2011-11-23 19:39 ` [Bug c++/772] Statement expressions issues 3dw4rd at verizon dot net
  2021-01-19 13:57 ` jakub at gcc dot gnu.org
@ 2021-01-19 13:58 ` jakub at gcc dot gnu.org
  2021-01-20  9:37 ` jakub at gcc dot gnu.org
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 15+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-01-19 13:58 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=772

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jakub at gcc dot gnu.org

--- Comment #16 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
*** Bug 95465 has been marked as a duplicate of this bug. ***

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

* [Bug c++/772] Statement expressions issues
       [not found] <bug-772-4@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2021-01-19 13:58 ` jakub at gcc dot gnu.org
@ 2021-01-20  9:37 ` jakub at gcc dot gnu.org
  2021-07-22 21:57 ` pinskia at gcc dot gnu.org
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 15+ messages in thread
From: jakub at gcc dot gnu.org @ 2021-01-20  9:37 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=772

--- Comment #17 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
(In reply to Ed Smith-Rowland from comment #14)
> I wonder what the relationship of these expression statements are to lambdas.
> 
> Is ({int _a = (a), _b = (b); _a > _b ? _a : _b; })
> equivalent to
> [](){int _a = (a), _b = (b); _a > _b ? _a : return _b; }}
> 
> Can expression statements change enclosing scope variables?  It seems like
> they could.  The lambda may need to be mutable.
> 
> Maybe these could route to the lambda code.
> 
> Just an idle thought.

There are substantial differences.
E.g. one can do ({ return 1; }), with lambdas it means something different,
or ({ break; }) or ({ continue; }).

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

* [Bug c++/772] Statement expressions issues
       [not found] <bug-772-4@http.gcc.gnu.org/bugzilla/>
                   ` (3 preceding siblings ...)
  2021-01-20  9:37 ` jakub at gcc dot gnu.org
@ 2021-07-22 21:57 ` pinskia at gcc dot gnu.org
  2021-07-22 21:57 ` pinskia at gcc dot gnu.org
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 15+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-07-22 21:57 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=772

--- Comment #18 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
*** Bug 17913 has been marked as a duplicate of this bug. ***

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

* [Bug c++/772] Statement expressions issues
       [not found] <bug-772-4@http.gcc.gnu.org/bugzilla/>
                   ` (4 preceding siblings ...)
  2021-07-22 21:57 ` pinskia at gcc dot gnu.org
@ 2021-07-22 21:57 ` pinskia at gcc dot gnu.org
  2021-07-22 21:58 ` pinskia at gcc dot gnu.org
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 15+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-07-22 21:57 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=772

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |donald.chai at synopsys dot com

--- Comment #19 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
*** Bug 70741 has been marked as a duplicate of this bug. ***

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

* [Bug c++/772] Statement expressions issues
       [not found] <bug-772-4@http.gcc.gnu.org/bugzilla/>
                   ` (5 preceding siblings ...)
  2021-07-22 21:57 ` pinskia at gcc dot gnu.org
@ 2021-07-22 21:58 ` pinskia at gcc dot gnu.org
  2021-07-22 23:16 ` pinskia at gcc dot gnu.org
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 15+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-07-22 21:58 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=772

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Blocks|                            |89003
                 CC|                            |wilkey at drive dot ai

--- Comment #20 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
*** Bug 89003 has been marked as a duplicate of this bug. ***


Referenced Bugs:

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=89003
[Bug 89003] Return inside a statement expression while initializing a static
local variable fails to cleanup cxa_guard

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

* [Bug c++/772] Statement expressions issues
       [not found] <bug-772-4@http.gcc.gnu.org/bugzilla/>
                   ` (6 preceding siblings ...)
  2021-07-22 21:58 ` pinskia at gcc dot gnu.org
@ 2021-07-22 23:16 ` pinskia at gcc dot gnu.org
  2022-07-23 10:54 ` egallager at gcc dot gnu.org
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 15+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-07-22 23:16 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=772

Andrew Pinski <pinskia at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |vegard.nossum at gmail dot com

--- Comment #21 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
*** Bug 84745 has been marked as a duplicate of this bug. ***

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

* [Bug c++/772] Statement expressions issues
       [not found] <bug-772-4@http.gcc.gnu.org/bugzilla/>
                   ` (7 preceding siblings ...)
  2021-07-22 23:16 ` pinskia at gcc dot gnu.org
@ 2022-07-23 10:54 ` egallager at gcc dot gnu.org
  2022-10-03 16:41 ` pinskia at gcc dot gnu.org
  2022-12-01  8:41 ` egallager at gcc dot gnu.org
  10 siblings, 0 replies; 15+ messages in thread
From: egallager at gcc dot gnu.org @ 2022-07-23 10:54 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=772

--- Comment #22 from Eric Gallager <egallager at gcc dot gnu.org> ---
oops wait I thought this was a meta-bug for a moment... although, maybe it's
time to start using it as one?

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

* [Bug c++/772] Statement expressions issues
       [not found] <bug-772-4@http.gcc.gnu.org/bugzilla/>
                   ` (8 preceding siblings ...)
  2022-07-23 10:54 ` egallager at gcc dot gnu.org
@ 2022-10-03 16:41 ` pinskia at gcc dot gnu.org
  2022-12-01  8:41 ` egallager at gcc dot gnu.org
  10 siblings, 0 replies; 15+ messages in thread
From: pinskia at gcc dot gnu.org @ 2022-10-03 16:41 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=772

--- Comment #23 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Part of the C++ front-end issues was fixed with
r13-3046-gc823366fdb9069a54a37a3b18b65a4fa69feabfd . I didn't look to see if
all were fixed though.

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

* [Bug c++/772] Statement expressions issues
       [not found] <bug-772-4@http.gcc.gnu.org/bugzilla/>
                   ` (9 preceding siblings ...)
  2022-10-03 16:41 ` pinskia at gcc dot gnu.org
@ 2022-12-01  8:41 ` egallager at gcc dot gnu.org
  10 siblings, 0 replies; 15+ messages in thread
From: egallager at gcc dot gnu.org @ 2022-12-01  8:41 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=772

--- Comment #24 from Eric Gallager <egallager at gcc dot gnu.org> ---
(In reply to Eric Gallager from comment #22)
> oops wait I thought this was a meta-bug for a moment... although, maybe it's
> time to start using it as one?

Never mind about this; looks like there's a keyword (stmt-expr) now to use
instead...

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

* [Bug c++/772] Statement expressions issues
       [not found] <20001111043600.772.jsm28@gcc.gnu.org>
                   ` (2 preceding siblings ...)
  2005-09-09 12:38 ` rguenth at gcc dot gnu dot org
@ 2005-09-09 15:41 ` joseph at codesourcery dot com
  3 siblings, 0 replies; 15+ messages in thread
From: joseph at codesourcery dot com @ 2005-09-09 15:41 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From joseph at codesourcery dot com  2005-09-09 15:41 -------
Subject: Re:  Statement expressions issues

On Fri, 9 Sep 2005, rguenth at gcc dot gnu dot org wrote:

> No testcase?  But I think this is fixed on the mainline and only pending on 4.0.
> See PR17913.

The test is gcc.dg/stmt-expr-label-*.c (modulo the exact diagnostic text) 
and I don't think this is fixed for C++ on mainline.  This is separate 
from bug 17913 where there is a case which is valid at compile time and 
invalid at runtime, involving computed gotos: 
gcc.c-torture/compile/pr17913.c, which formerly ICEd with optimization but 
was fixed not to do so (at least for C; appears fixed for C++ as well with 
the mainline/4.0 compilers I have to hand to test but they are rather 
old).  It just happens that almost all cases of bug 17913 were addressed 
for C by fixing bug 772 for C, leaving only the case of computed gotos to 
be fixed separately in 17913 (for C).

The rules for invalidity for jumps into statement expressions are much the 
same as those in C++ for jumps bypassing initializations (imagining that 
each statement expression starts with such an initialization); it might be 
possible to reuse that code to fix this bug for C++.



-- 


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


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

* [Bug c++/772] Statement expressions issues
       [not found] <20001111043600.772.jsm28@gcc.gnu.org>
  2005-03-31  7:26 ` pinskia at gcc dot gnu dot org
  2005-04-03 18:56 ` pinskia at gcc dot gnu dot org
@ 2005-09-09 12:38 ` rguenth at gcc dot gnu dot org
  2005-09-09 15:41 ` joseph at codesourcery dot com
  3 siblings, 0 replies; 15+ messages in thread
From: rguenth at gcc dot gnu dot org @ 2005-09-09 12:38 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From rguenth at gcc dot gnu dot org  2005-09-09 12:38 -------
No testcase?  But I think this is fixed on the mainline and only pending on 4.0.
See PR17913.

-- 


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


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

* [Bug c++/772] Statement expressions issues
       [not found] <20001111043600.772.jsm28@gcc.gnu.org>
  2005-03-31  7:26 ` pinskia at gcc dot gnu dot org
@ 2005-04-03 18:56 ` pinskia at gcc dot gnu dot org
  2005-09-09 12:38 ` rguenth at gcc dot gnu dot org
  2005-09-09 15:41 ` joseph at codesourcery dot com
  3 siblings, 0 replies; 15+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-04-03 18:56 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-04-03 18:56 -------
*** Bug 20741 has been marked as a duplicate of this bug. ***

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |pluto at pld-linux dot org


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


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

* [Bug c++/772] Statement expressions issues
       [not found] <20001111043600.772.jsm28@gcc.gnu.org>
@ 2005-03-31  7:26 ` pinskia at gcc dot gnu dot org
  2005-04-03 18:56 ` pinskia at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 15+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2005-03-31  7:26 UTC (permalink / raw)
  To: gcc-bugs


------- Additional Comments From pinskia at gcc dot gnu dot org  2005-03-31 07:26 -------
Only a C++ front-end problem now.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
          Component|c                           |c++


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


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

end of thread, other threads:[~2022-12-01  8:41 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-772-4@http.gcc.gnu.org/bugzilla/>
2011-11-23 19:39 ` [Bug c++/772] Statement expressions issues 3dw4rd at verizon dot net
2021-01-19 13:57 ` jakub at gcc dot gnu.org
2021-01-19 13:58 ` jakub at gcc dot gnu.org
2021-01-20  9:37 ` jakub at gcc dot gnu.org
2021-07-22 21:57 ` pinskia at gcc dot gnu.org
2021-07-22 21:57 ` pinskia at gcc dot gnu.org
2021-07-22 21:58 ` pinskia at gcc dot gnu.org
2021-07-22 23:16 ` pinskia at gcc dot gnu.org
2022-07-23 10:54 ` egallager at gcc dot gnu.org
2022-10-03 16:41 ` pinskia at gcc dot gnu.org
2022-12-01  8:41 ` egallager at gcc dot gnu.org
     [not found] <20001111043600.772.jsm28@gcc.gnu.org>
2005-03-31  7:26 ` pinskia at gcc dot gnu dot org
2005-04-03 18:56 ` pinskia at gcc dot gnu dot org
2005-09-09 12:38 ` rguenth at gcc dot gnu dot org
2005-09-09 15:41 ` joseph at codesourcery dot com

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).