]> granicus.if.org Git - clang/commitdiff
[clang] Replacing asserts with static_asserts where appropriate
authorGabor Horvath <xazax.hun@gmail.com>
Mon, 16 Mar 2015 09:59:54 +0000 (09:59 +0000)
committerGabor Horvath <xazax.hun@gmail.com>
Mon, 16 Mar 2015 09:59:54 +0000 (09:59 +0000)
Summary: This patch consists of the suggestions of clang-tidy/misc-static-assert check.

Reviewers: alexfh

Subscribers: dblaikie, xazax.hun, cfe-commits

Differential Revision: http://reviews.llvm.org/D8344

Patch by Szabolcs Sipos!

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

lib/Sema/SemaChecking.cpp

index 5eafa503486e39205c959df6f8498e0980a35e75..0b6d363088eda1053641f45a46f3d95f219bc02f 100644 (file)
@@ -1318,9 +1318,10 @@ ExprResult Sema::SemaAtomicOpsOverloaded(ExprResult TheCallResult,
   //   M is C if C is an integer, and ptrdiff_t if C is a pointer, and
   //   the int parameters are for orderings.
 
-  assert(AtomicExpr::AO__c11_atomic_init == 0 &&
-         AtomicExpr::AO__c11_atomic_fetch_xor + 1 == AtomicExpr::AO__atomic_load
-         && "need to update code for modified C11 atomics");
+  static_assert(AtomicExpr::AO__c11_atomic_init == 0 &&
+                    AtomicExpr::AO__c11_atomic_fetch_xor + 1 ==
+                        AtomicExpr::AO__atomic_load,
+                "need to update code for modified C11 atomics");
   bool IsC11 = Op >= AtomicExpr::AO__c11_atomic_init &&
                Op <= AtomicExpr::AO__c11_atomic_fetch_xor;
   bool IsN = Op == AtomicExpr::AO__atomic_load_n ||