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

            Bug ID: 98700
           Summary: Infinite stream of error messages from bad concept
                    code
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: igfoo at github dot com
  Target Milestone: ---

With `test.cpp` containing:

concept con = requires(int a, int b) { { __a = __b }

with both

g++-10 (Ubuntu 10.2.0-5ubuntu1~20.04) 10.2.0
Copyright (C) 2020 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

and

g++ (GCC) 11.0.0 20210115 (experimental)
Copyright © 2021 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
(built from master at b36c9cd09472c8efb8405726b7cc94fa4ae7059f)

Running "g++ -std=c++20 -c test.cpp" gives me an infinite stream of errors. For
version 11, it begins:

test.cpp:1:1: warning: C++20 concept definition syntax is ‘concept <name> =
<expr>’
    1 | concept con = requires(int a, int b) { { __a = __b }
      | ^~~~~~~
test.cpp:1:1: error: a non-template variable cannot be ‘concept’
test.cpp:1:42: error: ‘__a’ was not declared in this scope
    1 | concept con = requires(int a, int b) { { __a = __b }
      |                                          ^~~
test.cpp:1:48: error: ‘__b’ was not declared in this scope
    1 | concept con = requires(int a, int b) { { __a = __b }
      |                                                ^~~
test.cpp:1:53: error: expected ‘;’ at end of input
    1 | concept con = requires(int a, int b) { { __a = __b }
      |                                                     ^
      |                                                     ;
test.cpp:1:53: error: expected primary-expression at end of input
test.cpp:1:53: error: expected ‘;’ at end of input
    1 | concept con = requires(int a, int b) { { __a = __b }
      |                                                     ^
      |                                                     ;
test.cpp:1:53: error: expected primary-expression at end of input
test.cpp:1:53: error: expected ‘;’ at end of input
    1 | concept con = requires(int a, int b) { { __a = __b }
      |                                                     ^
      |                                                     ;
test.cpp:1:53: error: expected primary-expression at end of input
test.cpp:1:53: error: expected ‘;’ at end of input
    1 | concept con = requires(int a, int b) { { __a = __b }
      |                                                     ^
      |                                                     ;
test.cpp:1:53: error: expected primary-expression at end of input
test.cpp:1:53: error: expected ‘;’ at end of input
    1 | concept con = requires(int a, int b) { { __a = __b }
      |                                                     ^
      |                                                     ;

Reply via email to