diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-04-01 00:28:59 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-04-01 00:28:59 +0000 |
commit | 1734317845d60307d474b5da8a8d33adbaf5e723 (patch) | |
tree | 1507be0d13c9f841e5f42f3b9e2cc53835b43055 /lib/AST/NestedNameSpecifier.cpp | |
parent | 8e4fea6750dbac032c172f3279c63b7815b7423e (diff) |
Parsing, semantic analysis, and template instantiation for typename
specifiers that terminate in a simple-template-id, e.g.,
typename MetaFun::template apply<T1, T2>
Also, implement template instantiation for dependent
nested-name-specifiers that involve unresolved identifiers, e.g.,
typename T::type::type
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@68166 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/NestedNameSpecifier.cpp')
-rw-r--r-- | lib/AST/NestedNameSpecifier.cpp | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/lib/AST/NestedNameSpecifier.cpp b/lib/AST/NestedNameSpecifier.cpp index 2db8c76343..c94a4da7b6 100644 --- a/lib/AST/NestedNameSpecifier.cpp +++ b/lib/AST/NestedNameSpecifier.cpp @@ -30,7 +30,7 @@ NestedNameSpecifier::FindOrInsert(ASTContext &Context, NestedNameSpecifier *NNS = Context.NestedNameSpecifiers.FindNodeOrInsertPos(ID, InsertPos); if (!NNS) { - NNS = new (Context) NestedNameSpecifier(Mockup); + NNS = new (Context, 4) NestedNameSpecifier(Mockup); Context.NestedNameSpecifiers.InsertNode(NNS, InsertPos); } @@ -44,9 +44,9 @@ NestedNameSpecifier::Create(ASTContext &Context, NestedNameSpecifier *Prefix, assert(Prefix && Prefix->isDependent() && "Prefix must be dependent"); NestedNameSpecifier Mockup; - Mockup.Prefix = Prefix; - Mockup.Specifier.setPointer(II); - Mockup.Specifier.setInt(Identifier); + Mockup.Prefix.setPointer(Prefix); + Mockup.Prefix.setInt(Identifier); + Mockup.Specifier = II; return FindOrInsert(Context, Mockup); } @@ -58,9 +58,9 @@ NestedNameSpecifier::Create(ASTContext &Context, NestedNameSpecifier *Prefix, (Prefix->getAsType() == 0 && Prefix->getAsIdentifier() == 0)) && "Broken nested name specifier"); NestedNameSpecifier Mockup; - Mockup.Prefix = Prefix; - Mockup.Specifier.setPointer(NS); - Mockup.Specifier.setInt(Namespace); + Mockup.Prefix.setPointer(Prefix); + Mockup.Prefix.setInt(Namespace); + Mockup.Specifier = NS; return FindOrInsert(Context, Mockup); } @@ -69,15 +69,15 @@ NestedNameSpecifier::Create(ASTContext &Context, NestedNameSpecifier *Prefix, bool Template, Type *T) { assert(T && "Type cannot be NULL"); NestedNameSpecifier Mockup; - Mockup.Prefix = Prefix; - Mockup.Specifier.setPointer(T); - Mockup.Specifier.setInt(Template? TypeSpecWithTemplate : TypeSpec); + Mockup.Prefix.setPointer(Prefix); + Mockup.Prefix.setInt(Template? TypeSpecWithTemplate : TypeSpec); + Mockup.Specifier = T; return FindOrInsert(Context, Mockup); } NestedNameSpecifier *NestedNameSpecifier::GlobalSpecifier(ASTContext &Context) { if (!Context.GlobalNestedNameSpecifier) - Context.GlobalNestedNameSpecifier = new (Context) NestedNameSpecifier(); + Context.GlobalNestedNameSpecifier = new (Context, 4) NestedNameSpecifier(); return Context.GlobalNestedNameSpecifier; } @@ -105,8 +105,8 @@ bool NestedNameSpecifier::isDependent() const { /// \brief Print this nested name specifier to the given output /// stream. void NestedNameSpecifier::print(llvm::raw_ostream &OS) const { - if (Prefix) - Prefix->print(OS); + if (getPrefix()) + getPrefix()->print(OS); switch (getKind()) { case Identifier: |