[llvm] [DWARFLinkerParallel] Fix member initialization order (PR #81179)

David Blaikie via llvm-commits llvm-commits at lists.llvm.org
Sat Feb 10 09:52:40 PST 2024


dwblaikie wrote:

I was concerned there might be missing test coverage here - but looks like the issue is benign (apart from the GCC warning itself) as the member is only stored as a reference and not used until after it's constructed.

Looking at Clang and GCC's behavior for the warning:

https://godbolt.org/z/G7ndsTv5c

It looks like GCC might have some quirks (it only warns about this case (escaping a reference to a member before the member is initialized) by the looks of it, if the ctor has only 1 parameter?).

Perhaps we should disable GCC's warning and rely on Clang's more conservative interpretation?

(though I don't actually object to this particular change - I think it's clearer/less subtle/etc - but in terms of what's worth filing bugs, etc about)

https://github.com/llvm/llvm-project/pull/81179


More information about the llvm-commits mailing list