aboutsummaryrefslogtreecommitdiff
path: root/lib/AST
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2009-03-14 00:25:26 +0000
committerAnders Carlsson <andersca@mac.com>2009-03-14 00:25:26 +0000
commitfb311762bb52dc015c02cb257d2913f104b556f8 (patch)
treeef804996a0d15bbba81575daef206d08cf85ea5e /lib/AST
parentf80a9d5c2ccc465211178223799217f7a42774ae (diff)
More static_assert work. Check that the assert expr is valid and show an error if it's false. Create the declaration and add it to the current context.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66995 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST')
-rw-r--r--lib/AST/DeclCXX.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/lib/AST/DeclCXX.cpp b/lib/AST/DeclCXX.cpp
index 4776ce5877..fd900834ca 100644
--- a/lib/AST/DeclCXX.cpp
+++ b/lib/AST/DeclCXX.cpp
@@ -13,6 +13,7 @@
#include "clang/AST/DeclCXX.h"
#include "clang/AST/ASTContext.h"
+#include "clang/AST/Expr.h"
#include "clang/Basic/IdentifierTable.h"
#include "llvm/ADT/STLExtras.h"
using namespace clang;
@@ -339,3 +340,19 @@ UsingDirectiveDecl *UsingDirectiveDecl::Create(ASTContext &C, DeclContext *DC,
Used, CommonAncestor);
}
+StaticAssertDecl *StaticAssertDecl::Create(ASTContext &C, DeclContext *DC,
+ SourceLocation L, Expr *AssertExpr,
+ StringLiteral *Message) {
+ return new (C) StaticAssertDecl(DC, L, AssertExpr, Message);
+}
+
+void StaticAssertDecl::Destroy(ASTContext& C) {
+ AssertExpr->Destroy(C);
+ Message->Destroy(C);
+ this->~StaticAssertDecl();
+ C.Deallocate((void *)this);
+}
+
+StaticAssertDecl::~StaticAssertDecl() {
+}
+