public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/114946] New: [concepts] No error for invalid requires constraint in declaration
@ 2024-05-05  5:05 nshead at gcc dot gnu.org
  2024-05-07 14:12 ` [Bug c++/114946] " ppalka at gcc dot gnu.org
  0 siblings, 1 reply; 2+ messages in thread
From: nshead at gcc dot gnu.org @ 2024-05-05  5:05 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 114946
           Summary: [concepts] No error for invalid requires constraint in
                    declaration
           Product: gcc
           Version: 15.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: nshead at gcc dot gnu.org
  Target Milestone: ---

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] 2+ messages in thread

* [Bug c++/114946] [concepts] No error for invalid requires constraint in declaration
  2024-05-05  5:05 [Bug c++/114946] New: [concepts] No error for invalid requires constraint in declaration nshead at gcc dot gnu.org
@ 2024-05-07 14:12 ` ppalka at gcc dot gnu.org
  0 siblings, 0 replies; 2+ 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=114946

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
                 CC|                            |ppalka at gcc dot gnu.org
         Resolution|---                         |DUPLICATE

--- Comment #1 from Patrick Palka <ppalka at gcc dot gnu.org> ---
dup

*** This bug has been marked as a duplicate of bug 99678 ***

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

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

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-05-05  5:05 [Bug c++/114946] New: [concepts] No error for invalid requires constraint in declaration nshead at gcc dot gnu.org
2024-05-07 14:12 ` [Bug c++/114946] " 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).