[PATCH] D149612: [Sema] avoid merge error type

Erich Keane via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Wed May 10 06:57:21 PDT 2023


erichkeane added a comment.

@aaron.ballman : Can you comment, particularly on the 'x2' and 'x3' examples here?  I think our hackery here to get the AST back in a reasonable position here is unfortunate, and leads to some pretty awkward errors.  I'm not sure what else we could do?

We can't make it a dependent type, as it can then not be merged correctly.
We can't really make it a variable array type, since we would then have those types in places where it isn't 'legal'.
We would have a perhaps similar problem with the incomplete array type as the VLA, but at least we would diagnose `char[]`, right?

My original thoughts were to make this still be a constant-array-type, keeping the 'error' size expression, but with a '1' for the extent, but I'm second guessing here based on those errors.



================
Comment at: clang/test/Sema/merge-decls.c:101
+char x3[sizeof(d.data) == 8]; // expected-error {{member reference base type 'char' is not a structure or union}}
+char x3[1];
----------------
Newline at end of file still needed.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D149612/new/

https://reviews.llvm.org/D149612



More information about the cfe-commits mailing list