summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST/DeclTemplate.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2009-02-09 18:46:07 +0000
committerDouglas Gregor <dgregor@apple.com>2009-02-09 18:46:07 +0000
commit8bf4205c703aecfe28a8b4e3ae796e5b40be4672 (patch)
tree8e840fbe7de62cd7fbb0425a3810095c9e44e608 /clang/lib/AST/DeclTemplate.cpp
parent1df2bbe7f9fde4a57ee5c088241007e4401f4061 (diff)
downloadbcm5719-llvm-8bf4205c703aecfe28a8b4e3ae796e5b40be4672.tar.gz
bcm5719-llvm-8bf4205c703aecfe28a8b4e3ae796e5b40be4672.zip
Start processing template-ids as types when the template-name refers
to a class template. For example, the template-id 'vector<int>' now has a nice, sugary type in the type system. What we can do now: - Parse template-ids like 'vector<int>' (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
Diffstat (limited to 'clang/lib/AST/DeclTemplate.cpp')
-rw-r--r--clang/lib/AST/DeclTemplate.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/clang/lib/AST/DeclTemplate.cpp b/clang/lib/AST/DeclTemplate.cpp
index d005ca3b067..ab5a3bc0b2f 100644
--- a/clang/lib/AST/DeclTemplate.cpp
+++ b/clang/lib/AST/DeclTemplate.cpp
@@ -13,6 +13,7 @@
#include "clang/AST/DeclCXX.h"
#include "clang/AST/DeclTemplate.h"
+#include "clang/AST/Expr.h"
#include "clang/AST/ASTContext.h"
#include "clang/Basic/IdentifierTable.h"
#include "llvm/ADT/STLExtras.h"
@@ -43,6 +44,11 @@ TemplateParameterList::Create(ASTContext &C, SourceLocation TemplateLoc,
NumParams, RAngleLoc);
}
+void TemplateArg::Destroy(ASTContext &C) {
+ if (Kind == ExprArg)
+ getAsExpr()->Destroy(C);
+}
+
//===----------------------------------------------------------------------===//
// TemplateDecl Implementation
//===----------------------------------------------------------------------===//
OpenPOWER on IntegriCloud