[clang] 028d13b - [clang] Add ElaboratedType sugaring for types on implicit special members
Richard Smith via cfe-commits
cfe-commits at lists.llvm.org
Fri Jan 20 15:51:51 PST 2023
Author: Brad King
Date: 2023-01-20T15:51:32-08:00
New Revision: 028d13b15612385202ad79269f011e3f1ecf0a25
URL: https://github.com/llvm/llvm-project/commit/028d13b15612385202ad79269f011e3f1ecf0a25
DIFF: https://github.com/llvm/llvm-project/commit/028d13b15612385202ad79269f011e3f1ecf0a25.diff
LOG: [clang] Add ElaboratedType sugaring for types on implicit special members
Extend the change from commit 15f3cd6bfc67 ([clang] Implement
ElaboratedType sugaring for types written bare, 2021-10-11, D112374)
to cover types in the signatures of implicit copy-constructor,
copy-assignment, move-constructor, and move-assignment members in
C++ record types.
With this fix, diagnostic messages print types of special members
consistently whether they are explicitly or implicitly defined.
Fixes: https://github.com/llvm/llvm-project/issues/59557
Reviewed By: rsmith
Differential Revision: https://reviews.llvm.org/D141441
Added:
Modified:
clang/lib/Sema/SemaDeclCXX.cpp
clang/test/AST/ast-dump-decl.cpp
clang/test/AST/ast-dump-expr-json.cpp
clang/test/Analysis/auto-obj-dtors-cfg-output.cpp
clang/test/Analysis/lifetime-cfg-output.cpp
clang/test/Analysis/missing-bind-temporary.cpp
clang/test/Analysis/scopes-cfg-output.cpp
clang/test/CXX/basic/basic.lookup/basic.lookup.argdep/p4.cpp
clang/test/CXX/dcl.decl/dcl.meaning/dcl.fct/dcl.fct.def.default/p2.cpp
clang/test/Index/print-type.cpp
clang/test/Misc/diag-template-diffing.cpp
clang/test/SemaCXX/conversion-function.cpp
clang/test/SemaCXX/cxx11-call-to-deleted-constructor.cpp
clang/test/SemaCXX/deduced-return-type-cxx14.cpp
Removed:
################################################################################
diff --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp
index 749025c1258ff..348092fc62e8f 100644
--- a/clang/lib/Sema/SemaDeclCXX.cpp
+++ b/clang/lib/Sema/SemaDeclCXX.cpp
@@ -7526,6 +7526,7 @@ bool Sema::CheckExplicitlyDefaultedSpecialMember(CXXMethodDecl *MD,
ReturnType = Type->getReturnType();
QualType DeclType = Context.getTypeDeclType(RD);
+ DeclType = Context.getElaboratedType(ETK_None, nullptr, DeclType, nullptr);
DeclType = Context.getAddrSpaceQualType(DeclType, MD->getMethodQualifiers().getAddressSpace());
QualType ExpectedReturnType = Context.getLValueReferenceType(DeclType);
@@ -14441,6 +14442,7 @@ CXXMethodDecl *Sema::DeclareImplicitCopyAssignment(CXXRecordDecl *ClassDecl) {
return nullptr;
QualType ArgType = Context.getTypeDeclType(ClassDecl);
+ ArgType = Context.getElaboratedType(ETK_None, nullptr, ArgType, nullptr);
LangAS AS = getDefaultCXXMethodAddrSpace();
if (AS != LangAS::Default)
ArgType = Context.getAddrSpaceQualType(ArgType, AS);
@@ -14783,6 +14785,7 @@ CXXMethodDecl *Sema::DeclareImplicitMoveAssignment(CXXRecordDecl *ClassDecl) {
// constructor rules.
QualType ArgType = Context.getTypeDeclType(ClassDecl);
+ ArgType = Context.getElaboratedType(ETK_None, nullptr, ArgType, nullptr);
LangAS AS = getDefaultCXXMethodAddrSpace();
if (AS != LangAS::Default)
ArgType = Context.getAddrSpaceQualType(ArgType, AS);
@@ -15155,6 +15158,7 @@ CXXConstructorDecl *Sema::DeclareImplicitCopyConstructor(
QualType ClassType = Context.getTypeDeclType(ClassDecl);
QualType ArgType = ClassType;
+ ArgType = Context.getElaboratedType(ETK_None, nullptr, ArgType, nullptr);
bool Const = ClassDecl->implicitCopyConstructorHasConstParam();
if (Const)
ArgType = ArgType.withConst();
@@ -15299,6 +15303,7 @@ CXXConstructorDecl *Sema::DeclareImplicitMoveConstructor(
QualType ClassType = Context.getTypeDeclType(ClassDecl);
QualType ArgType = ClassType;
+ ArgType = Context.getElaboratedType(ETK_None, nullptr, ArgType, nullptr);
LangAS AS = getDefaultCXXMethodAddrSpace();
if (AS != LangAS::Default)
ArgType = Context.getAddrSpaceQualType(ClassType, AS);
diff --git a/clang/test/AST/ast-dump-decl.cpp b/clang/test/AST/ast-dump-decl.cpp
index e22ea60b26061..63148d54962f4 100644
--- a/clang/test/AST/ast-dump-decl.cpp
+++ b/clang/test/AST/ast-dump-decl.cpp
@@ -344,8 +344,8 @@ namespace testClassTemplateDecl {
// CHECK-NEXT: | |-CXXDestructorDecl 0x{{.+}} <line:[[@LINE-67]]:5, col:24> col:5 used ~TestClassTemplate 'void () noexcept'
// CHECK-NEXT: | |-CXXMethodDecl 0x{{.+}} <line:[[@LINE-67]]:5, col:11> col:9 j 'int ()'
// CHECK-NEXT: | |-FieldDecl 0x{{.+}} <line:[[@LINE-67]]:5, col:9> col:9 i 'int'
-// CHECK-NEXT: | `-CXXConstructorDecl 0x{{.+}} <line:[[@LINE-73]]:30> col:30 implicit constexpr TestClassTemplate 'void (const testClassTemplateDecl::TestClassTemplate<testClassTemplateDecl::A> &)' inline default trivial noexcept-unevaluated 0x{{.+}}
-// CHECK-NEXT: | `-ParmVarDecl 0x{{.+}} <col:30> col:30 'const testClassTemplateDecl::TestClassTemplate<testClassTemplateDecl::A> &'
+// CHECK-NEXT: | `-CXXConstructorDecl 0x{{.+}} <line:[[@LINE-73]]:30> col:30 implicit constexpr TestClassTemplate 'void (const TestClassTemplate<A> &)' inline default trivial noexcept-unevaluated 0x{{.+}}
+// CHECK-NEXT: | `-ParmVarDecl 0x{{.+}} <col:30> col:30 'const TestClassTemplate<A> &'
// CHECK-NEXT: |-ClassTemplateSpecialization 0x{{.+}} 'TestClassTemplate'
// CHECK-NEXT: |-ClassTemplateSpecialization 0x{{.+}} 'TestClassTemplate'
// CHECK-NEXT: `-ClassTemplateSpecialization 0x{{.+}} 'TestClassTemplate'
@@ -544,10 +544,10 @@ namespace testCanonicalTemplate {
// CHECK-NEXT: | `-ClassTemplateSpecialization 0x{{.+}} 'TestClassTemplate'
// CHECK-NEXT: |-CXXConstructorDecl 0x{{.+}} <line:[[@LINE-36]]:31> col:31 implicit used constexpr TestClassTemplate 'void () noexcept' inline default trivial
// CHECK-NEXT: | `-CompoundStmt 0x{{.+}} <col:31>
- // CHECK-NEXT: |-CXXConstructorDecl 0x{{.+}} <col:31> col:31 implicit constexpr TestClassTemplate 'void (const testCanonicalTemplate::TestClassTemplate<testCanonicalTemplate::A> &)' inline default trivial noexcept-unevaluated 0x{{.+}}
- // CHECK-NEXT: | `-ParmVarDecl 0x{{.+}} <col:31> col:31 'const testCanonicalTemplate::TestClassTemplate<testCanonicalTemplate::A> &'
- // CHECK-NEXT: `-CXXConstructorDecl 0x{{.+}} <col:31> col:31 implicit constexpr TestClassTemplate 'void (testCanonicalTemplate::TestClassTemplate<testCanonicalTemplate::A> &&)' inline default trivial noexcept-unevaluated 0x{{.+}}
- // CHECK-NEXT: `-ParmVarDecl 0x{{.+}} <col:31> col:31 'testCanonicalTemplate::TestClassTemplate<testCanonicalTemplate::A> &&'
+ // CHECK-NEXT: |-CXXConstructorDecl 0x{{.+}} <col:31> col:31 implicit constexpr TestClassTemplate 'void (const TestClassTemplate<A> &)' inline default trivial noexcept-unevaluated 0x{{.+}}
+ // CHECK-NEXT: | `-ParmVarDecl 0x{{.+}} <col:31> col:31 'const TestClassTemplate<A> &'
+ // CHECK-NEXT: `-CXXConstructorDecl 0x{{.+}} <col:31> col:31 implicit constexpr TestClassTemplate 'void (TestClassTemplate<A> &&)' inline default trivial noexcept-unevaluated 0x{{.+}}
+ // CHECK-NEXT: `-ParmVarDecl 0x{{.+}} <col:31> col:31 'TestClassTemplate<A> &&'
template<typename T1> class TestClassTemplate2;
@@ -572,10 +572,10 @@ namespace testCanonicalTemplate {
// CHECK-NEXT: |-CXXRecordDecl 0x{{.+}} <col:25, col:31> col:31 implicit class TestClassTemplate2
// CHECK-NEXT: |-CXXConstructorDecl 0x{{.+}} <col:31> col:31 implicit used constexpr TestClassTemplate2 'void () noexcept' inline default trivial
// CHECK-NEXT: | `-CompoundStmt 0x{{.+}} <col:31>
- // CHECK-NEXT: |-CXXConstructorDecl 0x{{.+}} <col:31> col:31 implicit constexpr TestClassTemplate2 'void (const testCanonicalTemplate::TestClassTemplate2<testCanonicalTemplate::A> &)' inline default trivial noexcept-unevaluated 0x{{.+}}
- // CHECK-NEXT: | `-ParmVarDecl 0x{{.+}} <col:31> col:31 'const testCanonicalTemplate::TestClassTemplate2<testCanonicalTemplate::A> &'
- // CHECK-NEXT: `-CXXConstructorDecl 0x{{.+}} <col:31> col:31 implicit constexpr TestClassTemplate2 'void (testCanonicalTemplate::TestClassTemplate2<testCanonicalTemplate::A> &&)' inline default trivial noexcept-unevaluated 0x{{.+}}
- // CHECK-NEXT: `-ParmVarDecl 0x{{.+}} <col:31> col:31 'testCanonicalTemplate::TestClassTemplate2<testCanonicalTemplate::A> &&'
+ // CHECK-NEXT: |-CXXConstructorDecl 0x{{.+}} <col:31> col:31 implicit constexpr TestClassTemplate2 'void (const TestClassTemplate2<A> &)' inline default trivial noexcept-unevaluated 0x{{.+}}
+ // CHECK-NEXT: | `-ParmVarDecl 0x{{.+}} <col:31> col:31 'const TestClassTemplate2<A> &'
+ // CHECK-NEXT: `-CXXConstructorDecl 0x{{.+}} <col:31> col:31 implicit constexpr TestClassTemplate2 'void (TestClassTemplate2<A> &&)' inline default trivial noexcept-unevaluated 0x{{.+}}
+ // CHECK-NEXT: `-ParmVarDecl 0x{{.+}} <col:31> col:31 'TestClassTemplate2<A> &&'
// CHECK: ClassTemplateDecl 0x{{.+}} prev 0x{{.+}} <{{.+}}:[[@LINE-26]]:3, col:31> col:31 TestClassTemplate2
// CHECK-NEXT: |-TemplateTypeParmDecl 0x{{.+}} <col:12, col:21> col:21 typename depth 0 index 0 T1
diff --git a/clang/test/AST/ast-dump-expr-json.cpp b/clang/test/AST/ast-dump-expr-json.cpp
index 62abd9aa42db4..f166698556acc 100644
--- a/clang/test/AST/ast-dump-expr-json.cpp
+++ b/clang/test/AST/ast-dump-expr-json.cpp
@@ -7986,7 +7986,7 @@ void TestNonADLCall3() {
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "ctorType": {
-// CHECK-NEXT: "qualType": "void (const NS::X &) noexcept"
+// CHECK-NEXT: "qualType": "void (const X &) noexcept"
// CHECK-NEXT: },
// CHECK-NEXT: "hadMultipleCandidates": true,
// CHECK-NEXT: "constructionKind": "complete",
@@ -8007,7 +8007,8 @@ void TestNonADLCall3() {
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "const NS::X"
+// CHECK-NEXT: "desugaredQualType": "const NS::X",
+// CHECK-NEXT: "qualType": "const X"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "lvalue",
// CHECK-NEXT: "castKind": "NoOp",
@@ -8142,7 +8143,7 @@ void TestNonADLCall3() {
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "ctorType": {
-// CHECK-NEXT: "qualType": "void (const NS::X &) noexcept"
+// CHECK-NEXT: "qualType": "void (const X &) noexcept"
// CHECK-NEXT: },
// CHECK-NEXT: "hadMultipleCandidates": true,
// CHECK-NEXT: "constructionKind": "complete",
@@ -8163,7 +8164,8 @@ void TestNonADLCall3() {
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "const NS::X"
+// CHECK-NEXT: "desugaredQualType": "const NS::X",
+// CHECK-NEXT: "qualType": "const X"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "lvalue",
// CHECK-NEXT: "castKind": "NoOp",
@@ -8424,7 +8426,7 @@ void TestNonADLCall3() {
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "ctorType": {
-// CHECK-NEXT: "qualType": "void (const NS::X &) noexcept"
+// CHECK-NEXT: "qualType": "void (const X &) noexcept"
// CHECK-NEXT: },
// CHECK-NEXT: "hadMultipleCandidates": true,
// CHECK-NEXT: "constructionKind": "complete",
@@ -8445,7 +8447,8 @@ void TestNonADLCall3() {
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "const NS::X"
+// CHECK-NEXT: "desugaredQualType": "const NS::X",
+// CHECK-NEXT: "qualType": "const X"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "lvalue",
// CHECK-NEXT: "castKind": "NoOp",
@@ -8752,7 +8755,7 @@ void TestNonADLCall3() {
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "ctorType": {
-// CHECK-NEXT: "qualType": "void (const NS::X &) noexcept"
+// CHECK-NEXT: "qualType": "void (const X &) noexcept"
// CHECK-NEXT: },
// CHECK-NEXT: "hadMultipleCandidates": true,
// CHECK-NEXT: "constructionKind": "complete",
@@ -8773,7 +8776,8 @@ void TestNonADLCall3() {
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "const NS::X"
+// CHECK-NEXT: "desugaredQualType": "const NS::X",
+// CHECK-NEXT: "qualType": "const X"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "lvalue",
// CHECK-NEXT: "castKind": "NoOp",
@@ -8908,7 +8912,7 @@ void TestNonADLCall3() {
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "ctorType": {
-// CHECK-NEXT: "qualType": "void (const NS::X &) noexcept"
+// CHECK-NEXT: "qualType": "void (const X &) noexcept"
// CHECK-NEXT: },
// CHECK-NEXT: "hadMultipleCandidates": true,
// CHECK-NEXT: "constructionKind": "complete",
@@ -8929,7 +8933,8 @@ void TestNonADLCall3() {
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "const NS::X"
+// CHECK-NEXT: "desugaredQualType": "const NS::X",
+// CHECK-NEXT: "qualType": "const X"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "lvalue",
// CHECK-NEXT: "castKind": "NoOp",
@@ -9190,7 +9195,7 @@ void TestNonADLCall3() {
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "prvalue",
// CHECK-NEXT: "ctorType": {
-// CHECK-NEXT: "qualType": "void (const NS::X &) noexcept"
+// CHECK-NEXT: "qualType": "void (const X &) noexcept"
// CHECK-NEXT: },
// CHECK-NEXT: "hadMultipleCandidates": true,
// CHECK-NEXT: "constructionKind": "complete",
@@ -9211,7 +9216,8 @@ void TestNonADLCall3() {
// CHECK-NEXT: }
// CHECK-NEXT: },
// CHECK-NEXT: "type": {
-// CHECK-NEXT: "qualType": "const NS::X"
+// CHECK-NEXT: "desugaredQualType": "const NS::X",
+// CHECK-NEXT: "qualType": "const X"
// CHECK-NEXT: },
// CHECK-NEXT: "valueCategory": "lvalue",
// CHECK-NEXT: "castKind": "NoOp",
diff --git a/clang/test/Analysis/auto-obj-dtors-cfg-output.cpp b/clang/test/Analysis/auto-obj-dtors-cfg-output.cpp
index 02ab461459f0f..7fa7bcd167de2 100644
--- a/clang/test/Analysis/auto-obj-dtors-cfg-output.cpp
+++ b/clang/test/Analysis/auto-obj-dtors-cfg-output.cpp
@@ -539,7 +539,7 @@ void test_goto() {
// ANALYZER-NEXT: 1: (CXXConstructExpr, [B4.2], A)
// CHECK-NEXT: 2: A a;
// CHECK-NEXT: 3: a
-// CHECK-NEXT: 4: [B4.3] (ImplicitCastExpr, NoOp, const class A)
+// CHECK-NEXT: 4: [B4.3] (ImplicitCastExpr, NoOp, const A)
// WARNINGS-NEXT: 5: [B4.4] (CXXConstructExpr, A)
// ANALYZER-NEXT: 5: [B4.4] (CXXConstructExpr, [B4.6], A)
// CHECK-NEXT: 6: A b = a;
@@ -625,7 +625,7 @@ void test_if_implicit_scope() {
// ANALYZER-NEXT: 1: (CXXConstructExpr, [B8.2], A)
// CHECK-NEXT: 2: A a;
// CHECK-NEXT: 3: a
-// CHECK-NEXT: 4: [B8.3] (ImplicitCastExpr, NoOp, const class A)
+// CHECK-NEXT: 4: [B8.3] (ImplicitCastExpr, NoOp, const A)
// WARNINGS-NEXT: 5: [B8.4] (CXXConstructExpr, A)
// ANALYZER-NEXT: 5: [B8.4] (CXXConstructExpr, [B8.6], A)
// CHECK-NEXT: 6: A b = a;
@@ -674,7 +674,7 @@ void test_if_jumps() {
// CHECK-NEXT: Succs (1): B2
// CHECK: [B4]
// CHECK-NEXT: 1: a
-// CHECK-NEXT: 2: [B4.1] (ImplicitCastExpr, NoOp, const class A)
+// CHECK-NEXT: 2: [B4.1] (ImplicitCastExpr, NoOp, const A)
// WARNINGS-NEXT: 3: [B4.2] (CXXConstructExpr, A)
// ANALYZER-NEXT: 3: [B4.2] (CXXConstructExpr, [B4.4], A)
// CHECK-NEXT: 4: A b = a;
@@ -765,7 +765,7 @@ void test_while_implicit_scope() {
// CHECK-NEXT: Succs (2): B8 B7
// CHECK: [B10]
// CHECK-NEXT: 1: a
-// CHECK-NEXT: 2: [B10.1] (ImplicitCastExpr, NoOp, const class A)
+// CHECK-NEXT: 2: [B10.1] (ImplicitCastExpr, NoOp, const A)
// WARNINGS-NEXT: 3: [B10.2] (CXXConstructExpr, A)
// ANALYZER-NEXT: 3: [B10.2] (CXXConstructExpr, [B10.4], A)
// CHECK-NEXT: 4: A b = a;
@@ -919,7 +919,7 @@ void test_do_jumps() {
// ANALYZER-NEXT: 1: (CXXConstructExpr, [B2.2], A)
// CHECK-NEXT: 2: A a;
// CHECK-NEXT: 3: a
-// CHECK-NEXT: 4: [B2.3] (ImplicitCastExpr, NoOp, const class A)
+// CHECK-NEXT: 4: [B2.3] (ImplicitCastExpr, NoOp, const A)
// CHECK-NEXT: 5: [B2.4] (CXXConstructExpr, A)
// CHECK-NEXT: 6: A b = a;
// CHECK-NEXT: 7: b
@@ -960,7 +960,7 @@ void test_switch_implicit_scope() {
// ANALYZER-NEXT: 1: (CXXConstructExpr, [B2.2], A)
// CHECK-NEXT: 2: A a;
// CHECK-NEXT: 3: a
-// CHECK-NEXT: 4: [B2.3] (ImplicitCastExpr, NoOp, const class A)
+// CHECK-NEXT: 4: [B2.3] (ImplicitCastExpr, NoOp, const A)
// CHECK-NEXT: 5: [B2.4] (CXXConstructExpr, A)
// CHECK-NEXT: 6: A b = a;
// CHECK-NEXT: 7: b
@@ -1049,7 +1049,7 @@ void test_switch_jumps() {
// CHECK-NEXT: Succs (1): B2
// CHECK: [B4]
// CHECK-NEXT: 1: a
-// CHECK-NEXT: 2: [B4.1] (ImplicitCastExpr, NoOp, const class A)
+// CHECK-NEXT: 2: [B4.1] (ImplicitCastExpr, NoOp, const A)
// WARNINGS-NEXT: 3: [B4.2] (CXXConstructExpr, A)
// ANALYZER-NEXT: 3: [B4.2] (CXXConstructExpr, [B4.4], A)
// CHECK-NEXT: 4: A b = a;
@@ -1193,7 +1193,7 @@ void test_for_range_implicit_scope() {
// CHECK-NEXT: Succs (2): B8 B7
// CHECK: [B10]
// CHECK-NEXT: 1: b
-// CHECK-NEXT: 2: [B10.1] (ImplicitCastExpr, NoOp, const class A)
+// CHECK-NEXT: 2: [B10.1] (ImplicitCastExpr, NoOp, const A)
// WARNINGS-NEXT: 3: [B10.2] (CXXConstructExpr, A)
// ANALYZER-NEXT: 3: [B10.2] (CXXConstructExpr, [B10.4], A)
// CHECK-NEXT: 4: A c = b;
diff --git a/clang/test/Analysis/lifetime-cfg-output.cpp b/clang/test/Analysis/lifetime-cfg-output.cpp
index f8e93c603745c..7af785638e9d5 100644
--- a/clang/test/Analysis/lifetime-cfg-output.cpp
+++ b/clang/test/Analysis/lifetime-cfg-output.cpp
@@ -189,7 +189,7 @@ void test_return() {
// CHECK-NEXT: 1: (CXXConstructExpr, A)
// CHECK-NEXT: 2: A a;
// CHECK-NEXT: 3: a
-// CHECK-NEXT: 4: [B4.3] (ImplicitCastExpr, NoOp, const class A)
+// CHECK-NEXT: 4: [B4.3] (ImplicitCastExpr, NoOp, const A)
// CHECK-NEXT: 5: [B4.4] (CXXConstructExpr, A)
// CHECK-NEXT: 6: A b = a;
// CHECK-NEXT: 7: b
@@ -269,7 +269,7 @@ void test_if_implicit_scope() {
// CHECK-NEXT: 1: (CXXConstructExpr, A)
// CHECK-NEXT: 2: A a;
// CHECK-NEXT: 3: a
-// CHECK-NEXT: 4: [B8.3] (ImplicitCastExpr, NoOp, const class A)
+// CHECK-NEXT: 4: [B8.3] (ImplicitCastExpr, NoOp, const A)
// CHECK-NEXT: 5: [B8.4] (CXXConstructExpr, A)
// CHECK-NEXT: 6: A b = a;
// CHECK-NEXT: 7: b
@@ -318,7 +318,7 @@ void test_if_jumps() {
// CHECK-NEXT: Succs (1): B2
// CHECK: [B4]
// CHECK-NEXT: 1: a
-// CHECK-NEXT: 2: [B4.1] (ImplicitCastExpr, NoOp, const class A)
+// CHECK-NEXT: 2: [B4.1] (ImplicitCastExpr, NoOp, const A)
// CHECK-NEXT: 3: [B4.2] (CXXConstructExpr, A)
// CHECK-NEXT: 4: A b = a;
// CHECK-NEXT: 5: b
@@ -404,7 +404,7 @@ void test_while_implicit_scope() {
// CHECK-NEXT: Succs (2): B8 B7
// CHECK: [B10]
// CHECK-NEXT: 1: a
-// CHECK-NEXT: 2: [B10.1] (ImplicitCastExpr, NoOp, const class A)
+// CHECK-NEXT: 2: [B10.1] (ImplicitCastExpr, NoOp, const A)
// CHECK-NEXT: 3: [B10.2] (CXXConstructExpr, A)
// CHECK-NEXT: 4: A b = a;
// CHECK-NEXT: 5: b
@@ -540,7 +540,7 @@ void test_do_jumps() {
// CHECK-NEXT: Succs (1): B2
// CHECK: [B4]
// CHECK-NEXT: 1: a
-// CHECK-NEXT: 2: [B4.1] (ImplicitCastExpr, NoOp, const class A)
+// CHECK-NEXT: 2: [B4.1] (ImplicitCastExpr, NoOp, const A)
// CHECK-NEXT: 3: [B4.2] (CXXConstructExpr, A)
// CHECK-NEXT: 4: A b = a;
// CHECK-NEXT: 5: b
@@ -626,7 +626,7 @@ void test_for_implicit_scope() {
// CHECK-NEXT: Succs (2): B8 B7
// CHECK: [B10]
// CHECK-NEXT: 1: b
-// CHECK-NEXT: 2: [B10.1] (ImplicitCastExpr, NoOp, const class A)
+// CHECK-NEXT: 2: [B10.1] (ImplicitCastExpr, NoOp, const A)
// CHECK-NEXT: 3: [B10.2] (CXXConstructExpr, A)
// CHECK-NEXT: 4: A c = b;
// CHECK-NEXT: 5: c
diff --git a/clang/test/Analysis/missing-bind-temporary.cpp b/clang/test/Analysis/missing-bind-temporary.cpp
index 2781c46eabace..f79677e3cdae2 100644
--- a/clang/test/Analysis/missing-bind-temporary.cpp
+++ b/clang/test/Analysis/missing-bind-temporary.cpp
@@ -24,13 +24,13 @@ class B {
// CHECK-NEXT: 1: (CXXConstructExpr, [B1.2], B)
// CHECK-NEXT: 2: B i;
// CHECK-NEXT: 3: operator=
-// CHECK-NEXT: 4: [B1.3] (ImplicitCastExpr, FunctionToPointerDecay, class variant_0::B &(*)(class variant_0::B &&) noexcept)
+// CHECK-NEXT: 4: [B1.3] (ImplicitCastExpr, FunctionToPointerDecay, B &(*)(B &&) noexcept)
// CHECK-NEXT: 5: i
-// CHECK-NEXT: 6: {} (CXXConstructExpr, [B1.7], [B1.8], class variant_0::B)
+// CHECK-NEXT: 6: {} (CXXConstructExpr, [B1.7], [B1.8], B)
// CHECK-NEXT: 7: [B1.6] (BindTemporary)
// CHECK-NEXT: 8: [B1.7]
// CHECK-NEXT: 9: [B1.5] = [B1.8] (OperatorCall)
-// CHECK-NEXT: 10: ~variant_0::B() (Temporary object destructor)
+// CHECK-NEXT: 10: ~B() (Temporary object destructor)
// CHECK-NEXT: 11: [B1.2].~B() (Implicit destructor)
void foo(int) {
B i;
@@ -66,9 +66,9 @@ class B {
// CHECK-NEXT: 1: (CXXConstructExpr, [B1.2], B)
// CHECK-NEXT: 2: B i;
// CHECK-NEXT: 3: operator=
-// CHECK-NEXT: 4: [B1.3] (ImplicitCastExpr, FunctionToPointerDecay, class variant_1::B &(*)(class variant_1::B &&) noexcept)
+// CHECK-NEXT: 4: [B1.3] (ImplicitCastExpr, FunctionToPointerDecay, B &(*)(B &&) noexcept)
// CHECK-NEXT: 5: i
-// CHECK-NEXT: 6: {} (CXXConstructExpr, class variant_1::B)
+// CHECK-NEXT: 6: {} (CXXConstructExpr, B)
// CHECK-NEXT: 7: [B1.6]
// CHECK-NEXT: 8: [B1.5] = [B1.7] (OperatorCall)
// CHECK-NEXT: 9: [B1.2].~B() (Implicit destructor)
@@ -106,14 +106,14 @@ class B {
// CHECK-NEXT: 1: (CXXConstructExpr, [B1.2], B)
// CHECK-NEXT: 2: B i;
// CHECK-NEXT: 3: operator=
-// CHECK-NEXT: 4: [B1.3] (ImplicitCastExpr, FunctionToPointerDecay, class variant_2::B &(*)(class variant_2::B &&) noexcept)
+// CHECK-NEXT: 4: [B1.3] (ImplicitCastExpr, FunctionToPointerDecay, B &(*)(B &&) noexcept)
// CHECK-NEXT: 5: i
// CHECK-NEXT: 6: {}
// CHECK-NEXT: 7: {}
// CHECK-NEXT: 8: [B1.7] (BindTemporary)
// CHECK-NEXT: 9: [B1.8]
// CHECK-NEXT: 10: [B1.5] = [B1.9] (OperatorCall)
-// CHECK-NEXT: 11: ~variant_2::B() (Temporary object destructor)
+// CHECK-NEXT: 11: ~B() (Temporary object destructor)
// CHECK-NEXT: 12: [B1.2].~B() (Implicit destructor)
template <typename T> void foo(T) {
B i;
diff --git a/clang/test/Analysis/scopes-cfg-output.cpp b/clang/test/Analysis/scopes-cfg-output.cpp
index 61025c4fff941..505fa5e55ef0f 100644
--- a/clang/test/Analysis/scopes-cfg-output.cpp
+++ b/clang/test/Analysis/scopes-cfg-output.cpp
@@ -149,7 +149,7 @@ void test_return() {
// CHECK-NEXT: 3: A a;
// CHECK-NEXT: 4: CFGScopeBegin(b)
// CHECK-NEXT: 5: a
-// CHECK-NEXT: 6: [B4.5] (ImplicitCastExpr, NoOp, const class A)
+// CHECK-NEXT: 6: [B4.5] (ImplicitCastExpr, NoOp, const A)
// CHECK-NEXT: 7: [B4.6] (CXXConstructExpr, [B4.8], A)
// CHECK-NEXT: 8: A b = a;
// CHECK-NEXT: 9: b
@@ -242,7 +242,7 @@ void test_if_implicit_scope() {
// CHECK-NEXT: 3: A a;
// CHECK-NEXT: 4: CFGScopeBegin(b)
// CHECK-NEXT: 5: a
-// CHECK-NEXT: 6: [B8.5] (ImplicitCastExpr, NoOp, const class A)
+// CHECK-NEXT: 6: [B8.5] (ImplicitCastExpr, NoOp, const A)
// CHECK-NEXT: 7: [B8.6] (CXXConstructExpr, [B8.8], A)
// CHECK-NEXT: 8: A b = a;
// CHECK-NEXT: 9: b
@@ -295,7 +295,7 @@ void test_if_jumps() {
// CHECK: [B4]
// CHECK-NEXT: 1: CFGScopeBegin(b)
// CHECK-NEXT: 2: a
-// CHECK-NEXT: 3: [B4.2] (ImplicitCastExpr, NoOp, const class A)
+// CHECK-NEXT: 3: [B4.2] (ImplicitCastExpr, NoOp, const A)
// CHECK-NEXT: 4: [B4.3] (CXXConstructExpr, [B4.5], A)
// CHECK-NEXT: 5: A b = a;
// CHECK-NEXT: 6: b
@@ -394,7 +394,7 @@ void test_while_implicit_scope() {
// CHECK: [B10]
// CHECK-NEXT: 1: CFGScopeBegin(b)
// CHECK-NEXT: 2: a
-// CHECK-NEXT: 3: [B10.2] (ImplicitCastExpr, NoOp, const class A)
+// CHECK-NEXT: 3: [B10.2] (ImplicitCastExpr, NoOp, const A)
// CHECK-NEXT: 4: [B10.3] (CXXConstructExpr, [B10.5], A)
// CHECK-NEXT: 5: A b = a;
// CHECK-NEXT: 6: b
@@ -539,7 +539,7 @@ void test_do_jumps() {
// CHECK: [B4]
// CHECK-NEXT: 1: CFGScopeBegin(b)
// CHECK-NEXT: 2: a
-// CHECK-NEXT: 3: [B4.2] (ImplicitCastExpr, NoOp, const class A)
+// CHECK-NEXT: 3: [B4.2] (ImplicitCastExpr, NoOp, const A)
// CHECK-NEXT: 4: [B4.3] (CXXConstructExpr, [B4.5], A)
// CHECK-NEXT: 5: A b = a;
// CHECK-NEXT: 6: b
@@ -639,7 +639,7 @@ void test_for_implicit_scope() {
// CHECK: [B10]
// CHECK-NEXT: 1: CFGScopeBegin(c)
// CHECK-NEXT: 2: b
-// CHECK-NEXT: 3: [B10.2] (ImplicitCastExpr, NoOp, const class A)
+// CHECK-NEXT: 3: [B10.2] (ImplicitCastExpr, NoOp, const A)
// CHECK-NEXT: 4: [B10.3] (CXXConstructExpr, [B10.5], A)
// CHECK-NEXT: 5: A c = b;
// CHECK-NEXT: 6: c
@@ -836,10 +836,10 @@ void test_for_compound_and_break() {
// CHECK-NEXT: 4: *[B4.3]
// CHECK-NEXT: 5: auto &i
// CHECK-NEXT: 6: operator=
-// CHECK-NEXT: 7: [B4.6] (ImplicitCastExpr, FunctionToPointerDecay, class A &(*)(const class A &)
+// CHECK-NEXT: 7: [B4.6] (ImplicitCastExpr, FunctionToPointerDecay, A &(*)(const A &)
// CHECK-NEXT: 8: i
// CHECK-NEXT: 9: b
-// CHECK-NEXT: 10: [B4.9] (ImplicitCastExpr, NoOp, const class A)
+// CHECK-NEXT: 10: [B4.9] (ImplicitCastExpr, NoOp, const A)
// CHECK-NEXT: 11: [B4.8] = [B4.10] (OperatorCall)
// CHECK-NEXT: 12: CFGScopeEnd(i)
// CHECK-NEXT: Preds (1): B2
diff --git a/clang/test/CXX/basic/basic.lookup/basic.lookup.argdep/p4.cpp b/clang/test/CXX/basic/basic.lookup/basic.lookup.argdep/p4.cpp
index 95810113cf100..c942c0327bd8b 100644
--- a/clang/test/CXX/basic/basic.lookup/basic.lookup.argdep/p4.cpp
+++ b/clang/test/CXX/basic/basic.lookup/basic.lookup.argdep/p4.cpp
@@ -21,9 +21,9 @@ namespace D {
}
namespace C {
- class C {}; // expected-note {{candidate constructor (the implicit copy constructor) not viable: no known conversion from 'B::B' to 'const C::C &' for 1st argument}}
+ class C {}; // expected-note {{candidate constructor (the implicit copy constructor) not viable: no known conversion from 'B::B' to 'const C &' for 1st argument}}
#if __cplusplus >= 201103L // C++11 or later
- // expected-note at -2 {{candidate constructor (the implicit move constructor) not viable: no known conversion from 'B::B' to 'C::C &&' for 1st argument}}
+ // expected-note at -2 {{candidate constructor (the implicit move constructor) not viable: no known conversion from 'B::B' to 'C &&' for 1st argument}}
#endif
void func(C); // expected-note {{'C::func' declared here}} \
// expected-note {{passing argument to parameter here}}
diff --git a/clang/test/CXX/dcl.decl/dcl.meaning/dcl.fct/dcl.fct.def.default/p2.cpp b/clang/test/CXX/dcl.decl/dcl.meaning/dcl.fct/dcl.fct.def.default/p2.cpp
index 4227d82e7753e..fc11ec3f94031 100644
--- a/clang/test/CXX/dcl.decl/dcl.meaning/dcl.fct/dcl.fct.def.default/p2.cpp
+++ b/clang/test/CXX/dcl.decl/dcl.meaning/dcl.fct/dcl.fct.def.default/p2.cpp
@@ -14,11 +14,11 @@ namespace move {
};
struct AssignmentRet1 {
- AssignmentRet1&& operator=(AssignmentRet1&&) = default; // expected-error {{explicitly-defaulted move assignment operator must return 'move::AssignmentRet1 &'}}
+ AssignmentRet1&& operator=(AssignmentRet1&&) = default; // expected-error {{explicitly-defaulted move assignment operator must return 'AssignmentRet1 &'}}
};
struct AssignmentRet2 {
- const AssignmentRet2& operator=(AssignmentRet2&&) = default; // expected-error {{explicitly-defaulted move assignment operator must return 'move::AssignmentRet2 &'}}
+ const AssignmentRet2& operator=(AssignmentRet2&&) = default; // expected-error {{explicitly-defaulted move assignment operator must return 'AssignmentRet2 &'}}
};
struct ConstAssignment {
@@ -62,11 +62,11 @@ namespace copy {
};
struct AssignmentRet1 {
- AssignmentRet1&& operator=(const AssignmentRet1&) = default; // expected-error {{explicitly-defaulted copy assignment operator must return 'copy::AssignmentRet1 &'}}
+ AssignmentRet1&& operator=(const AssignmentRet1&) = default; // expected-error {{explicitly-defaulted copy assignment operator must return 'AssignmentRet1 &'}}
};
struct AssignmentRet2 {
- const AssignmentRet2& operator=(const AssignmentRet2&) = default; // expected-error {{explicitly-defaulted copy assignment operator must return 'copy::AssignmentRet2 &'}}
+ const AssignmentRet2& operator=(const AssignmentRet2&) = default; // expected-error {{explicitly-defaulted copy assignment operator must return 'AssignmentRet2 &'}}
};
struct ConstAssignment {
diff --git a/clang/test/Index/print-type.cpp b/clang/test/Index/print-type.cpp
index ed298a7810ae2..db8559521e29d 100644
--- a/clang/test/Index/print-type.cpp
+++ b/clang/test/Index/print-type.cpp
@@ -196,7 +196,7 @@ inline namespace InlineNS {}
// CHECK: TemplateRef=Specialization:66:8 [type=] [typekind=Invalid] [isPOD=0]
// CHECK: CallExpr=Specialization:66:8 [type=Specialization<Specialization<bool> &>] [typekind=Elaborated] [templateargs/1= [type=Specialization<bool> &] [typekind=LValueReference]] [canonicaltype=Specialization<Specialization<bool> &>] [canonicaltypekind=Record] [canonicaltemplateargs/1= [type=Specialization<bool> &] [typekind=LValueReference]] [isPOD=1]
// CHECK: VarDecl=autoTemplRefParam:72:6 (Definition) [type=Specialization<Specialization<bool> &>] [typekind=Auto] [templateargs/1= [type=Specialization<bool> &] [typekind=LValueReference]] [canonicaltype=Specialization<Specialization<bool> &>] [canonicaltypekind=Record] [canonicaltemplateargs/1= [type=Specialization<bool> &] [typekind=LValueReference]] [isPOD=1]
-// CHECK: UnexposedExpr=templRefParam:71:40 [type=const Specialization<Specialization<bool> &>] [typekind=Record] const [templateargs/1= [type=Specialization<bool> &] [typekind=LValueReference]] [isPOD=1]
+// CHECK: UnexposedExpr=templRefParam:71:40 [type=const Specialization<Specialization<bool> &>] [typekind=Elaborated] const [templateargs/1= [type=Specialization<bool> &] [typekind=LValueReference]] [canonicaltype=const Specialization<Specialization<bool> &>] [canonicaltypekind=Record] [canonicaltemplateargs/1= [type=Specialization<bool> &] [typekind=LValueReference]] [isPOD=1] [isAnonRecDecl=0]
// CHECK: DeclRefExpr=templRefParam:71:40 [type=Specialization<Specialization<bool> &>] [typekind=Elaborated] [templateargs/1= [type=Specialization<bool> &] [typekind=LValueReference]] [canonicaltype=Specialization<Specialization<bool> &>] [canonicaltypekind=Record] [canonicaltemplateargs/1= [type=Specialization<bool> &] [typekind=LValueReference]] [isPOD=1]
// CHECK: TypeAliasDecl=baz:76:7 (Definition) [type=baz] [typekind=Typedef] [templateargs/1= [type=A<void>] [typekind=Elaborated]] [canonicaltype=A<void>] [canonicaltypekind=Record] [canonicaltemplateargs/1= [type=void] [typekind=Void]] [isPOD=0]
// CHECK: VarDecl=autoTemplPointer:78:6 (Definition) [type=Specialization<Specialization<bool> &> *] [typekind=Auto] [canonicaltype=Specialization<Specialization<bool> &> *] [canonicaltypekind=Pointer] [isPOD=1] [pointeetype=Specialization<Specialization<bool> &>] [pointeekind=Auto]
diff --git a/clang/test/Misc/diag-template-
diff ing.cpp b/clang/test/Misc/diag-template-
diff ing.cpp
index 641e700a260c8..eefeb0b1117c7 100644
--- a/clang/test/Misc/diag-template-
diff ing.cpp
+++ b/clang/test/Misc/diag-template-
diff ing.cpp
@@ -850,7 +850,7 @@ namespace rdar12931988 {
void foo(A::X<int> &ax, B::X<int> bx) {
// CHECK-ELIDE-NOTREE: no viable overloaded '='
- // CHECK-ELIDE-NOTREE: no known conversion from 'B::X<int>' to 'const rdar12931988::A::X<int>'
+ // CHECK-ELIDE-NOTREE: no known conversion from 'B::X<int>' to 'const X<int>'
ax = bx;
}
diff --git a/clang/test/SemaCXX/conversion-function.cpp b/clang/test/SemaCXX/conversion-function.cpp
index 01b82e1540db4..e5f7577d1489b 100644
--- a/clang/test/SemaCXX/conversion-function.cpp
+++ b/clang/test/SemaCXX/conversion-function.cpp
@@ -452,9 +452,9 @@ namespace PR18234 {
struct A {
operator enum E { e } (); // expected-error {{'PR18234::A::E' cannot be defined in a type specifier}}
operator struct S { int n; } (); // expected-error {{'PR18234::A::S' cannot be defined in a type specifier}}
- // expected-note at -1 {{candidate constructor (the implicit copy constructor) not viable: no known conversion from 'struct A' to 'const PR18234::A::S &' for 1st argument}}
+ // expected-note at -1 {{candidate constructor (the implicit copy constructor) not viable: no known conversion from 'struct A' to 'const S &' for 1st argument}}
#if __cplusplus >= 201103L
- // expected-note at -3 {{candidate constructor (the implicit move constructor) not viable: no known conversion from 'struct A' to 'PR18234::A::S &&' for 1st argument}}
+ // expected-note at -3 {{candidate constructor (the implicit move constructor) not viable: no known conversion from 'struct A' to 'S &&' for 1st argument}}
#endif
} a;
A::S s = a; // expected-error {{no viable conversion from 'struct A' to 'A::S'}}
diff --git a/clang/test/SemaCXX/cxx11-call-to-deleted-constructor.cpp b/clang/test/SemaCXX/cxx11-call-to-deleted-constructor.cpp
index aa6a805318209..6e9572169ce18 100644
--- a/clang/test/SemaCXX/cxx11-call-to-deleted-constructor.cpp
+++ b/clang/test/SemaCXX/cxx11-call-to-deleted-constructor.cpp
@@ -34,7 +34,7 @@ void getLaplacianClosedForm()
{
Matrix<double> winI(0, 3);
RGBFValue* inputPreL;
- winI = { inputPreL->at() }; // expected-error {{call to deleted constructor of 'cva::Matrix<double> &&'}}
+ winI = { inputPreL->at() }; // expected-error {{call to deleted constructor of 'Matrix<double> &&'}}
}
}
diff --git a/clang/test/SemaCXX/deduced-return-type-cxx14.cpp b/clang/test/SemaCXX/deduced-return-type-cxx14.cpp
index da2f5f54b2476..41acb44315b63 100644
--- a/clang/test/SemaCXX/deduced-return-type-cxx14.cpp
+++ b/clang/test/SemaCXX/deduced-return-type-cxx14.cpp
@@ -283,7 +283,7 @@ namespace OverloadResolutionTemplate {
namespace DefaultedMethods {
struct A {
- auto operator=(const A&) = default; // expected-error {{must return 'DefaultedMethods::A &'}}
+ auto operator=(const A&) = default; // expected-error {{must return 'A &'}}
A &operator=(A&&); // expected-note {{previous}}
};
auto A::operator=(A&&) = default; // expected-error {{return type of out-of-line definition of 'DefaultedMethods::A::operator='
diff ers from that in the declaration}}
More information about the cfe-commits
mailing list