Mercurial > hg > CbC > CbC_gcc
view gcc/testsuite/g++.dg/cpp0x/constexpr-71537.C @ 158:494b0b89df80 default tip
...
author | Shinji KONO <kono@ie.u-ryukyu.ac.jp> |
---|---|
date | Mon, 25 May 2020 18:13:55 +0900 |
parents | 04ced10e8804 |
children |
line wrap: on
line source
// PR c++/71537 // { dg-do compile { target c++11 } } constexpr int n[42] = {1}; constexpr int x1 = n ? 1 : 0; constexpr int x2 = n + 1 ? 1 : 0; constexpr int x3 = "abc" ? 1 : 0; constexpr int x4 = "abc" + 1 ? 1 : 0; constexpr bool x5 = "abc" + 1; constexpr bool x6 = "abc" + 4; constexpr bool x7 = n + 42; static_assert (x1 == 1, ""); static_assert (x2 == 1, ""); static_assert (x3 == 1, ""); static_assert (x4 == 1, ""); static_assert (x5, ""); static_assert (x6, ""); static_assert (x7, "");