]> granicus.if.org Git - clang/commitdiff
Handle static_assert inside functions.
authorAnders Carlsson <andersca@mac.com>
Thu, 3 Dec 2009 17:26:31 +0000 (17:26 +0000)
committerAnders Carlsson <andersca@mac.com>
Thu, 3 Dec 2009 17:26:31 +0000 (17:26 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@90461 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/CGDecl.cpp
test/CodeGenCXX/static-assert.cpp

index 4c53c1ebcc789dfe376ba0c676aaa19eefd00467..abb391af5d68259cd160edc68a069aab3846f754 100644 (file)
@@ -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;
 
index 7757acd83887d4e232e70b696400d812510fb539..e103b9906257f6e89f644f468323ef9a5fdedca2 100644 (file)
@@ -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, "");
+}