[PATCH] D70122: [cmake] Disable GCC 9's -Winit-list-lifetime warning

Aaron Ballman via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Sun Nov 17 09:57:44 PST 2019


aaron.ballman accepted this revision.
aaron.ballman added a comment.

In D70122#1749001 <https://reviews.llvm.org/D70122#1749001>, @xbolva00 wrote:

> I had wanted to suggest pragmas too but then I realized what basically rnk says:
>
> > I also suspect that the warning may affect the call site of the ArrayRef constructor, in which case the pragmas won't be localized, they will be everywhere.
>
> So *probably* there is no “pragma” solution here..


I agree that we don't want to add pragmas at all the use sites.

> Maybe we could wrap the problematic constructor into static method of ArrayRef? Than, we could add warning push/pop pragma here. Could it work? And update all callsites to use this new static method..

This may be a possible solution worth looking into.

I'm accepting because I don't want to prevent -Werror builds with GCC 9 or requiring heroics, but I still think we want this diagnostic to be enabled in most cases and think it's unfortunate we'll lose its coverage.


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D70122





More information about the llvm-commits mailing list