gcc/testsuite/g++.dg/cpp0x/constexpr-volatile4.C
raw| 1 | // PR c++/118661 |
| 2 | // { dg-do compile { target c++11 } } |
| 3 | |
| 4 | using nullptr_t = decltype (nullptr); |
| 5 | constexpr volatile nullptr_t a = {}; |
| 6 | constexpr nullptr_t b = a; |
| 7 | |
| 8 | constexpr nullptr_t |
| 9 | foo () |
| 10 | { |
| 11 | #if __cplusplus >= 201402L |
| 12 | volatile nullptr_t c = {}; |
| 13 | return c; |
| 14 | #else |
| 15 | return nullptr; |
| 16 | #endif |
| 17 | } |
| 18 | |
| 19 | static_assert (b == nullptr, ""); |
| 20 | static_assert (foo () == nullptr, ""); |