efriedma-quic wrote:

The current spec language is:

> Empty structs or union arguments or return values are ignored by C compilers 
> which support them as a non-standard extension. This is not the case for C++, 
> which requires them to be sized types.

So empty structs in C are ignored, empty structs in C++ are treated as 
non-empty.

The "C++ struct containing an empty array" is sort of an edge case, since it's 
not actually legal C++, but the spec says the distinguishing factor is whether 
we're in C++ mode.  And gcc seems to do that, so let's do the same thing.  So 
instead of checking for `Size == 0`, check for `LangOpts.CPlusPlus`.

Also, please add a release note for this.

https://github.com/llvm/llvm-project/pull/97315
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to