diff options
| author | Douglas Gregor <dgregor@apple.com> | 2009-03-09 23:48:35 +0000 | 
|---|---|---|
| committer | Douglas Gregor <dgregor@apple.com> | 2009-03-09 23:48:35 +0000 | 
| commit | c40290e452d44e4814f870152d36649347df7b3c (patch) | |
| tree | e72e4f1c1ddb3599377cb9e12b0593d492d83747 /clang/lib/Sema/SemaDeclCXX.cpp | |
| parent | d5b35ee21574b31c9a9555a1c99eb83742544769 (diff) | |
| download | bcm5719-llvm-c40290e452d44e4814f870152d36649347df7b3c.tar.gz bcm5719-llvm-c40290e452d44e4814f870152d36649347df7b3c.zip | |
Implement template instantiation for ClassTemplateSpecializationTypes,
such as replacing 'T' in vector<T>. There are a few aspects to this:
  - Extend TemplateArgument to allow arbitrary expressions (an
    Expr*), and switch ClassTemplateSpecializationType to store
    TemplateArguments rather than it's own type-or-expression
    representation.
  - ClassTemplateSpecializationType can now store dependent types. In
    that case, the canonical type is another
    ClassTemplateSpecializationType (with default template arguments
    expanded) rather than a declaration (we don't build Decls for
    dependent types).
  - Split ActOnClassTemplateId into ActOnClassTemplateId (called from
    the parser) and CheckClassTemplateId (called from
    ActOnClassTemplateId and InstantiateType). They're smart enough to
    handle dependent types, now.
llvm-svn: 66509
Diffstat (limited to 'clang/lib/Sema/SemaDeclCXX.cpp')
| -rw-r--r-- | clang/lib/Sema/SemaDeclCXX.cpp | 3 | 
1 files changed, 2 insertions, 1 deletions
| diff --git a/clang/lib/Sema/SemaDeclCXX.cpp b/clang/lib/Sema/SemaDeclCXX.cpp index 7773b9e6150..e9e2e3c2ace 100644 --- a/clang/lib/Sema/SemaDeclCXX.cpp +++ b/clang/lib/Sema/SemaDeclCXX.cpp @@ -383,7 +383,8 @@ Sema::BaseResult  Sema::ActOnBaseSpecifier(DeclTy *classdecl, SourceRange SpecifierRange,                           bool Virtual, AccessSpecifier Access,                           TypeTy *basetype, SourceLocation BaseLoc) { -  CXXRecordDecl *Class = (CXXRecordDecl*)classdecl; +  AdjustDeclIfTemplate(classdecl); +  CXXRecordDecl *Class = cast<CXXRecordDecl>((Decl*)classdecl);    QualType BaseType = QualType::getFromOpaquePtr(basetype);    if (CXXBaseSpecifier *BaseSpec = CheckBaseSpecifier(Class, SpecifierRange,                                                        Virtual, Access, | 

