summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/concepts/expression3.C
blob: 4148aa6511e3f125f5ba3ce031c12e75c27c2066 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// { dg-options "-std=c++17 -fconcepts" }

template<typename T>
concept bool C()
{
  return requires (T& t) { t.~T(); };
}

class S1
{
  ~S1() { }
};

class S2
{
  ~S2() = delete;
};

int main()
{
  static_assert(C<S1>(), ""); // { dg-error "failed" }
  static_assert(C<S2>(), ""); // { dg-error "failed" }
}