Debian Codegraph @

gcc/testsuite/g++.dg/cpp1y/constexpr-local4.C

raw
1 // { dg-do compile { target c++14 } }
2
3 struct A
4 {
5 int i;
6 constexpr A(int i): i(i) {};
7 };
8
9 const A a = 42;
10
11 constexpr int f()
12 {
13 const int j = a.i; // { dg-error "'a'" }
14 return j;
15 }
16
17 static_assert (f() == 42,""); // { dg-error "" }