aboutsummaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp2a/consteval27.C
blob: 72d56df9dc536e030a6f233a3b3663ad9b76507e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
// PR c++/104055
// { dg-do run { target c++20 } }

int g;

struct A { 
  ~A () { if (a != 17 || b != 26) __builtin_abort (); g = 42; }
  consteval A () : a (17), b (26) {}
  int a, b;
};

int
main ()
{
  A{};
  if (g != 42)
    __builtin_abort ();
}