================
@@ -475,9 +475,41 @@ struct Empty {};
struct Empty ZeroSizeElements[10];
struct Empty zeroSizeElements(void) {
- // FIXME: We probably shouldn't report this access.
- return ZeroSizeElements[5];
+ // Previously this had produced the false positive warning {{Access of
+ // 'ZeroSizeElements' at byte offset 0, while it holds only 0 bytes}}.
+ return ZeroSizeElements[5]; // no-warning
----------------
NagyDonat wrote:
Regression tests often have comments that explain the old behavior that
motivated them. I agree that the spelling of the old warning message is
completely irrelevant, I just pasted it into a comment because it was the most
clear way to explain the situation.
> I think what we should stress is why we don't expect a warning here.
That is actually a good question – I clearly see that the old warning "looks
wrong" but I cannot formulate a concrete explanation why.
https://github.com/llvm/llvm-project/pull/218712
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits