aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp2a/consteval31.C
blob: 85a4d1794e511fc83e8e663d35f2445c3d868969 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// PR c++/105912
// { dg-do compile { target c++20 } }

struct A {
  consteval A operator+() {
    return {};
  }
};

consteval A operator~(A) {
  return {};
}

consteval A operator+(A, A) {
  return {};
}

template<class>
void f() {
  A a;
  ~a;
  a + a;
  +a;
}

template void f<int>();