aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaInit.cpp
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2010-10-30 01:06:26 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2010-10-30 01:06:26 +0000
commitd86132d52c1dd99ad5519abaad92533712692a8b (patch)
tree505f005cfd34e5de348296ec854c6a72f04fd835 /lib/Sema/SemaInit.cpp
parent6a622dfde49ff06df4e0487fa9782a9a137971ac (diff)
Don't remove the init expression from the initializer list if it had a semantic error.
We already flag the error with InitListChecker's hadError and we mess up the AST unnecessarily. Fixes rdar://8605381. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@117760 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaInit.cpp')
-rw-r--r--lib/Sema/SemaInit.cpp1
1 files changed, 0 insertions, 1 deletions
diff --git a/lib/Sema/SemaInit.cpp b/lib/Sema/SemaInit.cpp
index 4e4558479a..616b2a0bf5 100644
--- a/lib/Sema/SemaInit.cpp
+++ b/lib/Sema/SemaInit.cpp
@@ -723,7 +723,6 @@ void InitListChecker::CheckSubElementType(const InitializedEntity &Entity,
// PerformCopyInitialization produce the appropriate diagnostic.
SemaRef.PerformCopyInitialization(Entity, SourceLocation(),
SemaRef.Owned(expr));
- IList->setInit(Index, 0);
hadError = true;
++Index;
++StructuredIndex;