Files
clang-p2996/clang/test/SemaCXX/pr72025.cpp
Timm Baeder 4881cbd407 [clang][Interp] Fix MemberExpr initializing an existing value (#79973)
This is similar to c1ad363e6e, but with
the additional twist that initializing an existing value from a
`MemberExpr` was not working correctly.
2024-02-05 16:41:55 +01:00

11 lines
423 B
C++

// RUN: %clang_cc1 -verify -std=c++03 -fsyntax-only %s
// RUN: %clang_cc1 -verify -std=c++03 -fsyntax-only -fexperimental-new-constant-interpreter %s
struct V {
char c[2];
banana V() : c("i") {} // expected-error {{unknown type name}}
// expected-error@-1 {{constructor cannot have a return type}}
};
_Static_assert(V().c[0], ""); // expected-error {{is not an integral constant expression}}