MOZ_FINAL and MOZ_DELETE cause a warning in clang in C++98 mode

RESOLVED WORKSFORME

Status

()

Core
MFBT
RESOLVED WORKSFORME
5 years ago
5 years ago

People

(Reporter: glandium, Assigned: glandium)

Tracking

Trunk
mozilla21
x86_64
Linux
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Assignee)

Description

5 years ago
warning: deleted function definitions are a C++11 extension [-Wc++11-extensions]
warning: 'final' keyword is a C++11 extension [-Wc++11-extensions]

Apparently, __has_extension(cxx_deleted_functions) and __has_extension(cxx_override_control) are still true when __cplusplus < 201103L.
(Assignee)

Comment 1

5 years ago
Created attachment 701774 [details] [diff] [review]
Don't enable MOZ_FINAL and MOZ_DELETE on clang unless compiling as C++11
Attachment #701774 - Flags: review?(jwalden+bmo)

Comment 2

5 years ago
Comment on attachment 701774 [details] [diff] [review]
Don't enable MOZ_FINAL and MOZ_DELETE on clang unless compiling as C++11

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

Odd.  We compile SpiderMonkey as C++98, and use override all the time there, so I'm not sure why I've never seen these warnings there.  Oh well, these warnings obviously manifest on a test program, so this is the right thing to do for now.

I'd hoped __extension__ override or __extension__(override) would work to silence the warning and give override semantics, but no dice for now.  Maybe we'll get it in some future version of clang; I filed http://llvm.org/bugs/show_bug.cgi?id=14953 on that.
Attachment #701774 - Flags: review?(jwalden+bmo) → review+

Comment 4

5 years ago
https://hg.mozilla.org/mozilla-central/rev/1c7bdeefa8ee
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla21
Depends on: 831633
This was backed out in bug 831633.
https://hg.mozilla.org/mozilla-central/rev/88fc571a9e9e
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
It'd be _really_ nice to get this resolved. This spews out a huge number of warnings, and if you build at a terminal, the combination of clang's colorized output and the interleaving caused by parallel builds makes my terminal program repeatedly bring up print dialogs. Sometimes it also gets the terminal in an unusable state.
(Assignee)

Comment 7

5 years ago
You shouldn't actually be seeing these particular warnings, as mentioned in bug 831633. They should only appear for HOST_C*SRCS files, and we don't build that many.

Comment 8

5 years ago
I assume you're going to add the relevant warning flags to HOST_*FLAGS, right?  I can't think of a reason why we should have different flags for host versus target here.
I agree that I shouldn't be seeing them. =) I see a lot of them, though, on a clean build (OS X 10.8). IIRC the JS engine is the primary source of them.
I don't see this happening anymore.
Status: REOPENED → RESOLVED
Last Resolved: 5 years ago5 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.