2009-02-15 04:20:19 +08:00
|
|
|
//===--- SemaCXXScopeSpec.cpp - Semantic Analysis for C++ scope specifiers-===//
|
|
|
|
//
|
|
|
|
// The LLVM Compiler Infrastructure
|
|
|
|
//
|
|
|
|
// This file is distributed under the University of Illinois Open Source
|
|
|
|
// License. See LICENSE.TXT for details.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
//
|
|
|
|
// This file implements C++ semantic analysis for scope specifiers.
|
|
|
|
//
|
|
|
|
//===----------------------------------------------------------------------===//
|
|
|
|
|
|
|
|
#include "Sema.h"
|
|
|
|
#include "clang/AST/ASTContext.h"
|
Introduce a representation for types that we referred to via a
qualified name, e.g.,
foo::x
so that we retain the nested-name-specifier as written in the source
code and can reproduce that qualified name when printing the types
back (e.g., in diagnostics). This is PR3493, which won't be complete
until finished the other tasks mentioned near the end of this commit.
The parser's representation of nested-name-specifiers, CXXScopeSpec,
is now a bit fatter, because it needs to contain the scopes that
precede each '::' and keep track of whether the global scoping
operator '::' was at the beginning. For example, we need to keep track
of the leading '::', 'foo', and 'bar' in
::foo::bar::x
The Action's CXXScopeTy * is no longer a DeclContext *. It's now the
opaque version of the new NestedNameSpecifier, which contains a single
component of a nested-name-specifier (either a DeclContext * or a Type
*, bitmangled).
The new sugar type QualifiedNameType composes a sequence of
NestedNameSpecifiers with a representation of the type we're actually
referring to. At present, we only build QualifiedNameType nodes within
Sema::getTypeName. This will be extended to other type-constructing
actions (e.g., ActOnClassTemplateId).
Also on the way: QualifiedDeclRefExprs will also store a sequence of
NestedNameSpecifiers, so that we can print out the property
nested-name-specifier. I expect to also use this for handling
dependent names like Fibonacci<I - 1>::value.
llvm-svn: 67265
2009-03-19 08:18:19 +08:00
|
|
|
#include "clang/AST/NestedNameSpecifier.h"
|
2009-02-15 04:20:19 +08:00
|
|
|
#include "clang/Parse/DeclSpec.h"
|
|
|
|
#include "llvm/ADT/STLExtras.h"
|
|
|
|
using namespace clang;
|
|
|
|
|
Introduce a representation for types that we referred to via a
qualified name, e.g.,
foo::x
so that we retain the nested-name-specifier as written in the source
code and can reproduce that qualified name when printing the types
back (e.g., in diagnostics). This is PR3493, which won't be complete
until finished the other tasks mentioned near the end of this commit.
The parser's representation of nested-name-specifiers, CXXScopeSpec,
is now a bit fatter, because it needs to contain the scopes that
precede each '::' and keep track of whether the global scoping
operator '::' was at the beginning. For example, we need to keep track
of the leading '::', 'foo', and 'bar' in
::foo::bar::x
The Action's CXXScopeTy * is no longer a DeclContext *. It's now the
opaque version of the new NestedNameSpecifier, which contains a single
component of a nested-name-specifier (either a DeclContext * or a Type
*, bitmangled).
The new sugar type QualifiedNameType composes a sequence of
NestedNameSpecifiers with a representation of the type we're actually
referring to. At present, we only build QualifiedNameType nodes within
Sema::getTypeName. This will be extended to other type-constructing
actions (e.g., ActOnClassTemplateId).
Also on the way: QualifiedDeclRefExprs will also store a sequence of
NestedNameSpecifiers, so that we can print out the property
nested-name-specifier. I expect to also use this for handling
dependent names like Fibonacci<I - 1>::value.
llvm-svn: 67265
2009-03-19 08:18:19 +08:00
|
|
|
/// \brief Compute the DeclContext that is associated with the given
|
|
|
|
/// scope specifier.
|
|
|
|
DeclContext *Sema::computeDeclContext(const CXXScopeSpec &SS) {
|
|
|
|
if (!SS.isSet() || SS.isInvalid())
|
2009-03-18 08:36:05 +08:00
|
|
|
return 0;
|
|
|
|
|
Introduce a representation for types that we referred to via a
qualified name, e.g.,
foo::x
so that we retain the nested-name-specifier as written in the source
code and can reproduce that qualified name when printing the types
back (e.g., in diagnostics). This is PR3493, which won't be complete
until finished the other tasks mentioned near the end of this commit.
The parser's representation of nested-name-specifiers, CXXScopeSpec,
is now a bit fatter, because it needs to contain the scopes that
precede each '::' and keep track of whether the global scoping
operator '::' was at the beginning. For example, we need to keep track
of the leading '::', 'foo', and 'bar' in
::foo::bar::x
The Action's CXXScopeTy * is no longer a DeclContext *. It's now the
opaque version of the new NestedNameSpecifier, which contains a single
component of a nested-name-specifier (either a DeclContext * or a Type
*, bitmangled).
The new sugar type QualifiedNameType composes a sequence of
NestedNameSpecifiers with a representation of the type we're actually
referring to. At present, we only build QualifiedNameType nodes within
Sema::getTypeName. This will be extended to other type-constructing
actions (e.g., ActOnClassTemplateId).
Also on the way: QualifiedDeclRefExprs will also store a sequence of
NestedNameSpecifiers, so that we can print out the property
nested-name-specifier. I expect to also use this for handling
dependent names like Fibonacci<I - 1>::value.
llvm-svn: 67265
2009-03-19 08:18:19 +08:00
|
|
|
NestedNameSpecifier NNS
|
|
|
|
= NestedNameSpecifier::getFromOpaquePtr(SS.getCurrentScopeRep());
|
|
|
|
return NNS.computeDeclContext(Context);
|
2009-03-18 08:36:05 +08:00
|
|
|
}
|
|
|
|
|
2009-03-12 00:48:53 +08:00
|
|
|
/// \brief Require that the context specified by SS be complete.
|
|
|
|
///
|
|
|
|
/// If SS refers to a type, this routine checks whether the type is
|
|
|
|
/// complete enough (or can be made complete enough) for name lookup
|
|
|
|
/// into the DeclContext. A type that is not yet completed can be
|
|
|
|
/// considered "complete enough" if it is a class/struct/union/enum
|
|
|
|
/// that is currently being defined. Or, if we have a type that names
|
|
|
|
/// a class template specialization that is not a complete type, we
|
|
|
|
/// will attempt to instantiate that class template.
|
|
|
|
bool Sema::RequireCompleteDeclContext(const CXXScopeSpec &SS) {
|
|
|
|
if (!SS.isSet() || SS.isInvalid())
|
|
|
|
return false;
|
|
|
|
|
Introduce a representation for types that we referred to via a
qualified name, e.g.,
foo::x
so that we retain the nested-name-specifier as written in the source
code and can reproduce that qualified name when printing the types
back (e.g., in diagnostics). This is PR3493, which won't be complete
until finished the other tasks mentioned near the end of this commit.
The parser's representation of nested-name-specifiers, CXXScopeSpec,
is now a bit fatter, because it needs to contain the scopes that
precede each '::' and keep track of whether the global scoping
operator '::' was at the beginning. For example, we need to keep track
of the leading '::', 'foo', and 'bar' in
::foo::bar::x
The Action's CXXScopeTy * is no longer a DeclContext *. It's now the
opaque version of the new NestedNameSpecifier, which contains a single
component of a nested-name-specifier (either a DeclContext * or a Type
*, bitmangled).
The new sugar type QualifiedNameType composes a sequence of
NestedNameSpecifiers with a representation of the type we're actually
referring to. At present, we only build QualifiedNameType nodes within
Sema::getTypeName. This will be extended to other type-constructing
actions (e.g., ActOnClassTemplateId).
Also on the way: QualifiedDeclRefExprs will also store a sequence of
NestedNameSpecifiers, so that we can print out the property
nested-name-specifier. I expect to also use this for handling
dependent names like Fibonacci<I - 1>::value.
llvm-svn: 67265
2009-03-19 08:18:19 +08:00
|
|
|
DeclContext *DC = computeDeclContext(SS);
|
2009-03-12 00:48:53 +08:00
|
|
|
if (TagDecl *Tag = dyn_cast<TagDecl>(DC)) {
|
|
|
|
// If we're currently defining this type, then lookup into the
|
|
|
|
// type is okay: don't complain that it isn't complete yet.
|
|
|
|
const TagType *TagT = Context.getTypeDeclType(Tag)->getAsTagType();
|
|
|
|
if (TagT->isBeingDefined())
|
|
|
|
return false;
|
|
|
|
|
|
|
|
// The type must be complete.
|
|
|
|
return RequireCompleteType(SS.getRange().getBegin(),
|
|
|
|
Context.getTypeDeclType(Tag),
|
|
|
|
diag::err_incomplete_nested_name_spec,
|
|
|
|
SS.getRange());
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
2009-02-15 04:20:19 +08:00
|
|
|
|
|
|
|
/// ActOnCXXGlobalScopeSpecifier - Return the object that represents the
|
|
|
|
/// global scope ('::').
|
|
|
|
Sema::CXXScopeTy *Sema::ActOnCXXGlobalScopeSpecifier(Scope *S,
|
|
|
|
SourceLocation CCLoc) {
|
Introduce a representation for types that we referred to via a
qualified name, e.g.,
foo::x
so that we retain the nested-name-specifier as written in the source
code and can reproduce that qualified name when printing the types
back (e.g., in diagnostics). This is PR3493, which won't be complete
until finished the other tasks mentioned near the end of this commit.
The parser's representation of nested-name-specifiers, CXXScopeSpec,
is now a bit fatter, because it needs to contain the scopes that
precede each '::' and keep track of whether the global scoping
operator '::' was at the beginning. For example, we need to keep track
of the leading '::', 'foo', and 'bar' in
::foo::bar::x
The Action's CXXScopeTy * is no longer a DeclContext *. It's now the
opaque version of the new NestedNameSpecifier, which contains a single
component of a nested-name-specifier (either a DeclContext * or a Type
*, bitmangled).
The new sugar type QualifiedNameType composes a sequence of
NestedNameSpecifiers with a representation of the type we're actually
referring to. At present, we only build QualifiedNameType nodes within
Sema::getTypeName. This will be extended to other type-constructing
actions (e.g., ActOnClassTemplateId).
Also on the way: QualifiedDeclRefExprs will also store a sequence of
NestedNameSpecifiers, so that we can print out the property
nested-name-specifier. I expect to also use this for handling
dependent names like Fibonacci<I - 1>::value.
llvm-svn: 67265
2009-03-19 08:18:19 +08:00
|
|
|
return NestedNameSpecifier(Context.getTranslationUnitDecl()).getAsOpaquePtr();
|
2009-02-15 04:20:19 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
/// ActOnCXXNestedNameSpecifier - Called during parsing of a
|
|
|
|
/// nested-name-specifier. e.g. for "foo::bar::" we parsed "foo::" and now
|
|
|
|
/// we want to resolve "bar::". 'SS' is empty or the previously parsed
|
|
|
|
/// nested-name part ("foo::"), 'IdLoc' is the source location of 'bar',
|
|
|
|
/// 'CCLoc' is the location of '::' and 'II' is the identifier for 'bar'.
|
|
|
|
/// Returns a CXXScopeTy* object representing the C++ scope.
|
|
|
|
Sema::CXXScopeTy *Sema::ActOnCXXNestedNameSpecifier(Scope *S,
|
|
|
|
const CXXScopeSpec &SS,
|
|
|
|
SourceLocation IdLoc,
|
|
|
|
SourceLocation CCLoc,
|
|
|
|
IdentifierInfo &II) {
|
|
|
|
NamedDecl *SD = LookupParsedName(S, &SS, &II, LookupNestedNameSpecifierName);
|
|
|
|
|
|
|
|
if (SD) {
|
|
|
|
if (TypedefDecl *TD = dyn_cast<TypedefDecl>(SD)) {
|
2009-03-18 08:36:05 +08:00
|
|
|
if (TD->getUnderlyingType()->isRecordType())
|
Introduce a representation for types that we referred to via a
qualified name, e.g.,
foo::x
so that we retain the nested-name-specifier as written in the source
code and can reproduce that qualified name when printing the types
back (e.g., in diagnostics). This is PR3493, which won't be complete
until finished the other tasks mentioned near the end of this commit.
The parser's representation of nested-name-specifiers, CXXScopeSpec,
is now a bit fatter, because it needs to contain the scopes that
precede each '::' and keep track of whether the global scoping
operator '::' was at the beginning. For example, we need to keep track
of the leading '::', 'foo', and 'bar' in
::foo::bar::x
The Action's CXXScopeTy * is no longer a DeclContext *. It's now the
opaque version of the new NestedNameSpecifier, which contains a single
component of a nested-name-specifier (either a DeclContext * or a Type
*, bitmangled).
The new sugar type QualifiedNameType composes a sequence of
NestedNameSpecifiers with a representation of the type we're actually
referring to. At present, we only build QualifiedNameType nodes within
Sema::getTypeName. This will be extended to other type-constructing
actions (e.g., ActOnClassTemplateId).
Also on the way: QualifiedDeclRefExprs will also store a sequence of
NestedNameSpecifiers, so that we can print out the property
nested-name-specifier. I expect to also use this for handling
dependent names like Fibonacci<I - 1>::value.
llvm-svn: 67265
2009-03-19 08:18:19 +08:00
|
|
|
return NestedNameSpecifier(Context.getTypeDeclType(TD).getTypePtr())
|
|
|
|
.getAsOpaquePtr();
|
2009-02-15 04:20:19 +08:00
|
|
|
} else if (isa<NamespaceDecl>(SD) || isa<RecordDecl>(SD)) {
|
Introduce a representation for types that we referred to via a
qualified name, e.g.,
foo::x
so that we retain the nested-name-specifier as written in the source
code and can reproduce that qualified name when printing the types
back (e.g., in diagnostics). This is PR3493, which won't be complete
until finished the other tasks mentioned near the end of this commit.
The parser's representation of nested-name-specifiers, CXXScopeSpec,
is now a bit fatter, because it needs to contain the scopes that
precede each '::' and keep track of whether the global scoping
operator '::' was at the beginning. For example, we need to keep track
of the leading '::', 'foo', and 'bar' in
::foo::bar::x
The Action's CXXScopeTy * is no longer a DeclContext *. It's now the
opaque version of the new NestedNameSpecifier, which contains a single
component of a nested-name-specifier (either a DeclContext * or a Type
*, bitmangled).
The new sugar type QualifiedNameType composes a sequence of
NestedNameSpecifiers with a representation of the type we're actually
referring to. At present, we only build QualifiedNameType nodes within
Sema::getTypeName. This will be extended to other type-constructing
actions (e.g., ActOnClassTemplateId).
Also on the way: QualifiedDeclRefExprs will also store a sequence of
NestedNameSpecifiers, so that we can print out the property
nested-name-specifier. I expect to also use this for handling
dependent names like Fibonacci<I - 1>::value.
llvm-svn: 67265
2009-03-19 08:18:19 +08:00
|
|
|
return NestedNameSpecifier(cast<DeclContext>(SD)).getAsOpaquePtr();
|
2009-02-15 04:20:19 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
// FIXME: Template parameters and dependent types.
|
|
|
|
// FIXME: C++0x scoped enums
|
|
|
|
|
|
|
|
// Fall through to produce an error: we found something that isn't
|
|
|
|
// a class or a namespace.
|
|
|
|
}
|
|
|
|
|
|
|
|
// If we didn't find anything during our lookup, try again with
|
|
|
|
// ordinary name lookup, which can help us produce better error
|
|
|
|
// messages.
|
|
|
|
if (!SD)
|
|
|
|
SD = LookupParsedName(S, &SS, &II, LookupOrdinaryName);
|
|
|
|
unsigned DiagID;
|
|
|
|
if (SD)
|
|
|
|
DiagID = diag::err_expected_class_or_namespace;
|
|
|
|
else if (SS.isSet())
|
|
|
|
DiagID = diag::err_typecheck_no_member;
|
|
|
|
else
|
|
|
|
DiagID = diag::err_undeclared_var_use;
|
|
|
|
|
|
|
|
if (SS.isSet())
|
|
|
|
Diag(IdLoc, DiagID) << &II << SS.getRange();
|
|
|
|
else
|
|
|
|
Diag(IdLoc, DiagID) << &II;
|
|
|
|
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
Implement parsing of nested-name-specifiers that involve template-ids, e.g.,
std::vector<int>::allocator_type
When we parse a template-id that names a type, it will become either a
template-id annotation (which is a parsed representation of a
template-id that has not yet been through semantic analysis) or a
typename annotation (where semantic analysis has resolved the
template-id to an actual type), depending on the context. We only
produce a type in contexts where we know that we only need type
information, e.g., in a type specifier. Otherwise, we create a
template-id annotation that can later be "upgraded" by transforming it
into a typename annotation when the parser needs a type. This occurs,
for example, when we've parsed "std::vector<int>" above and then see
the '::' after it. However, it means that when writing something like
this:
template<> class Outer::Inner<int> { ... };
We have two tokens to represent Outer::Inner<int>: one token for the
nested name specifier Outer::, and one template-id annotation token
for Inner<int>, which will be passed to semantic analysis to define
the class template specialization.
Most of the churn in the template tests in this patch come from an
improvement in our error recovery from ill-formed template-ids.
llvm-svn: 65467
2009-02-26 03:37:18 +08:00
|
|
|
Sema::CXXScopeTy *Sema::ActOnCXXNestedNameSpecifier(Scope *S,
|
|
|
|
const CXXScopeSpec &SS,
|
|
|
|
TypeTy *Ty,
|
|
|
|
SourceRange TypeRange,
|
|
|
|
SourceLocation CCLoc) {
|
Introduce a representation for types that we referred to via a
qualified name, e.g.,
foo::x
so that we retain the nested-name-specifier as written in the source
code and can reproduce that qualified name when printing the types
back (e.g., in diagnostics). This is PR3493, which won't be complete
until finished the other tasks mentioned near the end of this commit.
The parser's representation of nested-name-specifiers, CXXScopeSpec,
is now a bit fatter, because it needs to contain the scopes that
precede each '::' and keep track of whether the global scoping
operator '::' was at the beginning. For example, we need to keep track
of the leading '::', 'foo', and 'bar' in
::foo::bar::x
The Action's CXXScopeTy * is no longer a DeclContext *. It's now the
opaque version of the new NestedNameSpecifier, which contains a single
component of a nested-name-specifier (either a DeclContext * or a Type
*, bitmangled).
The new sugar type QualifiedNameType composes a sequence of
NestedNameSpecifiers with a representation of the type we're actually
referring to. At present, we only build QualifiedNameType nodes within
Sema::getTypeName. This will be extended to other type-constructing
actions (e.g., ActOnClassTemplateId).
Also on the way: QualifiedDeclRefExprs will also store a sequence of
NestedNameSpecifiers, so that we can print out the property
nested-name-specifier. I expect to also use this for handling
dependent names like Fibonacci<I - 1>::value.
llvm-svn: 67265
2009-03-19 08:18:19 +08:00
|
|
|
return NestedNameSpecifier(QualType::getFromOpaquePtr(Ty).getTypePtr())
|
|
|
|
.getAsOpaquePtr();
|
Implement parsing of nested-name-specifiers that involve template-ids, e.g.,
std::vector<int>::allocator_type
When we parse a template-id that names a type, it will become either a
template-id annotation (which is a parsed representation of a
template-id that has not yet been through semantic analysis) or a
typename annotation (where semantic analysis has resolved the
template-id to an actual type), depending on the context. We only
produce a type in contexts where we know that we only need type
information, e.g., in a type specifier. Otherwise, we create a
template-id annotation that can later be "upgraded" by transforming it
into a typename annotation when the parser needs a type. This occurs,
for example, when we've parsed "std::vector<int>" above and then see
the '::' after it. However, it means that when writing something like
this:
template<> class Outer::Inner<int> { ... };
We have two tokens to represent Outer::Inner<int>: one token for the
nested name specifier Outer::, and one template-id annotation token
for Inner<int>, which will be passed to semantic analysis to define
the class template specialization.
Most of the churn in the template tests in this patch come from an
improvement in our error recovery from ill-formed template-ids.
llvm-svn: 65467
2009-02-26 03:37:18 +08:00
|
|
|
}
|
|
|
|
|
2009-02-15 04:20:19 +08:00
|
|
|
/// ActOnCXXEnterDeclaratorScope - Called when a C++ scope specifier (global
|
|
|
|
/// scope or nested-name-specifier) is parsed, part of a declarator-id.
|
|
|
|
/// After this method is called, according to [C++ 3.4.3p3], names should be
|
|
|
|
/// looked up in the declarator-id's scope, until the declarator is parsed and
|
|
|
|
/// ActOnCXXExitDeclaratorScope is called.
|
|
|
|
/// The 'SS' should be a non-empty valid CXXScopeSpec.
|
|
|
|
void Sema::ActOnCXXEnterDeclaratorScope(Scope *S, const CXXScopeSpec &SS) {
|
|
|
|
assert(SS.isSet() && "Parser passed invalid CXXScopeSpec.");
|
|
|
|
assert(PreDeclaratorDC == 0 && "Previous declarator context not popped?");
|
|
|
|
PreDeclaratorDC = static_cast<DeclContext*>(S->getEntity());
|
Introduce a representation for types that we referred to via a
qualified name, e.g.,
foo::x
so that we retain the nested-name-specifier as written in the source
code and can reproduce that qualified name when printing the types
back (e.g., in diagnostics). This is PR3493, which won't be complete
until finished the other tasks mentioned near the end of this commit.
The parser's representation of nested-name-specifiers, CXXScopeSpec,
is now a bit fatter, because it needs to contain the scopes that
precede each '::' and keep track of whether the global scoping
operator '::' was at the beginning. For example, we need to keep track
of the leading '::', 'foo', and 'bar' in
::foo::bar::x
The Action's CXXScopeTy * is no longer a DeclContext *. It's now the
opaque version of the new NestedNameSpecifier, which contains a single
component of a nested-name-specifier (either a DeclContext * or a Type
*, bitmangled).
The new sugar type QualifiedNameType composes a sequence of
NestedNameSpecifiers with a representation of the type we're actually
referring to. At present, we only build QualifiedNameType nodes within
Sema::getTypeName. This will be extended to other type-constructing
actions (e.g., ActOnClassTemplateId).
Also on the way: QualifiedDeclRefExprs will also store a sequence of
NestedNameSpecifiers, so that we can print out the property
nested-name-specifier. I expect to also use this for handling
dependent names like Fibonacci<I - 1>::value.
llvm-svn: 67265
2009-03-19 08:18:19 +08:00
|
|
|
CurContext = computeDeclContext(SS);
|
2009-02-15 04:20:19 +08:00
|
|
|
S->setEntity(CurContext);
|
|
|
|
}
|
|
|
|
|
|
|
|
/// ActOnCXXExitDeclaratorScope - Called when a declarator that previously
|
|
|
|
/// invoked ActOnCXXEnterDeclaratorScope(), is finished. 'SS' is the same
|
|
|
|
/// CXXScopeSpec that was passed to ActOnCXXEnterDeclaratorScope as well.
|
|
|
|
/// Used to indicate that names should revert to being looked up in the
|
|
|
|
/// defining scope.
|
|
|
|
void Sema::ActOnCXXExitDeclaratorScope(Scope *S, const CXXScopeSpec &SS) {
|
|
|
|
assert(SS.isSet() && "Parser passed invalid CXXScopeSpec.");
|
Introduce a representation for types that we referred to via a
qualified name, e.g.,
foo::x
so that we retain the nested-name-specifier as written in the source
code and can reproduce that qualified name when printing the types
back (e.g., in diagnostics). This is PR3493, which won't be complete
until finished the other tasks mentioned near the end of this commit.
The parser's representation of nested-name-specifiers, CXXScopeSpec,
is now a bit fatter, because it needs to contain the scopes that
precede each '::' and keep track of whether the global scoping
operator '::' was at the beginning. For example, we need to keep track
of the leading '::', 'foo', and 'bar' in
::foo::bar::x
The Action's CXXScopeTy * is no longer a DeclContext *. It's now the
opaque version of the new NestedNameSpecifier, which contains a single
component of a nested-name-specifier (either a DeclContext * or a Type
*, bitmangled).
The new sugar type QualifiedNameType composes a sequence of
NestedNameSpecifiers with a representation of the type we're actually
referring to. At present, we only build QualifiedNameType nodes within
Sema::getTypeName. This will be extended to other type-constructing
actions (e.g., ActOnClassTemplateId).
Also on the way: QualifiedDeclRefExprs will also store a sequence of
NestedNameSpecifiers, so that we can print out the property
nested-name-specifier. I expect to also use this for handling
dependent names like Fibonacci<I - 1>::value.
llvm-svn: 67265
2009-03-19 08:18:19 +08:00
|
|
|
assert(S->getEntity() == computeDeclContext(SS) && "Context imbalance!");
|
2009-02-15 04:20:19 +08:00
|
|
|
S->setEntity(PreDeclaratorDC);
|
|
|
|
PreDeclaratorDC = 0;
|
|
|
|
|
|
|
|
// Reset CurContext to the nearest enclosing context.
|
|
|
|
while (!S->getEntity() && S->getParent())
|
|
|
|
S = S->getParent();
|
|
|
|
CurContext = static_cast<DeclContext*>(S->getEntity());
|
|
|
|
}
|