brintos

brintos / llvm-project-archived public Read only

0
0
Text · 708 B · 4ef8403 Raw
28 lines · cpp
1// RUN: %clang_cc1 -std=c++2a -x c++ -verify %s2// expected-no-diagnostics3 4template<typename T, typename U>5constexpr static bool is_same_v = false;6 7template<typename T>8constexpr static bool is_same_v<T, T> = true;9 10namespace PR56154 {11  template <int N> concept C0 = (N == 0);12  template <int N, int N2> concept C0x = C0<N>;13  template <int N1, int N2> concept C00 = C0x<N1, N2> && C0<N2>;14 15  template<int N1, int N2>16  struct A {17    void f() requires C00<N1, N2>;18    void f() requires C0x<N1, N2> = delete;19 20    static short g() requires C00<N1, N2>;21    static int g() requires C0x<N1, N2>;22  };23  void h(A<0, 0> a) {24    a.f();25    static_assert(is_same_v<decltype(&A<0, 0>::g), short(*)()>);26  }27}28