[C++11] Fix break due to MSVC bug.

MSVC (2012, 2013, 2013 Nov CTP) fail on the following code:

int main() {
  int arr[] = {1, 2};
  for (int i : arr)
    do {} while (0);
}

The fix is to put {} around the for loop. I've reported this to the MSVC
team.

llvm-svn: 203371
This commit is contained in:
Ahmed Charles 2014-03-09 04:57:09 +00:00
parent b255ee91a7
commit 821b66669c
1 changed files with 2 additions and 1 deletions

View File

@ -1974,10 +1974,11 @@ void Verifier::visitInstruction(Instruction &I) {
Assert1(BB, "Instruction not embedded in basic block!", &I);
if (!isa<PHINode>(I)) { // Check that non-phi nodes are not self referential
for (User *U : I.users())
for (User *U : I.users()) {
Assert1(U != (User*)&I || !DT.isReachableFromEntry(BB),
"Only PHI nodes may reference their own value!", &I);
}
}
// Check that void typed values don't have names
Assert1(!I.getType()->isVoidTy() || !I.hasName(),