diff options
| author | Ahmed Charles <ahmedcharles@gmail.com> | 2014-03-09 04:57:09 +0000 |
|---|---|---|
| committer | Ahmed Charles <ahmedcharles@gmail.com> | 2014-03-09 04:57:09 +0000 |
| commit | 821b66669cc7ccd53221b1e4e7ad4dde861927d7 (patch) | |
| tree | 7604625ddb71869842fb5dcd04128f28801f24da | |
| parent | b255ee91a7aae47cf7d6199b447efd6da75f1c76 (diff) | |
| download | bcm5719-llvm-821b66669cc7ccd53221b1e4e7ad4dde861927d7.tar.gz bcm5719-llvm-821b66669cc7ccd53221b1e4e7ad4dde861927d7.zip | |
[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
| -rw-r--r-- | llvm/lib/IR/Verifier.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/llvm/lib/IR/Verifier.cpp b/llvm/lib/IR/Verifier.cpp index f64ebc1a672..f49cca5a3e3 100644 --- a/llvm/lib/IR/Verifier.cpp +++ b/llvm/lib/IR/Verifier.cpp @@ -1974,9 +1974,10 @@ 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 |

