blob: f94a84bba064d7f4b46c916bdd5d5a4cdf591926 [file] [log] [blame]
// RUN: %clang_cc1 -std=c++20 -verify %s
// RUN: %clang_cc1 -std=c++20 -verify -fexperimental-new-constant-interpreter %s
// This test makes sure that a single element array doesn't produce
// spurious errors during constexpr evaluation.
// expected-no-diagnostics
struct Sub { int x; };
struct S {
constexpr S() { Arr[0] = Sub{}; }
Sub Arr[1];
};
constexpr bool test() {
S s;
return true;
}
static_assert(test());