[cfe-commits] r51269 - /cfe/trunk/lib/Sema/SemaInit.cpp
Eli Friedman
eli.friedman at gmail.com
Mon May 19 13:20:43 PDT 2008
Author: efriedma
Date: Mon May 19 15:20:43 2008
New Revision: 51269
URL: http://llvm.org/viewvc/llvm-project?rev=51269&view=rev
Log:
Adjust warning so that it doesn't fire when there is an error.
Modified:
cfe/trunk/lib/Sema/SemaInit.cpp
Modified: cfe/trunk/lib/Sema/SemaInit.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaInit.cpp?rev=51269&r1=51268&r2=51269&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaInit.cpp (original)
+++ cfe/trunk/lib/Sema/SemaInit.cpp Mon May 19 15:20:43 2008
@@ -98,9 +98,6 @@
void InitListChecker::CheckExplicitInitList(InitListExpr *IList, QualType &T,
unsigned &Index) {
assert(IList->isExplicit() && "Illegal Implicit InitListExpr");
- if (T->isScalarType())
- SemaRef->Diag(IList->getLocStart(), diag::warn_braces_around_scalar_init,
- IList->getSourceRange());
CheckListElementTypes(IList, T, Index);
IList->setType(T);
@@ -120,6 +117,10 @@
IList->getInit(Index)->getSourceRange());
}
}
+
+ if (!hadError && T->isScalarType())
+ SemaRef->Diag(IList->getLocStart(), diag::warn_braces_around_scalar_init,
+ IList->getSourceRange());
}
void InitListChecker::CheckListElementTypes(InitListExpr *IList,
More information about the cfe-commits
mailing list