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
Add __builtion_unreachable to vector::size(), vector::capacity()
[official-gcc.git]
/
gcc
/
testsuite
/
g++.dg
/
cpp1y
/
constexpr-base2.C
blob
a267c14bc8024d516b3404c5be70e27a3623404b
1
// PR c++/103879
2
// { dg-do compile { target c++14 } }
3
4
struct A { int n = 42; };
5
struct B : A { };
6
struct C { B b; };
7
8
constexpr int f() {
9
C c;
10
A& a = static_cast<A&>(c.b);
11
B& b = static_cast<B&>(a);
12
return b.n;
13
}
14
15
static_assert(f() == 42, "");