modula2: M2MetaError.{def,mod} and P2SymBuild.mod further cleanup
[official-gcc.git] / gcc / testsuite / g++.dg / cpp1z / launder6.C
blobe92b02cd5e2aefda5d4b43dfaa80d0c4ca7ae26c
1 // { dg-do run { target c++11 } }
2 // { dg-additional-options "-O2" }
3 // { dg-additional-sources "launder6.cc" }
4 // { dg-skip-if "requires hosted libstdc++ for cassert" { ! hostedlib } }
5 #include <cassert>
6 #include "launder6.h"
8 namespace std
10   template <typename T>
11   T *
12   launder (T *p)
13   {
14     return __builtin_launder (p);
15   }
18 int
19 main ()
21   int x = 42;
22   B b{{x}};
23   f(b);
24   assert(std::launder(&b.a)->x == 666);