view gcc/testsuite/g++.dg/cpp0x/constexpr-71537.C @ 111:04ced10e8804

gcc 7
author kono
date Fri, 27 Oct 2017 22:46:09 +0900
parents
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, "");