repo.or.cz
/
official-gcc.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
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
blob
7b129fcee7a530bb33b7f65bd5a08be6ba70a8cb
1
// PR c++/89285
2
// { dg-do compile { target c++14 } }
3
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
}
15
};
16
struct C : A {
17
B bar {this};
18
};
19
20
C foo {};