r204487 - Placate -Wunreachable-code by removing unnecessary logic to handle NUM_OPENMP_DEFAULT_KINDS <= 1.

Ted Kremenek kremenek at apple.com
Fri Mar 21 10:34:28 PDT 2014


Author: kremenek
Date: Fri Mar 21 12:34:28 2014
New Revision: 204487

URL: http://llvm.org/viewvc/llvm-project?rev=204487&view=rev
Log:
Placate -Wunreachable-code by removing unnecessary logic to handle NUM_OPENMP_DEFAULT_KINDS <= 1.

Modified:
    cfe/trunk/lib/Sema/SemaOpenMP.cpp

Modified: cfe/trunk/lib/Sema/SemaOpenMP.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaOpenMP.cpp?rev=204487&r1=204486&r2=204487&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaOpenMP.cpp (original)
+++ cfe/trunk/lib/Sema/SemaOpenMP.cpp Fri Mar 21 12:34:28 2014
@@ -937,7 +937,9 @@ OMPClause *Sema::ActOnOpenMPDefaultClaus
                                           SourceLocation EndLoc) {
   if (Kind == OMPC_DEFAULT_unknown) {
     std::string Values;
-    std::string Sep(NUM_OPENMP_DEFAULT_KINDS > 1 ? ", " : "");
+    static_assert(NUM_OPENMP_DEFAULT_KINDS > 1,
+                  "NUM_OPENMP_DEFAULT_KINDS not greater than 1");
+    std::string Sep(", ");
     for (unsigned i = OMPC_DEFAULT_unknown + 1;
          i < NUM_OPENMP_DEFAULT_KINDS; ++i) {
       Values += "'";





More information about the cfe-commits mailing list