diff options
| author | John McCall <rjmccall@apple.com> | 2010-03-10 03:28:59 +0000 | 
|---|---|---|
| committer | John McCall <rjmccall@apple.com> | 2010-03-10 03:28:59 +0000 | 
| commit | e78aac41debf968be07fb755ba94b6fed29167b5 (patch) | |
| tree | cef59ba0038ccbcc5bea1447bc23fda13fc4da45 /clang/lib/Sema/SemaDecl.cpp | |
| parent | 80ad1137313d04a2b2ecdf92e37a139db7094f3a (diff) | |
| download | bcm5719-llvm-e78aac41debf968be07fb755ba94b6fed29167b5.tar.gz bcm5719-llvm-e78aac41debf968be07fb755ba94b6fed29167b5.zip | |
Create a new InjectedClassNameType to represent bare-word references to the 
injected class name of a class template or class template partial specialization.
This is a non-canonical type;  the canonical type is still a template 
specialization type.  This becomes the TypeForDecl of the pattern declaration,
which cleans up some amount of code (and complicates some other parts, but
whatever).
Fixes PR6326 and probably a few others, primarily by re-establishing a few
invariants about TypeLoc sizes.     
llvm-svn: 98134
Diffstat (limited to 'clang/lib/Sema/SemaDecl.cpp')
| -rw-r--r-- | clang/lib/Sema/SemaDecl.cpp | 19 | 
1 files changed, 1 insertions, 18 deletions
| diff --git a/clang/lib/Sema/SemaDecl.cpp b/clang/lib/Sema/SemaDecl.cpp index 82dcd60aa06..94fcfc6c29e 100644 --- a/clang/lib/Sema/SemaDecl.cpp +++ b/clang/lib/Sema/SemaDecl.cpp @@ -188,18 +188,6 @@ Sema::TypeTy *Sema::getTypeName(IdentifierInfo &II, SourceLocation NameLoc,    if (TypeDecl *TD = dyn_cast<TypeDecl>(IIDecl)) {      DiagnoseUseOfDecl(IIDecl, NameLoc); -    // C++ [temp.local]p2: -    //   Within the scope of a class template specialization or -    //   partial specialization, when the injected-class-name is -    //   not followed by a <, it is equivalent to the -    //   injected-class-name followed by the template-argument s -    //   of the class template specialization or partial -    //   specialization enclosed in <>. -    if (CXXRecordDecl *RD = dyn_cast<CXXRecordDecl>(TD)) -      if (RD->isInjectedClassName()) -        if (ClassTemplateDecl *Template = RD->getDescribedClassTemplate()) -          T = Template->getInjectedClassNameType(Context); -      if (T.isNull())        T = Context.getTypeDeclType(TD); @@ -1773,12 +1761,7 @@ DeclarationName Sema::GetNameFromUnqualifiedId(const UnqualifiedId &Name) {          return DeclarationName();        // Determine the type of the class being constructed. -      QualType CurClassType; -      if (ClassTemplateDecl *ClassTemplate -            = CurClass->getDescribedClassTemplate()) -        CurClassType = ClassTemplate->getInjectedClassNameType(Context); -      else -        CurClassType = Context.getTypeDeclType(CurClass); +      QualType CurClassType = Context.getTypeDeclType(CurClass);        // FIXME: Check two things: that the template-id names the same type as        // CurClassType, and that the template-id does not occur when the name | 

