]> granicus.if.org Git - clang/commitdiff
Revert DidWarn change - It won't catch all cases anyway and GCC warns for every exces...
authorAnders Carlsson <andersca@mac.com>
Wed, 5 Dec 2007 04:57:06 +0000 (04:57 +0000)
committerAnders Carlsson <andersca@mac.com>
Wed, 5 Dec 2007 04:57:06 +0000 (04:57 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@44603 91177308-0d34-0410-b5e6-96231b3b80d8

Sema/SemaDecl.cpp

index f1eb753523ada18e4872ac3f854d23bc74f7c7ad..70c4772a238a6cc7a312646cb52cb3fb9fc476c9 100644 (file)
@@ -470,7 +470,6 @@ void Sema::CheckConstantInitList(QualType DeclType, InitListExpr *IList,
   // The empty init list "{ }" is treated specially below.
   unsigned numInits = IList->getNumInits();
   if (numInits) {
-    bool DidWarn = false;
     for (unsigned i = 0; i < numInits; i++) {
       Expr *expr = IList->getInit(i);
       
@@ -483,12 +482,9 @@ void Sema::CheckConstantInitList(QualType DeclType, InitListExpr *IList,
         totalInits--;    // decrement the total number of initializers.
         
         // Check if we have space for another initializer.
-        if (((nInitsAtLevel > maxElementsAtThisLevel) || (totalInits < 0)) &&
-            !DidWarn) {
+        if (((nInitsAtLevel > maxElementsAtThisLevel) || (totalInits < 0)))
           Diag(expr->getLocStart(), diag::warn_excess_initializers, 
                expr->getSourceRange());
-          DidWarn = true;
-        }
       }
     }
     if (nInitsAtLevel < maxElementsAtThisLevel) // fill the remaining elements.