From 8bf4205c703aecfe28a8b4e3ae796e5b40be4672 Mon Sep 17 00:00:00 2001 From: Douglas Gregor Date: Mon, 9 Feb 2009 18:46:07 +0000 Subject: Start processing template-ids as types when the template-name refers to a class template. For example, the template-id 'vector' now has a nice, sugary type in the type system. What we can do now: - Parse template-ids like 'vector' (where 'vector' names a class template) and form proper types for them in the type system. - Parse icky template-ids like 'A<5>' and 'A<(5 > 0)>' properly, using (sadly) a bool in the parser to tell it whether '>' should be treated as an operator or not. This is a baby-step, with major problems and limitations: - There are currently two ways that we handle template arguments (whether they are types or expressions). These will be merged, and, most likely, TemplateArg will disappear. - We don't have any notion of the declaration of class template specializations or of template instantiations, so all template-ids are fancy names for 'int' :) llvm-svn: 64153 --- clang/lib/Parse/MinimalAction.cpp | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'clang/lib/Parse/MinimalAction.cpp') diff --git a/clang/lib/Parse/MinimalAction.cpp b/clang/lib/Parse/MinimalAction.cpp index 2d6c9a6ba56..ce15cf9ddae 100644 --- a/clang/lib/Parse/MinimalAction.cpp +++ b/clang/lib/Parse/MinimalAction.cpp @@ -95,14 +95,11 @@ bool MinimalAction::isCurrentClassName(const IdentifierInfo &, Scope *, return false; } - /// isTemplateName - Determines whether the identifier II is a - /// template name in the current scope, and returns the template - /// declaration if II names a template. An optional CXXScope can be - /// passed to indicate the C++ scope in which the identifier will be - /// found. -Action::DeclTy *MinimalAction::isTemplateName(IdentifierInfo &II, Scope *S, - const CXXScopeSpec *SS ) { - return 0; +Action::TemplateNameKind +MinimalAction::isTemplateName(IdentifierInfo &II, Scope *S, + DeclTy *&TemplateDecl, + const CXXScopeSpec *SS) { + return TNK_Non_template; } /// ActOnDeclarator - If this is a typedef declarator, we modify the -- cgit v1.2.3