diff options
| author | Douglas Gregor <dgregor@apple.com> | 2009-05-11 19:58:34 +0000 |
|---|---|---|
| committer | Douglas Gregor <dgregor@apple.com> | 2009-05-11 19:58:34 +0000 |
| commit | c9f9b86732d3c34306125236b2cbb64e9c0bec88 (patch) | |
| tree | b634c676604e760e66968cecc9fa0f73440f7b3b /clang/lib/AST/Decl.cpp | |
| parent | c14b594b14b265f208463cb8e7354be8d3b67fd2 (diff) | |
| download | bcm5719-llvm-c9f9b86732d3c34306125236b2cbb64e9c0bec88.tar.gz bcm5719-llvm-c9f9b86732d3c34306125236b2cbb64e9c0bec88.zip | |
Implement the notions of the "current instantiation" and "unknown
specialization" within a C++ template, and permit name lookup into the
current instantiation. For example, given:
template<typename T, typename U>
struct X {
typedef T type;
X* x1; // current instantiation
X<T, U> *x2; // current instantiation
X<U, T> *x3; // not current instantiation
::X<type, U> *x4; // current instantiation
X<typename X<type, U>::type, U>: *x5; // current instantiation
};
llvm-svn: 71471
Diffstat (limited to 'clang/lib/AST/Decl.cpp')
| -rw-r--r-- | clang/lib/AST/Decl.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/clang/lib/AST/Decl.cpp b/clang/lib/AST/Decl.cpp index 621145f1af9..319d4d5756c 100644 --- a/clang/lib/AST/Decl.cpp +++ b/clang/lib/AST/Decl.cpp @@ -507,9 +507,10 @@ OverloadedOperatorKind FunctionDecl::getOverloadedOperator() const { //===----------------------------------------------------------------------===// bool TagDecl::isDependentType() const { - if (isa<TemplateDecl>(this)) - return true; - + 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(); |

