Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/llvm/llvm-project.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatheus Izvekov <mizvekov@gmail.com>2021-10-11 19:15:36 +0300
committerMatheus Izvekov <mizvekov@gmail.com>2022-07-13 03:10:09 +0300
commitbdc6974f92304f4ed542241b9b89ba58ba6b20aa (patch)
tree7ccdfc65560c740a1b6958c14ccd02c36f63fc5e /clang/test/CXX/class/class.init/class.copy.elision/p3.cpp
parentee88c0cf09969ba44307068797e12533b94768a6 (diff)
[clang] Implement ElaboratedType sugaring for types written bare
Without this patch, clang will not wrap in an ElaboratedType node types written without a keyword and nested name qualifier, which goes against the intent that we should produce an AST which retains enough details to recover how things are written. The lack of this sugar is incompatible with the intent of the type printer default policy, which is to print types as written, but to fall back and print them fully qualified when they are desugared. An ElaboratedTypeLoc without keyword / NNS uses no storage by itself, but still requires pointer alignment due to pre-existing bug in the TypeLoc buffer handling. Signed-off-by: Matheus Izvekov <mizvekov@gmail.com> Differential Revision: https://reviews.llvm.org/D112374
Diffstat (limited to 'clang/test/CXX/class/class.init/class.copy.elision/p3.cpp')
-rw-r--r--clang/test/CXX/class/class.init/class.copy.elision/p3.cpp24
1 files changed, 12 insertions, 12 deletions
diff --git a/clang/test/CXX/class/class.init/class.copy.elision/p3.cpp b/clang/test/CXX/class/class.init/class.copy.elision/p3.cpp
index 975557c5187b..e1a25c71c6ed 100644
--- a/clang/test/CXX/class/class.init/class.copy.elision/p3.cpp
+++ b/clang/test/CXX/class/class.init/class.copy.elision/p3.cpp
@@ -11,7 +11,7 @@ struct A1 {
};
A1 test1() {
A1 a;
- return a; // expected-error {{call to deleted constructor of 'test_delete_function::A1'}}
+ return a; // expected-error {{call to deleted constructor of 'A1'}}
}
struct A2 {
@@ -34,7 +34,7 @@ struct B1 {
};
B1 test3() {
C c;
- return c; // expected-error {{conversion function from 'test_delete_function::C' to 'test_delete_function::B1' invokes a deleted function}}
+ return c; // expected-error {{conversion function from 'C' to 'B1' invokes a deleted function}}
}
struct B2 {
@@ -75,7 +75,7 @@ struct B1 {
B1(B1 &&) = delete; // expected-note {{'B1' has been explicitly marked deleted here}}
};
B1 test3(B1 &&b) {
- return b; // expected-error {{call to deleted constructor of 'test_implicitly_movable_rvalue_ref::B1'}}
+ return b; // expected-error {{call to deleted constructor of 'B1'}}
}
struct B2 {
@@ -104,7 +104,7 @@ void test1() {
try {
func();
} catch (A1 a) {
- throw a; // expected-error {{call to deleted constructor of 'test_throw_parameter::A1'}}
+ throw a; // expected-error {{call to deleted constructor of 'A1'}}
}
}
@@ -125,21 +125,21 @@ void test2() {
void test3(A1 a) try {
func();
} catch (...) {
- throw a; // expected-error {{call to deleted constructor of 'test_throw_parameter::A1'}}
+ throw a; // expected-error {{call to deleted constructor of 'A1'}}
}
#if __cplusplus >= 201103L
namespace PR54341 {
void test4(A1 a) {
void f(decltype((throw a, 0)));
- // expected-error@-1 {{call to deleted constructor of 'test_throw_parameter::A1'}}
+ // expected-error@-1 {{call to deleted constructor of 'A1'}}
void g(int = decltype(throw a, 0){});
- // expected-error@-1 {{call to deleted constructor of 'test_throw_parameter::A1'}}
+ // expected-error@-1 {{call to deleted constructor of 'A1'}}
}
void test5(A1 a, int = decltype(throw a, 0){}) {}
-// expected-error@-1 {{call to deleted constructor of 'test_throw_parameter::A1'}}
+// expected-error@-1 {{call to deleted constructor of 'A1'}}
} // namespace PR54341
#endif
@@ -176,7 +176,7 @@ struct B1 {
};
C test3() {
B1 b;
- return b; // expected-error {{conversion function from 'test_non_ctor_conversion::B1' to 'test_non_ctor_conversion::C' invokes a deleted function}}
+ return b; // expected-error {{conversion function from 'B1' to 'C' invokes a deleted function}}
}
struct B2 {
@@ -274,20 +274,20 @@ NeedValue test_3_1() {
// not rvalue reference
// same type
B1 b;
- return b; // cxx11_2b-error {{call to deleted constructor of 'test_ctor_param_rvalue_ref::B1'}}
+ return b; // cxx11_2b-error {{call to deleted constructor of 'B1'}}
}
class DerivedB1 : public B1 {};
B1 test_3_2() {
// rvalue reference
// not same type
DerivedB1 b;
- return b; // expected-error {{call to deleted constructor of 'test_ctor_param_rvalue_ref::B1'}}
+ return b; // expected-error {{call to deleted constructor of 'B1'}}
}
NeedValue test_3_3() {
// not rvalue reference
// not same type
DerivedB1 b;
- return b; // cxx11_2b-error {{call to deleted constructor of 'test_ctor_param_rvalue_ref::B1'}}
+ return b; // cxx11_2b-error {{call to deleted constructor of 'B1'}}
}
struct B2 {