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

            Bug ID: 97450
           Summary: [concepts] Bogus errors during constraint
                    normalization
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ppalka at gcc dot gnu.org
  Target Milestone: ---

We accept the first static_assert below without error, but we reject the second
due to seemingly bogus errors during normalization of E's
constraint-expression.

$ cat testcase.C
template<class T> concept C = true;
template<class T> concept D = C<typename T::type>;
template<class T> concept E = D<int>;
static_assert(D<int>); // OK
static_assert(E<int>); // error

$ g++ -std=c++20 testcase.C
testcase.C:5:22: error: ‘int’ is not a class, struct, or union type
    5 | static_assert(E<int>); // error
      |                      ^
testcase.C:5:22: error: ‘int’ is not a class, struct, or union type
testcase.C:5:15: error: non-constant condition for static assertion
    5 | static_assert(E<int>);  // error
      |               ^~~~~~
testcase.C:5:15: error: ‘int’ is not a class, struct, or union type

Reply via email to