fortran/openmp.cc: Fix var init and locus use to avoid uninit values [PR fortran...
[official-gcc.git] / gcc / testsuite / g++.dg / cpp1y / constexpr-89285-2.C
blob7b129fcee7a530bb33b7f65bd5a08be6ba70a8cb
1 // PR c++/89285
2 // { dg-do compile { target c++14 } }
4 struct A {
5   int a {};
6 };
7 struct B {
8   int b {};
9   constexpr B (A *x) {
10     int *c = &x->a;
11     while (*c)
12       c = reinterpret_cast<int *>((reinterpret_cast<char *>(c) + *c));
13     *c = reinterpret_cast<char *>(this) - reinterpret_cast<char *>(c); // { dg-error "reinterpret_cast" "" { target c++20_down } }
14   }
16 struct C : A {
17   B bar {this};
20 C foo {};