aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Sema/SemaInit.cpp
diff options
context:
space:
mode:
authorMariya Podchishchaeva <mariya.podchishchaeva@intel.com>2023-05-03 09:24:52 -0400
committerMariya Podchishchaeva <mariya.podchishchaeva@intel.com>2023-05-03 09:25:03 -0400
commit7178ee190235bd5b6cc7c71d3ccc061d4b12656b (patch)
tree7f3106cd3ef4ba1c7cde6bc3c294bd26522fbb96 /clang/lib/Sema/SemaInit.cpp
parent32032cbf25748fcfd8cac9bf6cb0d153dfe151a2 (diff)
downloadllvm-7178ee190235bd5b6cc7c71d3ccc061d4b12656b.zip
llvm-7178ee190235bd5b6cc7c71d3ccc061d4b12656b.tar.gz
llvm-7178ee190235bd5b6cc7c71d3ccc061d4b12656b.tar.bz2
Revert "[clang] Reject flexible array member in a union in C++"
This reverts commit 22e2db6010b029ebd4c6d3d1fd30224d8b3109ef. Broke buildbots on Windows. It seems standard headers on Windows contain flexible array members in unions
Diffstat (limited to 'clang/lib/Sema/SemaInit.cpp')
-rw-r--r--clang/lib/Sema/SemaInit.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaInit.cpp b/clang/lib/Sema/SemaInit.cpp
index c8beae3..2d5d31f 100644
--- a/clang/lib/Sema/SemaInit.cpp
+++ b/clang/lib/Sema/SemaInit.cpp
@@ -805,7 +805,7 @@ InitListChecker::FillInEmptyInitializations(const InitializedEntity &Entity,
// order to leave them uninitialized, the ILE is expanded and the extra
// fields are then filled with NoInitExpr.
unsigned NumElems = numStructUnionElements(ILE->getType());
- if (!RDecl->isUnion() && RDecl->hasFlexibleArrayMember())
+ if (RDecl->hasFlexibleArrayMember())
++NumElems;
if (!VerifyOnly && ILE->getNumInits() < NumElems)
ILE->resizeInits(SemaRef.Context, NumElems);