[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git] / clang / test / SemaCXX / try-print-as-string-literal-type-check.cpp
blob6d1b29e785c31ef7229c9c813cb71f093fac1198
1 // RUN: %clang_cc1 %s -std=c++20 -fsyntax-only -verify
2 // expected-no-diagnostics
4 // Reported by: https://github.com/llvm/llvm-project/issues/57013
5 // The following code should not crash clang
6 struct X {
7 char arr[2];
8 constexpr X() {}
9 constexpr void modify() {
10 arr[0] = 0;
13 constexpr X f(X t) {
14 t.modify();
15 return t;
17 auto x = f(X());