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
2018-11-07 Richard Biener <rguenther@suse.de>
[official-gcc.git]
/
gcc
/
testsuite
/
g++.dg
/
cpp1z
/
launder6.C
blob
babc4b433ad78847f460a5145a2dfa38cc5db2a5
1
// { dg-do run { target c++11 } }
2
// { dg-additional-options "-O2" }
3
// { dg-additional-sources "launder6.cc" }
4
#include <cassert>
5
#include "launder6.h"
6
7
namespace std
8
{
9
template <typename T>
10
T *
11
launder (T *p)
12
{
13
return __builtin_launder (p);
14
}
15
}
16
17
int
18
main ()
19
{
20
int x = 42;
21
B b{{x}};
22
f(b);
23
assert(std::launder(&b.a)->x == 666);
24
}