Fznamznon added a comment.

> Well that's... a bit shorter... than I would have expected that union to be. 
> (I'm not apologizing for the pun.)

In clang `union x { short x[]; }; static_assert(sizeof(x)==2);` evaluates to '0 
== 2'. That is even shorter, I guess? This is also the reason why

  union A {char x[]; };
  A a = {0};

keeps crashing even after my fix. It feels like we're not even close to be 
compatible with msvc. I would probably prefer submitting the original fix and 
submitting an issue to clean up the mess with this extension. At least this way 
it won't crash in C after issuing an error, like this 
https://godbolt.org/z/5oxYTq5fq


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D147626

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
  • [PATCH] D147626: [cl... Mariya Podchishchaeva via Phabricator via cfe-commits

Reply via email to