]> granicus.if.org Git - clang/commit
Implement template instantiation for ClassTemplateSpecializationTypes,
authorDouglas Gregor <dgregor@apple.com>
Mon, 9 Mar 2009 23:48:35 +0000 (23:48 +0000)
committerDouglas Gregor <dgregor@apple.com>
Mon, 9 Mar 2009 23:48:35 +0000 (23:48 +0000)
commit40808ce6ac04b102c3b56244a635d6b98eed6d97
tree92301d6219bc011b5ef02707aa8251e30d3f0db0
parente15b486ada22517bd976768cabf80213cef44347
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66509 91177308-0d34-0410-b5e6-96231b3b80d8
12 files changed:
include/clang/AST/ASTContext.h
include/clang/AST/DeclTemplate.h
include/clang/AST/Type.h
lib/AST/ASTContext.cpp
lib/AST/DeclTemplate.cpp
lib/AST/Type.cpp
lib/AST/TypeSerialization.cpp
lib/Sema/Sema.h
lib/Sema/SemaDeclCXX.cpp
lib/Sema/SemaTemplate.cpp
lib/Sema/SemaTemplateInstantiate.cpp
test/SemaTemplate/temp_arg_type.cpp