aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/Decl.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-05-28 16:34:51 +0000
committerDouglas Gregor <dgregor@apple.com>2009-05-28 16:34:51 +0000
commitbc221637f5ed3538b8495dd13b831c11e821c712 (patch)
tree8667ccb5108f9dfab258cb47ae788505bbf21c55 /lib/AST/Decl.cpp
parent8c0d8a2cc4844ebed87842821930a0ebd3dc8924 (diff)
Introduced DeclContext::isDependentContext, which determines whether a
given DeclContext is dependent on type parameters. Use this to properly determine whether a TagDecl is dependent; previously, we were missing the case where the TagDecl is a local class of a member function of a class template (phew!). Also, make sure that, when we instantiate declarations within a member function of a class template (or a function template, eventually), that we add those declarations to the "instantiated locals" map so that they can be found when instantiating declaration references. Unfortunately, I was not able to write a useful test for this change, although the assert() that fires when uncommenting the FIXME'd line in test/SemaTemplate/instantiate-declref.cpp tells the "experienced user" that we're now doing the right thing. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@72526 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/Decl.cpp')
-rw-r--r--lib/AST/Decl.cpp13
1 files changed, 0 insertions, 13 deletions
diff --git a/lib/AST/Decl.cpp b/lib/AST/Decl.cpp
index 6c620713f7..063914092e 100644
--- a/lib/AST/Decl.cpp
+++ b/lib/AST/Decl.cpp
@@ -528,19 +528,6 @@ OverloadedOperatorKind FunctionDecl::getOverloadedOperator() const {
// TagDecl Implementation
//===----------------------------------------------------------------------===//
-bool TagDecl::isDependentType() const {
- if (const CXXRecordDecl *Record = dyn_cast<CXXRecordDecl>(this))
- if (Record->getDescribedClassTemplate())
- return true;
-
- if (const TagDecl *TD = dyn_cast_or_null<TagDecl>(getDeclContext()))
- return TD->isDependentType();
-
- // FIXME: Tag types declared function templates are dependent types.
- // FIXME: Look through block scopes.
- return false;
-}
-
void TagDecl::startDefinition() {
TagType *TagT = const_cast<TagType *>(TypeForDecl->getAsTagType());
TagT->decl.setPointer(this);