public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "jason at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/102229] [11/12 Regression] 'decltype(auto)' cannot be cv-qualified
Date: Tue, 07 Sep 2021 19:43:33 +0000	[thread overview]
Message-ID: <bug-102229-4-KBW5as74p6@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-102229-4@http.gcc.gnu.org/bugzilla/>

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

Jason Merrill <jason at gcc dot gnu.org> changed:

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

--- Comment #5 from Jason Merrill <jason at gcc dot gnu.org> ---
The standard isn't very clear on this point; it seems like a core issue.

9.2.6/10: A constexpr specifier used in an object declaration declares the
object as const.

9.2.9.6.2/2.2: for a variable declared with a type that contains a placeholder
type, T is the declared type of the variable and E is the initializer.

/5: If the placeholder-type-specifier is of the form type-constraint opt
decltype(auto), T shall be the placeholder alone.

The question is whether constexpr adds const before deduction (so it's part of
"the declared type of the variable") or after.  The latter interpretation seems
more useful, so let's go with that.

  parent reply	other threads:[~2021-09-07 19:43 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-07 13:33 [Bug c++/102229] New: " netcan1996 at gmail dot com
2021-09-07 14:36 ` [Bug c++/102229] " marxin at gcc dot gnu.org
2021-09-07 14:37 ` [Bug c++/102229] [11/12 Regression] " rguenth at gcc dot gnu.org
2021-09-07 14:43 ` mpolacek at gcc dot gnu.org
2021-09-07 15:17 ` mpolacek at gcc dot gnu.org
2021-09-07 19:43 ` jason at gcc dot gnu.org [this message]
2021-09-07 20:06 ` mpolacek at gcc dot gnu.org
2021-09-09 13:56 ` netcan1996 at gmail dot com
2021-09-09 15:08 ` jason at gcc dot gnu.org
2021-12-09 13:58 ` mpolacek at gcc dot gnu.org
2021-12-09 18:34 ` mpolacek at gcc dot gnu.org
2021-12-15 22:48 ` cvs-commit at gcc dot gnu.org
2021-12-15 22:52 ` [Bug c++/102229] [11 " mpolacek at gcc dot gnu.org
2022-01-03 23:45 ` cvs-commit at gcc dot gnu.org
2022-01-03 23:45 ` 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-102229-4-KBW5as74p6@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).