public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/102419] New: [concepts] [regression] return-type-requirement of "Y<typename T::type>" does not check that T::type actually exists
@ 2021-09-20 21:32 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
                   ` (12 more replies)
  0 siblings, 13 replies; 14+ messages in thread
From: arthur.j.odwyer at gmail dot com @ 2021-09-20 21:32 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 102419
           Summary: [concepts] [regression] return-type-requirement of
                    "Y<typename T::type>" does not check that T::type
                    actually exists
           Product: gcc
           Version: 12.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: arthur.j.odwyer at gmail dot com
  Target Milestone: ---

// https://godbolt.org/z/GWjYYnrnM
template<class, class> concept Y = true;
template<class T> concept X = requires {
    { 1 } -> Y<typename T::type>;
};
static_assert(!X<int>);


<source>:8:15: error: static assertion failed
    8 | static_assert(!X<int>);
      |               ^~~~~~~

Clang and MSVC both appear to have the correct behavior -- or what I believe to
be the consistent/useful/majority behavior, anyway -- which is that since
T::type doesn't exist, the concept shouldn't be satisfied.

This seems to be a regression; according to Godbolt, GCC 10.3 had the correct
behavior but GCC 11.1 lost it. 

I wonder if #92268 could be related somehow, since it seems to be something
like the inverse issue (nonexistent nested type causing a hard error in 10.x),
and it was marked fixed presumably somewhere in the 11.x timeframe.

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

end of thread, other threads:[~2023-11-28 20:44 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-20 21:32 [Bug c++/102419] New: [concepts] [regression] return-type-requirement of "Y<typename T::type>" does not check that T::type actually exists 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 ` [Bug c++/102419] [11/12 Regression][concepts] " jason at gcc dot gnu.org
2022-03-27 19:22 ` 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

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