public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "cvs-commit at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/116418] [12/13/14/15 Regression] statement expressions as initializer for decltype auto breaks in templates with optimization turned on and debug info turned on due to gstatement-frontiers
Date: Thu, 12 Sep 2024 16:45:12 +0000	[thread overview]
Message-ID: <bug-116418-4-IkYdkVuq2K@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-116418-4@http.gcc.gnu.org/bugzilla/>

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

--- Comment #9 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Patrick Palka <ppalka@gcc.gnu.org>:

https://gcc.gnu.org/g:12bdcc3d7970860b9d66ed4dea203bde8fd68d4d

commit r15-3611-g12bdcc3d7970860b9d66ed4dea203bde8fd68d4d
Author: Patrick Palka <ppalka@redhat.com>
Date:   Thu Sep 12 12:45:03 2024 -0400

    c++: decltype(auto) deduction of statement-expression [PR116418]

    r8-7538 for PR84968 made strip_typedefs_expr diagnose STATEMENT_LIST
    so that we reject statement-expressions in noexcept-specifiers to
    match our behavior in template arguments (which the parser diagnoses
    directly).

    Later r11-7452 made decltype(auto) deduction canonicalize the expression
    (as an implementation detail) which in turn calls strip_typedefs_expr,
    and so ever since we inadvertently reject decltype(auto) deduction of a
    statement-expression.

    This patch just removes the diagnostic in strip_typedefs_expr and instead
    treats statement-expressions similar to lambda-expressions.  The function
    doesn't seem like the right place for such a diagnostic and so it seems
    easier to just accept rather than try to reject them in a suitable place.

            PR c++/116418

    gcc/cp/ChangeLog:

            * tree.cc (strip_typedefs_expr) <case STATEMENT_LIST>: Replace
            this error path with ...
            <case STMT_EXPR>: ... this, returning the original tree.

    gcc/testsuite/ChangeLog:

            * g++.dg/eh/pr84968.C: No longer expect an ahead of time diagnostic
            for the statement-expresssion.  Instantiate the template and expect
            an incomplete type error instead.
            * g++.dg/ext/stmtexpr26.C: New test.

    Reviewed-by: Jason Merrill <jason@redhat.com>

  parent reply	other threads:[~2024-09-12 16:45 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-08-19 15:58 [Bug c++/116418] New: [11/12/13/14/15 Regression] Nested statement expressions with decltype auto in template break valentin at tolmer dot fr
2024-08-19 16:10 ` [Bug c++/116418] [12/13/14/15 " pinskia at gcc dot gnu.org
2024-08-20  7:36 ` rguenth at gcc dot gnu.org
2024-08-20 13:54 ` valentin at tolmer dot fr
2024-08-20 17:21 ` [Bug c++/116418] [12/13/14/15 Regression] statement expressions as initializer for decltype auto breaks in templates with optimization turned on pinskia at gcc dot gnu.org
2024-09-03 15:57 ` jakub at gcc dot gnu.org
2024-09-03 15:59 ` [Bug c++/116418] [12/13/14/15 Regression] statement expressions as initializer for decltype auto breaks in templates with optimization turned on and debug info " pinskia at gcc dot gnu.org
2024-09-03 16:03 ` pinskia at gcc dot gnu.org
2024-09-03 16:08 ` [Bug c++/116418] [12/13/14/15 Regression] statement expressions as initializer for decltype auto breaks in templates with optimization turned on and debug info turned on due to gstatement-frontiers jakub at gcc dot gnu.org
2024-09-03 16:08 ` jakub at gcc dot gnu.org
2024-09-03 16:18 ` jakub at gcc dot gnu.org
2024-09-11  0:39 ` ppalka at gcc dot gnu.org
2024-09-12 16:45 ` cvs-commit at gcc dot gnu.org [this message]
2024-09-20 22:10 ` cvs-commit at gcc dot gnu.org
2024-09-20 22:10 ` [Bug c++/116418] [12/13 " ppalka at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-116418-4-IkYdkVuq2K@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).