[RISCV][FMV] Support target_clones (#85786)
[llvm-project.git] / clang / test / Analysis / ctor-trivial-copy.cpp
blob5ed188aa8f1eae346587f5741de1680f2b5cb080
1 // RUN: %clang_analyze_cc1 -analyzer-checker=core,debug.ExprInspection -analyzer-config c++-inlining=constructors -verify %s
4 template<typename T>
5 void clang_analyzer_dump(T&);
7 struct aggr {
8 int x;
9 int y;
12 struct empty {
15 void test_copy_return() {
16 aggr s1 = {1, 2};
17 aggr const& cr1 = aggr(s1);
18 clang_analyzer_dump(cr1); // expected-warning-re {{&lifetime_extended_object{aggr, cr1, S{{[0-9]+}}} }}
20 empty s2;
21 empty const& cr2 = empty{s2};
22 clang_analyzer_dump(cr2); // expected-warning-re {{&lifetime_extended_object{empty, cr2, S{{[0-9]+}}} }}
25 void test_assign_return() {
26 aggr s1 = {1, 2};
27 aggr d1;
28 clang_analyzer_dump(d1 = s1); // expected-warning {{&d1 }}
30 empty s2;
31 empty d2;
32 clang_analyzer_dump(d2 = s2); // expected-warning {{&d2 }} was Unknown