[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / SemaCXX / pr72025.cpp
blobac55f27728a36960b19693733f9f342edfb082e0
1 // RUN: %clang_cc1 -verify -std=c++03 -fsyntax-only %s
2 // RUN: %clang_cc1 -verify -std=c++03 -fsyntax-only -fexperimental-new-constant-interpreter %s
3 struct V {
4 char c[2];
5 banana V() : c("i") {} // expected-error {{unknown type name}}
6 // expected-error@-1 {{constructor cannot have a return type}}
7 };
9 _Static_assert(V().c[0], ""); // expected-error {{is not an integral constant expression}}