constant-expression-cxx1y.cpp | 419 constexpr const char *test_bounds(const char *p, int o) { function in namespace:compound_assign 422 static_assert(test_bounds("foo", 0)[0] == 'f', ""); 423 static_assert(test_bounds("foo", 3)[0] == 0, ""); 424 static_assert(test_bounds("foo", 4)[-3] == 'o', ""); 425 static_assert(test_bounds("foo" + 4, -4)[0] == 'f', ""); 426 static_assert(test_bounds("foo", 5) != 0, ""); // expected-error {{constant}} expected-note {{call}} 427 static_assert(test_bounds("foo", -1) != 0, ""); // expected-error {{constant}} expected-note {{call}} 428 static_assert(test_bounds("foo", 1000) != 0, ""); // expected-error {{constant}} expected-note {{call}}
|