1 // { dg-do run { target c++11 } } 2 // { dg-additional-options "-O2" } 3 // { dg-additional-sources "launder5.cc" } 4 5 #include <cassert> 6 #include "launder5.h" 7 8 namespace std 9 { 10 template <typename T> 11 T * launder(T * p)12 launder (T *p) 13 { 14 return __builtin_launder (p); 15 } 16 } 17 18 19 int main()20main () 21 { 22 B b{{42}}; 23 f(b); 24 assert(std::launder(&b.a)->x == 666); 25 } 26