public inbox for gcc-bugs@sourceware.org help / color / mirror / Atom feed
From: "mpolacek at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org> To: gcc-bugs@gcc.gnu.org Subject: [Bug c++/103401] [11/12 Regression] gcc accepts decltype(auto(0)) as the parameter of the function Date: Thu, 25 Nov 2021 00:56:48 +0000 [thread overview] Message-ID: <bug-103401-4-4LafzEaj78@http.gcc.gnu.org/bugzilla/> (raw) In-Reply-To: <bug-103401-4@http.gcc.gnu.org/bugzilla/> https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103401 --- Comment #3 from Marek Polacek <mpolacek at gcc dot gnu.org> --- This is trickier than it seemed. void f(decltype(auto(0))) { } is actually valid in C++23 (probably) since auto(x) is supported. So I think it's essentially like void f(int) { } The r11-1913 change is OK: we need to make sure that we see '(auto)' after decltype to go ahead with 'decltype(auto)'. I think we shouldn't be calling synthesize_implicit_template_parm for auto(x) in a parameter-list. More tests: void f1 (decltype(auto(0))); void f2 (decltype(auto{0})); void f3 (int = auto(42)); void f4 (int = auto{42}); void f5 (decltype(auto(0)) = auto(42)); // Careful about just checking ( after auto: void f6 (auto (x));
next prev parent reply other threads:[~2021-11-25 0:56 UTC|newest] Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top 2021-11-24 7:57 [Bug c++/103401] New: " hewillk at gmail dot com 2021-11-24 9:38 ` [Bug c++/103401] " redi at gcc dot gnu.org 2021-11-24 9:40 ` [Bug c++/103401] [11/12 Regression] " redi at gcc dot gnu.org 2021-11-24 14:37 ` mpolacek at gcc dot gnu.org 2021-11-25 0:56 ` mpolacek at gcc dot gnu.org [this message] 2021-11-25 2:44 ` mpolacek at gcc dot gnu.org 2021-12-09 16:49 ` cvs-commit at gcc dot gnu.org 2021-12-09 17:26 ` mpolacek 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-103401-4-4LafzEaj78@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: linkBe 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).