summaryrefslogtreecommitdiff
path: root/gcc/testsuite/g++.dg/cpp2a/is-constant-evaluated13.C
blob: 4a8af29b0861b8a6a368c6ed11f12ab64b735a8e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// PR c++/105233
// { dg-do compile { target c++14 } }

template <typename T>
constexpr T
foo (T x) noexcept
{
  bool a = __builtin_is_constant_evaluated ();
  T b = 4 * alignof (int);
  return x < b ? b : x;
}

template <typename T>
struct A { T a, b, c; };

template <typename T>
struct alignas (foo (sizeof (A<T>))) B { A<T> d; };

B<int> e;