Debian Codegraph @

gcc/testsuite/g++.dg/cpp2a/is-constant-evaluated13.C

raw
1 // PR c++/105233
2 // { dg-do compile { target c++14 } }
3
4 template <typename T>
5 constexpr T
6 foo (T x) noexcept
7 {
8 bool a = __builtin_is_constant_evaluated ();
9 T b = 4 * alignof (int);
10 return x < b ? b : x;
11 }
12
13 template <typename T>
14 struct A { T a, b, c; };
15
16 template <typename T>
17 struct alignas (foo (sizeof (A<T>))) B { A<T> d; };
18
19 B<int> e;