This revision was automatically updated to reflect the committed changes.
Closed by commit rG8f8e450b6682: [clang] Fix crash on attempt to initialize
union with flexible array member (authored by Fznamznon).
Changed prior to commit:
https://reviews.llvm.org/D150435?vs=523723=524278#toc
Fznamznon added inline comments.
Comment at: clang/test/Sema/flexible-array-in-union.c:1-16
+// RUN: %clang_cc1 %s -verify -fsyntax-only -DERROR
+// RUN: %clang_cc1 %s -verify -fsyntax-only -x c++
+// RUN: %clang_cc1 %s -verify -fsyntax-only -fms-compatibility
+// RUN:
aaron.ballman accepted this revision.
aaron.ballman added a comment.
LGTM with a minor tweak to the test, thanks!
Comment at: clang/test/Sema/flexible-array-in-union.c:1-16
+// RUN: %clang_cc1 %s -verify -fsyntax-only -DERROR
+// RUN: %clang_cc1 %s -verify -fsyntax-only -x c++
Fznamznon added a comment.
@aaron.ballman , WDYT?
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D150435/new/
https://reviews.llvm.org/D150435
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
shafik accepted this revision.
shafik added a comment.
This revision is now accepted and ready to land.
LGTM after addressing Aaron's comment
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D150435/new/
https://reviews.llvm.org/D150435
Fznamznon updated this revision to Diff 523723.
Fznamznon added a comment.
Move the test to a separate file, test C++ and MSVC compatibility mode
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D150435/new/
https://reviews.llvm.org/D150435
Files:
aaron.ballman added a comment.
The precommit CI failures seem unrelated to these changes.
Comment at: clang/test/Sema/init.c:168-169
+
+// GH61746
+union { char x[]; } r = {0}; // expected-error {{flexible array member 'x' in
a union is not allowed}}
I think
Fznamznon created this revision.
Herald added a project: All.
Fznamznon requested review of this revision.
Herald added a project: clang.
Herald added a subscriber: cfe-commits.
Due to missing check on union, there was a null expression
added to init list that caused crash later.
Fixes