[PATCH] D49952: Check for NULL Destination-Type when creating ArrayConstant

John McCall via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 3 18:14:13 PDT 2018

rjmccall added inline comments.

Comment at: lib/CodeGen/CGExprConstant.cpp:2123
+    // This means that the array type is probably "IncompleteType" or some
+    // type that is not ConstantArray.
+    if (CAT == nullptr && CommonElementType == nullptr && !NumInitElts) {
It definitely means that it's an incomplete array type, i.e. a flexible array member.

Comment at: test/CodeGenCXX/empty-struct-init-list.cpp:11
+} c;
+c d{ };
rjmccall wrote:
> Please make this a `FileCheck` test that tests the actual compiler output.
I'm sorry, I should've been more specific.  Please include a test line that shows the complete constant generated to initialize `@d`.

  rC Clang


More information about the cfe-commits mailing list