]> granicus.if.org Git - clang/commitdiff
[C++11] Switch from LLVM_STATIC_ASSERT to static_assert now that we
authorChandler Carruth <chandlerc@gmail.com>
Sun, 2 Mar 2014 13:02:01 +0000 (13:02 +0000)
committerChandler Carruth <chandlerc@gmail.com>
Sun, 2 Mar 2014 13:02:01 +0000 (13:02 +0000)
require host toolchains which support this.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@202640 91177308-0d34-0410-b5e6-96231b3b80d8

include/clang/ASTMatchers/ASTMatchersInternal.h
include/clang/StaticAnalyzer/Core/PathSensitive/CallEvent.h
lib/Lex/PPDirectives.cpp

index 9aeb4f9fd7602b54a803901bdbec61da4d1c45f8..b3bb3ca75092fb5bec53c8aff65a389630b8dd48 100644 (file)
@@ -52,7 +52,7 @@
 namespace clang {
 namespace ast_matchers {
 
-/// TODO: Use LLVM_STATIC_ASSERT() instead of this.
+/// TODO: Use static_assert instead of this.
 template <bool> struct CompileAssert {};
 #define TOOLING_COMPILE_ASSERT(Expr, Msg) LLVM_ATTRIBUTE_UNUSED \
   typedef CompileAssert<(bool(Expr))> Msg[bool(Expr) ? 1 : -1]
index 7eca8431376994eedcb7f46ccc0c4ed30cb6ea24..fe1a65d47e75c7b32c9efb31df4bed415d259905 100644 (file)
@@ -915,23 +915,23 @@ class CallEventManager {
 
   template <typename T, typename Arg>
   T *create(Arg A, ProgramStateRef St, const LocationContext *LCtx) {
-    LLVM_STATIC_ASSERT(sizeof(T) == sizeof(CallEventTemplateTy),
-                       "CallEvent subclasses are not all the same size");
+    static_assert(sizeof(T) == sizeof(CallEventTemplateTy),
+                  "CallEvent subclasses are not all the same size");
     return new (allocate()) T(A, St, LCtx);
   }
 
   template <typename T, typename Arg1, typename Arg2>
   T *create(Arg1 A1, Arg2 A2, ProgramStateRef St, const LocationContext *LCtx) {
-    LLVM_STATIC_ASSERT(sizeof(T) == sizeof(CallEventTemplateTy),
-                       "CallEvent subclasses are not all the same size");
+    static_assert(sizeof(T) == sizeof(CallEventTemplateTy),
+                  "CallEvent subclasses are not all the same size");
     return new (allocate()) T(A1, A2, St, LCtx);
   }
 
   template <typename T, typename Arg1, typename Arg2, typename Arg3>
   T *create(Arg1 A1, Arg2 A2, Arg3 A3, ProgramStateRef St,
             const LocationContext *LCtx) {
-    LLVM_STATIC_ASSERT(sizeof(T) == sizeof(CallEventTemplateTy),
-                       "CallEvent subclasses are not all the same size");
+    static_assert(sizeof(T) == sizeof(CallEventTemplateTy),
+                  "CallEvent subclasses are not all the same size");
     return new (allocate()) T(A1, A2, A3, St, LCtx);
   }
 
@@ -939,8 +939,8 @@ class CallEventManager {
             typename Arg4>
   T *create(Arg1 A1, Arg2 A2, Arg3 A3, Arg4 A4, ProgramStateRef St,
             const LocationContext *LCtx) {
-    LLVM_STATIC_ASSERT(sizeof(T) == sizeof(CallEventTemplateTy),
-                       "CallEvent subclasses are not all the same size");
+    static_assert(sizeof(T) == sizeof(CallEventTemplateTy),
+                  "CallEvent subclasses are not all the same size");
     return new (allocate()) T(A1, A2, A3, A4, St, LCtx);
   }
 
index 4a9e09f798ef5e03206a4b87205da0dd85808163..050ade45e4435ea757e6a46961abfada85f1fb9c 100644 (file)
@@ -60,8 +60,8 @@ MacroInfo *Preprocessor::AllocateMacroInfo(SourceLocation L) {
 
 MacroInfo *Preprocessor::AllocateDeserializedMacroInfo(SourceLocation L,
                                                        unsigned SubModuleID) {
-  LLVM_STATIC_ASSERT(llvm::AlignOf<MacroInfo>::Alignment >= sizeof(SubModuleID),
-                     "alignment for MacroInfo is less than the ID");
+  static_assert(llvm::AlignOf<MacroInfo>::Alignment >= sizeof(SubModuleID),
+                "alignment for MacroInfo is less than the ID");
   DeserializedMacroInfoChain *MIChain =
       BP.Allocate<DeserializedMacroInfoChain>();
   MIChain->Next = DeserialMIChainHead;