diff options
author | Douglas Gregor <dgregor@apple.com> | 2009-03-26 00:10:35 +0000 |
---|---|---|
committer | Douglas Gregor <dgregor@apple.com> | 2009-03-26 00:10:35 +0000 |
commit | 97f1f1c46e7ba0a208cef09406ca6301607027e2 (patch) | |
tree | 79f1dac387132f302e9e666c39435eeaabc8ec52 /clang/lib/Sema/SemaDecl.cpp | |
parent | 4555618854c409cb804cd454b97771fa9f2d4b20 (diff) | |
download | bcm5719-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/SemaDecl.cpp')
-rw-r--r-- | clang/lib/Sema/SemaDecl.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp index 835792ee2db..88c08b0f751 100644 --- a/clang/lib/Sema/SemaDecl.cpp +++ b/clang/lib/Sema/SemaDecl.cpp @@ -3425,6 +3425,8 @@ void Sema::ActOnTagStartDefinition(Scope *S, DeclTy *TagD) { Record->getIdentifier(), Record); InjectedClassName->setImplicit(); InjectedClassName->setAccess(AS_public); + if (ClassTemplateDecl *Template = Record->getDescribedClassTemplate()) + InjectedClassName->setDescribedClassTemplate(Template); PushOnScopeChains(InjectedClassName, S); assert(InjectedClassName->isInjectedClassName() && "Broken injected-class-name"); |