]> granicus.if.org Git - clang/commit
Initial implementation of parsing, semantic analysis, and template
authorDouglas Gregor <dgregor@apple.com>
Fri, 27 Mar 2009 23:10:48 +0000 (23:10 +0000)
committerDouglas Gregor <dgregor@apple.com>
Fri, 27 Mar 2009 23:10:48 +0000 (23:10 +0000)
commitd57959af02b4af695276f4204443afe6e5d86bd8
tree1c3cfaf8db2cb260e9365d44d7f5b178a836b750
parentced21016cec1f189a695857bed103ecc9e3f3696
Initial implementation of parsing, semantic analysis, and template
instantiation for C++ typename-specifiers such as

  typename T::type

The parsing of typename-specifiers is relatively easy thanks to
annotation tokens. When we see the "typename", we parse the
typename-specifier and produce a typename annotation token. There are
only a few places where we need to handle this. We currently parse the
typename-specifier form that terminates in an identifier, but not the
simple-template-id form, e.g.,

  typename T::template apply<U, V>

Parsing of nested-name-specifiers has a similar problem, since at this
point we don't have any representation of a class template
specialization whose template-name is unknown.

Semantic analysis is only partially complete, with some support for
template instantiation that works for simple examples.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67875 91177308-0d34-0410-b5e6-96231b3b80d8
21 files changed:
include/clang/AST/ASTContext.h
include/clang/AST/DeclarationName.h
include/clang/AST/NestedNameSpecifier.h
include/clang/AST/Type.h
include/clang/AST/TypeNodes.def
include/clang/Basic/DiagnosticParseKinds.td
include/clang/Basic/DiagnosticSemaKinds.td
include/clang/Parse/Action.h
lib/AST/ASTContext.cpp
lib/AST/NestedNameSpecifier.cpp
lib/AST/Type.cpp
lib/AST/TypeSerialization.cpp
lib/Parse/ParseDecl.cpp
lib/Parse/ParseExpr.cpp
lib/Parse/ParseTentative.cpp
lib/Parse/Parser.cpp
lib/Sema/Sema.h
lib/Sema/SemaCXXScopeSpec.cpp
lib/Sema/SemaTemplate.cpp
lib/Sema/SemaTemplateInstantiate.cpp
test/SemaTemplate/typename-specifier.cpp [new file with mode: 0644]