aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp2a/concepts-requires22.C
blob: 5afcbbecbd5a9af0dafb5786bb3e5a91d9f4e21a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// PR c++/97093
// { dg-do compile { target c++20 } }
// { dg-additional-options "-fconcepts-diagnostics-depth=3" }

template<class X, X x>
concept C = requires {
    requires (X)x;                     // { dg-message "false" }
  };

template<class X, X x>
concept D = requires {
    requires false || (X)x;                    // { dg-message "false" }
  };

int main() {
  static_assert(C<bool, 0>); // { dg-error "failed" }
  static_assert(D<bool, 0>); // { dg-error "failed" }
}