public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/99678] New: c++20 trailing requires clauses allows undeclared identifier
@ 2021-03-20  4:17 hewillk at gmail dot com
  2024-05-07 14:12 ` [Bug c++/99678] " ppalka at gcc dot gnu.org
  2024-05-07 14:13 ` [Bug c++/99678] [concepts] requires-clause " ppalka at gcc dot gnu.org
  0 siblings, 2 replies; 3+ messages in thread
From: hewillk at gmail dot com @ 2021-03-20  4:17 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 99678
           Summary: c++20 trailing requires clauses allows undeclared
                    identifier
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: hewillk at gmail dot com
  Target Milestone: ---

https://godbolt.org/z/reG8qE

====

void bar(auto) requires undeclared_identifier;

====

GCC accepts this code.

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

* [Bug c++/99678] c++20 trailing requires clauses allows undeclared identifier
  2021-03-20  4:17 [Bug c++/99678] New: c++20 trailing requires clauses allows undeclared identifier hewillk at gmail dot com
@ 2024-05-07 14:12 ` ppalka at gcc dot gnu.org
  2024-05-07 14:13 ` [Bug c++/99678] [concepts] requires-clause " ppalka at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: ppalka at gcc dot gnu.org @ 2024-05-07 14:12 UTC (permalink / raw)
  To: gcc-bugs

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

Patrick Palka <ppalka at gcc dot gnu.org> changed:

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

--- Comment #1 from Patrick Palka <ppalka at gcc dot gnu.org> ---
*** Bug 114946 has been marked as a duplicate of this bug. ***

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

* [Bug c++/99678] [concepts] requires-clause allows undeclared identifier
  2021-03-20  4:17 [Bug c++/99678] New: c++20 trailing requires clauses allows undeclared identifier hewillk at gmail dot com
  2024-05-07 14:12 ` [Bug c++/99678] " ppalka at gcc dot gnu.org
@ 2024-05-07 14:13 ` ppalka at gcc dot gnu.org
  1 sibling, 0 replies; 3+ messages in thread
From: ppalka at gcc dot gnu.org @ 2024-05-07 14:13 UTC (permalink / raw)
  To: gcc-bugs

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

Patrick Palka <ppalka at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|c++20 trailing requires     |[concepts] requires-clause
                   |clauses allows undeclared   |allows undeclared
                   |identifier                  |identifier
                 CC|                            |ppalka at gcc dot gnu.org

--- Comment #2 from Patrick Palka <ppalka at gcc dot gnu.org> ---
From PR114946:

(In reply to Nathaniel Shead from comment #0)
> The following sample compiles fine with 'g++ -std=c++20 -pedantic-errors':
> 
>   template <typename T>
>     requires xxxx
>   struct S {};
> 
>   template <typename T>
>     requires xxxx
>   void foo() {}
> 
> Note that 'xxxx' has not been declared or defined.  Both MSVC and Clang
> complain about the undeclared identifier.  GCC does error if we attempt to
> instantiate either of these specialisations, but they always (silently) lose
> to a better match:
> 
>   template <typename T> struct S {};
>   template <typename T> requires xxxx struct S<T> {};
> 
>   template <typename T> void foo() {}
>   template <typename T> requires xxxx void foo() {}
> 
>   int main() {
>     S<int> x;
>     foo<int>();
>   }

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

end of thread, other threads:[~2024-05-07 14:13 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-03-20  4:17 [Bug c++/99678] New: c++20 trailing requires clauses allows undeclared identifier hewillk at gmail dot com
2024-05-07 14:12 ` [Bug c++/99678] " ppalka at gcc dot gnu.org
2024-05-07 14:13 ` [Bug c++/99678] [concepts] requires-clause " 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).