diff options
author | John McCall <rjmccall@apple.com> | 2011-06-21 22:12:46 +0000 |
---|---|---|
committer | John McCall <rjmccall@apple.com> | 2011-06-21 22:12:46 +0000 |
commit | 26a6ec7be5ad57aa380f62aa2c39cd073e22d9dc (patch) | |
tree | e6aa5eaa29afc3cfde2b7e6e375f18c9547672e6 /lib/AST/ItaniumMangle.cpp | |
parent | 57b9d9810d969df141a19dae8bea9defddb02264 (diff) |
Fix the mangling of dependent-scope decl ref expressions so that they
use the unresolved-name production correctly.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133554 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/ItaniumMangle.cpp')
-rw-r--r-- | lib/AST/ItaniumMangle.cpp | 28 |
1 files changed, 8 insertions, 20 deletions
diff --git a/lib/AST/ItaniumMangle.cpp b/lib/AST/ItaniumMangle.cpp index 92e166a34a..81c65433c4 100644 --- a/lib/AST/ItaniumMangle.cpp +++ b/lib/AST/ItaniumMangle.cpp @@ -2244,6 +2244,10 @@ void CXXNameMangler::mangleExpression(const Expr *E, unsigned Arity) { case Expr::UnresolvedLookupExprClass: { const UnresolvedLookupExpr *ULE = cast<UnresolvedLookupExpr>(E); mangleUnresolvedName(ULE->getQualifier(), 0, ULE->getName(), Arity); + + // All the <unresolved-name> productions end in a + // base-unresolved-name, where <template-args> are just tacked + // onto the end. if (ULE->hasExplicitTemplateArgs()) mangleTemplateArgs(ULE->getExplicitTemplateArgs()); break; @@ -2457,29 +2461,13 @@ void CXXNameMangler::mangleExpression(const Expr *E, unsigned Arity) { case Expr::DependentScopeDeclRefExprClass: { const DependentScopeDeclRefExpr *DRE = cast<DependentScopeDeclRefExpr>(E); - NestedNameSpecifier *NNS = DRE->getQualifier(); - const Type *QTy = NNS->getAsType(); - - // When we're dealing with a nested-name-specifier that has just a - // dependent identifier in it, mangle that as a typename. FIXME: - // It isn't clear that we ever actually want to have such a - // nested-name-specifier; why not just represent it as a typename type? - if (!QTy && NNS->getAsIdentifier() && NNS->getPrefix()) { - QTy = getASTContext().getDependentNameType(ETK_Typename, - NNS->getPrefix(), - NNS->getAsIdentifier()) - .getTypePtr(); - } - assert(QTy && "Qualifier was not type!"); + mangleUnresolvedName(DRE->getQualifier(), 0, DRE->getDeclName(), Arity); - // ::= sr <type> <unqualified-name> # dependent name - // ::= sr <type> <unqualified-name> <template-args> # dependent template-id - Out << "sr"; - mangleType(QualType(QTy, 0)); - mangleUnqualifiedName(0, DRE->getDeclName(), Arity); + // All the <unresolved-name> productions end in a + // base-unresolved-name, where <template-args> are just tacked + // onto the end. if (DRE->hasExplicitTemplateArgs()) mangleTemplateArgs(DRE->getExplicitTemplateArgs()); - break; } |