aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2009-12-03 17:26:31 +0000
committerAnders Carlsson <andersca@mac.com>2009-12-03 17:26:31 +0000
commit7b0ca3fa6f9e89d81db96fe51d4d73bf69d17edc (patch)
tree0c09e37309d68c5c3cc102db19ee9799d72a0f77
parent1f5f3a4d58a1c7c50c331b33329fc14563533c04 (diff)
Handle static_assert inside functions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90461 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/CodeGen/CGDecl.cpp1
-rw-r--r--test/CodeGenCXX/static-assert.cpp6
2 files changed, 6 insertions, 1 deletions
diff --git a/lib/CodeGen/CGDecl.cpp b/lib/CodeGen/CGDecl.cpp
index 4c53c1ebcc..abb391af5d 100644
--- a/lib/CodeGen/CGDecl.cpp
+++ b/lib/CodeGen/CGDecl.cpp
@@ -43,6 +43,7 @@ void CodeGenFunction::EmitDecl(const Decl &D) {
case Decl::Using: // using X; [C++]
case Decl::UsingShadow:
case Decl::UsingDirective: // using namespace X; [C++]
+ case Decl::StaticAssert: // static_assert(X, ""); [C++0x]
// None of these decls require codegen support.
return;
diff --git a/test/CodeGenCXX/static-assert.cpp b/test/CodeGenCXX/static-assert.cpp
index 7757acd838..e103b99062 100644
--- a/test/CodeGenCXX/static-assert.cpp
+++ b/test/CodeGenCXX/static-assert.cpp
@@ -1,3 +1,7 @@
-// RUN: clang-cc %s -emit-llvm -o - -std=c++0x
+// RUN: clang-cc %s -emit-llvm -o - -std=c++0x -verify
static_assert(true, "");
+
+void f() {
+ static_assert(true, "");
+}