summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-03-26 00:10:35 +0000
committerDouglas Gregor <dgregor@apple.com>2009-03-26 00:10:35 +0000
commit97f1f1c46e7ba0a208cef09406ca6301607027e2 (patch)
tree79f1dac387132f302e9e666c39435eeaabc8ec52 /clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
parent4555618854c409cb804cd454b97771fa9f2d4b20 (diff)
downloadbcm5719-llvm-97f1f1c46e7ba0a208cef09406ca6301607027e2.tar.gz
bcm5719-llvm-97f1f1c46e7ba0a208cef09406ca6301607027e2.zip
The injected-class-name of class templates and class template
specializations can be treated as a template. Finally, we can parse and process the first implementation of Fibonacci I wrote! Note that this code does not handle all of the cases where injected-class-names can be treated as templates. In particular, there's an ambiguity case that we should be able to handle (but can't), e.g., template <class T> struct Base { }; template <class T> struct Derived : Base<int>, Base<char> { typename Derived::Base b; // error: ambiguous typename Derived::Base<double> d; // OK }; llvm-svn: 67720
Diffstat (limited to 'clang/lib/Sema/SemaTemplateInstantiateDecl.cpp')
-rw-r--r--clang/lib/Sema/SemaTemplateInstantiateDecl.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp b/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
index 46076f261a7..adddb2997a5 100644
--- a/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
+++ b/clang/lib/Sema/SemaTemplateInstantiateDecl.cpp
@@ -279,6 +279,8 @@ Decl *TemplateDeclInstantiator::VisitCXXRecordDecl(CXXRecordDecl *D) {
if (!D->isInjectedClassName())
Record->setInstantiationOfMemberClass(D);
+ else
+ Record->setDescribedClassTemplate(D->getDescribedClassTemplate());
Owner->addDecl(Record);
return Record;
OpenPOWER on IntegriCloud