From 76775c8f82c0b457e1342513dbd857c15fcae5b1 Mon Sep 17 00:00:00 2001 From: Nico Weber Date: Wed, 16 Oct 2019 10:23:53 +0000 Subject: [PATCH] Revert 374967 "[Concepts] ConceptSpecializationExprs mangling" This reverts commit 5e34ad109ced8dbdea9500ee28180315b2aeba3d. The mangling test fails on Windows: http://lab.llvm.org:8011/builders/clang-x64-ninja-win7/builds/15944 It also fails on ppc64le: http://lab.llvm.org:8011/builders/clang-ppc64le-linux-lnt/builds/21092 Also revert follow-up 374971 "Fix failing mangle-concept.cpp test." (it did not help on Win/ppc64le). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@374985 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/AST/ItaniumMangle.cpp | 17 +++-------------- lib/Sema/SemaTemplate.cpp | 2 +- test/CodeGenCXX/mangle-concept.cpp | 16 ---------------- 3 files changed, 4 insertions(+), 31 deletions(-) delete mode 100644 test/CodeGenCXX/mangle-concept.cpp diff --git a/lib/AST/ItaniumMangle.cpp b/lib/AST/ItaniumMangle.cpp index 534a92d2cb..8e3ad4c266 100644 --- a/lib/AST/ItaniumMangle.cpp +++ b/lib/AST/ItaniumMangle.cpp @@ -969,7 +969,7 @@ void CXXNameMangler::mangleUnscopedTemplateName( assert(!AdditionalAbiTags && "template template param cannot have abi tags"); mangleTemplateParameter(TTP->getDepth(), TTP->getIndex()); - } else if (isa(ND) || isa(ND)) { + } else if (isa(ND)) { mangleUnscopedName(ND, AdditionalAbiTags); } else { mangleUnscopedName(ND->getTemplatedDecl(), AdditionalAbiTags); @@ -1890,7 +1890,7 @@ void CXXNameMangler::mangleTemplatePrefix(const TemplateDecl *ND, mangleTemplateParameter(TTP->getDepth(), TTP->getIndex()); } else { manglePrefix(getEffectiveDeclContext(ND), NoFunction); - if (isa(ND) || isa(ND)) + if (isa(ND)) mangleUnqualifiedName(ND, nullptr); else mangleUnqualifiedName(ND->getTemplatedDecl(), nullptr); @@ -3658,6 +3658,7 @@ recurse: case Expr::ConvertVectorExprClass: case Expr::StmtExprClass: case Expr::TypeTraitExprClass: + case Expr::ConceptSpecializationExprClass: case Expr::ArrayTypeTraitExprClass: case Expr::ExpressionTraitExprClass: case Expr::VAArgExprClass: @@ -4167,18 +4168,6 @@ recurse: mangleExpression(cast(E)->getSubExpr(), Arity); break; - - case Expr::ConceptSpecializationExprClass: { - // ::= L E # external name - Out << "L_Z"; - auto *CSE = cast(E); - mangleTemplateName(CSE->getNamedConcept(), - CSE->getTemplateArguments().data(), - CSE->getTemplateArguments().size()); - Out << 'E'; - break; - } - case Expr::DeclRefExprClass: mangleDeclRefExpr(cast(E)->getDecl()); break; diff --git a/lib/Sema/SemaTemplate.cpp b/lib/Sema/SemaTemplate.cpp index 09cc525837..2871511466 100644 --- a/lib/Sema/SemaTemplate.cpp +++ b/lib/Sema/SemaTemplate.cpp @@ -4302,7 +4302,7 @@ ExprResult Sema::BuildTemplateIdExpr(const CXXScopeSpec &SS, TemplateKWLoc, TemplateArgs); } - if (R.getAsSingle()) { + if (R.getAsSingle() && !AnyDependentArguments()) { return CheckConceptTemplateId(SS, TemplateKWLoc, R.getLookupNameInfo().getBeginLoc(), R.getFoundDecl(), diff --git a/test/CodeGenCXX/mangle-concept.cpp b/test/CodeGenCXX/mangle-concept.cpp deleted file mode 100644 index 3ef7f2e02a..0000000000 --- a/test/CodeGenCXX/mangle-concept.cpp +++ /dev/null @@ -1,16 +0,0 @@ -// RUN: %clang_cc1 -verify -Wno-return-type -Wno-main -std=c++2a -fconcepts-ts -emit-llvm -triple %itanium_abi_triple -o - %s | FileCheck %s -// expected-no-diagnostics - -namespace test1 { -template struct S {}; -template concept C = true; -template S> f0() { return S>{}; } -template S> f0<>(); -// CHECK: void @_ZN5test12f0IiEENS_1SIXL_ZNS_1CIT_EEEEEEv( -} - -template struct S {}; -template concept C = true; -template S> f0() { return S>{}; } -template S> f0<>(); -// CHECK: void @_Z2f0IiE1SIXL_Z1CIT_EEEEv( -- 2.40.0