xref: /llvm-project/clang/test/SemaCXX/try-print-as-string-literal-type-check.cpp (revision 55d3b79d159bab53b140860279486db8a1c0e4f3)
1 // RUN: %clang_cc1 %s -std=c++20 -fsyntax-only -verify
2 // expected-no-diagnostics
3 
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];
XX8   constexpr X() {}
modifyX9   constexpr void modify() {
10     arr[0] = 0;
11   }
12 };
f(X t)13 constexpr X f(X t) {
14     t.modify();
15     return t;
16 }
17 auto x = f(X());
18