[cfe-commits] r90461 - in /cfe/trunk: lib/CodeGen/CGDecl.cpp test/CodeGenCXX/static-assert.cpp
Anders Carlsson
andersca at mac.com
Thu Dec 3 09:26:31 PST 2009
Author: andersca
Date: Thu Dec 3 11:26:31 2009
New Revision: 90461
URL: http://llvm.org/viewvc/llvm-project?rev=90461&view=rev
Log:
Handle static_assert inside functions.
Modified:
cfe/trunk/lib/CodeGen/CGDecl.cpp
cfe/trunk/test/CodeGenCXX/static-assert.cpp
Modified: cfe/trunk/lib/CodeGen/CGDecl.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/CGDecl.cpp?rev=90461&r1=90460&r2=90461&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/CGDecl.cpp (original)
+++ cfe/trunk/lib/CodeGen/CGDecl.cpp Thu Dec 3 11:26:31 2009
@@ -43,6 +43,7 @@
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;
Modified: cfe/trunk/test/CodeGenCXX/static-assert.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGenCXX/static-assert.cpp?rev=90461&r1=90460&r2=90461&view=diff
==============================================================================
--- cfe/trunk/test/CodeGenCXX/static-assert.cpp (original)
+++ cfe/trunk/test/CodeGenCXX/static-assert.cpp Thu Dec 3 11:26:31 2009
@@ -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, "");
+}
More information about the cfe-commits
mailing list