[cfe-dev] Warning when calling virtual functions from constructor/desctructor?
John McCall via cfe-dev
cfe-dev at lists.llvm.org
Tue Jan 8 16:14:38 PST 2019
On 8 Jan 2019, at 15:03, Arthur O'Dwyer wrote:
> I was thinking of `-Wreturn-std-move`, which is -Wmove/-Wmost/-Wall but not
I honestly don't know why this isn't default-on.
> Grepping the code for DefaultIgnore, I see that -Wfor-loop-analysis is
> another example (but 4 years old).
This is a harder call. At any rate, I think my point stands that this is not
There's a fairly substantial difference between warnings that target patterns
that are *inarguably* bad, like the std::move problem (which in some sense is
a language defect that people just need to be taught how to work around), and
warnings that target code patterns that might be confusing or which have a
higher-than-normal chance of being a typo. `-Wparentheses` is the classic
example here: it unquestionably catches a common mistake that C unfortunately
otherwise masks, but it's still perennially controversial because the
assign-and-test idiom is so common in C programming, and there are a lot of
people who still swear by reversing the equality test (`0 == foo`) instead of
relying on the warning.
> On Tue, Jan 8, 2019 at 2:37 PM John McCall <jmccall at apple.com> wrote:
>> On 8 Jan 2019, at 13:45, Arthur O'Dwyer wrote:
>>> On Tue, Jan 8, 2019 at 1:05 PM John McCall via cfe-dev <
>>> cfe-dev at lists.llvm.org> wrote:
>>>> On 8 Jan 2019, at 8:37, Arnaud Bienner wrote:
>>>>> I realized I didn't put "DefaultIgnore" on this warning.
>>>>> I'm not experienced enough with clang to know what's the best way to
>>>>> with new warnings, but my feeling is that it would be sensible to
>>>>> new warning DefaultIgnore for now, in -Wall, and make it default
>>>>> once we
>>>>> have some feedback from the community: while not all C++ projects
>>>>> (or -Wextra) I believe enough do to give us a chance to get some
>>>>> What do you think?
>>>> We generally don't add things to -Wall. That's why I went into my
>>>> about versioning: I think it's a conversation we need to have before
>>>> ready to accept this as a warning that's anything but hidden
>>>> behind its own opt-in flag.
>>> John: Wha? Clang *frequently* adds things to -Wall! -Wall includes
>>> which includes a bunch of other categories, so while we don't often
>>> put new
>>> diagnostics *directly* under -Wall, pretty much every "reasonable"
>>> diagnostic eventually winds up in there somehow — which is the
>> I don't think we "frequently" add things to -Wall or -Wmost. We do
>> frequently add warnings that are unconditionally default-on, but the
>> have a conventional meaning that we don't generally touch. What
>> warnings are you thinking of that are not default-on but which are
>> in a group like -Wall or -Wmost?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the cfe-dev