Closed Bug 831633 Opened 7 years ago Closed 7 years ago

Hundreds of -Wdelete-non-virtual-dtor warnings

Categories

(Core :: General, defect, P4)

x86
macOS
defect

Tracking

()

RESOLVED FIXED
mozilla21

People

(Reporter: cpeterson, Assigned: cpeterson)

References

Details

(Keywords: regression)

Attachments

(2 files)

Yesterday, I only saw a couple -Wdelete-non-virtual-dtor warnings when building Firefox for Android or Mac. Today, I see over 700:

content/base/src/EventSource.cpp:549:1 [-Wdelete-non-virtual-dtor] delete called on 'mozilla::dom::AsyncVerifyRedirectCallbackFwr' that has virtual functions but non-virtual destructor
...

I believe the regression is in this pushlog range:

https://hg.mozilla.org/integration/mozilla-inbound/pushloghtml?fromchange=43391698ce5e&tochange=a4b246fb54c1
None of the patches in that range looks like an obvious culprit to me.  cpeterson, can you bisect?
glandium, these warnings are a regression from disabling MOZ_FINAL in bug 830315.

Can we fix bug 830315's warnings with something like -Wno-c++11-extensions? If clang supports `final` in pre-C++11 code, why not take advantage of it?
Blocks: 830315
Yeah, -Wno-c++0x-extensions and undoing the changes in bug 830315 is probably the best thing to do here.  That, or getting everything compiling as C++11, but that's kind of scope-creepy.  :-)  Still something we should do eventually.
waldo: this patch just backs out the change from bug 830315 that restricted clang's MOZ_FINAL and MOZ_DELETE to pre-C++11.

glandium: In which files did you the C++11 extension warnings in bug 830315? I see that configure.in and js/src/configure.in already add -Wno-c++0x-extensions to clang's CXXFLAGS:

https://hg.mozilla.org/mozilla-central/file/a207f33adc1a/configure.in#l1518

(I'm building on Mac OS X with Apple's clang 4.1.)
Attachment #706278 - Flags: review?(jwalden+bmo)
Attachment #706278 - Flags: feedback?(mh+mozilla)
Comment on attachment 706278 [details] [diff] [review]
allow-clang-c++11.patch

Review of attachment 706278 [details] [diff] [review]:
-----------------------------------------------------------------

...hum, that's right, we do have that commandline flag.  I'd forgotten about that.  So, yeah, why were you seeing any warnings here, glandium?
Attachment #706278 - Flags: review?(jwalden+bmo) → review+
Because the warning is:
  warning: deleted function definitions are a C++11 extension [-Wc++11-extensions]

Note it's -Wc++11-extensions, not -Wc++0x-extensions
Attachment #706278 - Flags: feedback?(mh+mozilla)
Ah no, it's a different issue, it's because the warning flags are not given to HOST_CXX.
https://hg.mozilla.org/integration/mozilla-inbound/rev/88fc571a9e9e
Assignee: nobody → cpeterson
Status: NEW → ASSIGNED
Target Milestone: --- → mozilla21
Fixed by backout.
https://hg.mozilla.org/mozilla-central/rev/88fc571a9e9e
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.