repo.or.cz
/
llvm-project.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
[clang] Implement lifetime analysis for lifetime_capture_by(X) (#115921)
[llvm-project.git]
/
clang
/
test
/
SemaCXX
/
try-print-as-string-literal-type-check.cpp
blob
6d1b29e785c31ef7229c9c813cb71f093fac1198
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
];
8
constexpr
X
() {}
9
constexpr
void
modify
() {
10
arr
[
0
] =
0
;
11
}
12
};
13
constexpr
X
f
(
X t
) {
14
t
.
modify
();
15
return
t
;
16
}
17
auto
x
=
f
(
X
());