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++/102419] [11/12 Regression][concepts] return-type-requirement of "Y<typename T::type>" does not check that T::type actually exists
Date: Sun, 27 Mar 2022 19:21:27 +0000	[thread overview]
Message-ID: <bug-102419-4-VkCAW0WLlO@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-102419-4@http.gcc.gnu.org/bugzilla/>

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jason at gcc dot gnu.org
            Summary|[11/12                      |[11/12
                   |Regression][concepts]       |Regression][concepts]
                   |[regression]                |return-type-requirement of
                   |return-type-requirement of  |"Y<typename T::type>" does
                   |"Y<typename T::type>" does  |not check that T::type
                   |not check that T::type      |actually exists
                   |actually exists             |

--- Comment #6 from Jason Merrill <jason at gcc dot gnu.org> ---
Concept satisfaction was very deliberately designed in committee discussion to
work differently from void_t, based on the normalized form rather than the
concept-id as written.  So this example is well-formed:

template <class Tz> concept is_void = same_as(Tz, void);
template <class Ta, class Tb> concept void_or_same = is_void<Ta> || same_as<Ta,
Tb>;
template <class T> void f() requires void_or_same<T,T&>;
int main() { f<void>(); } // OK

It definitely is an inconsistency with non-concept template-ids, but that's the
design.

C++20 national body comment CA104
(http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2020/p2103r0.html#CA104) is
about one situation where we do need to substitute directly into the arguments,
but it is a single exception to the rule.

In the discussion of CA104 I suggested that we might want to reconsider this
design (on 2019-11-08, if you want to look up the reflector message), and make
my example above ill-formed, but we ended up making an exception instead.

The behavior change you are seeing is from properly implementing
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2019/p1452r2.html and not a
bug.

  parent reply	other threads:[~2022-03-27 19:21 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-20 21:32 [Bug c++/102419] New: [concepts] [regression] " arthur.j.odwyer at gmail dot com
2021-09-21  6:46 ` [Bug c++/102419] [11/12 Regression][concepts] " rguenth at gcc dot gnu.org
2021-09-21 14:49 ` ppalka at gcc dot gnu.org
2021-09-21 14:56 ` ppalka at gcc dot gnu.org
2021-09-21 15:18 ` ppalka at gcc dot gnu.org
2021-09-21 20:00 ` arthur.j.odwyer at gmail dot com
2021-09-23 14:58 ` ppalka at gcc dot gnu.org
2022-01-17 13:29 ` rguenth at gcc dot gnu.org
2022-03-27 19:21 ` jason at gcc dot gnu.org [this message]
2022-03-27 19:22 ` [Bug c++/102419] [11/12 Regression][concepts] " jason at gcc dot gnu.org
2022-04-21  7:50 ` rguenth at gcc dot gnu.org
2023-03-30 17:08 ` [Bug c++/102419] [11/12/13 " ppalka at gcc dot gnu.org
2023-05-29 10:05 ` [Bug c++/102419] [11/12/13/14 " jakub at gcc dot gnu.org
2023-11-28 20:44 ` 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-102419-4-VkCAW0WLlO@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).