Closed Bug 1444472 Opened 6 years ago Closed 6 years ago

error: default initialization of an object of const type 'const struct CheckHeaderToken' without a user-provided default constructor (nsCORSListenerProxy.cpp)

Categories

(Core :: Networking: HTTP, defect, P3)

defect

Tracking

()

RESOLVED FIXED
mozilla61
Tracking Status
firefox60 - fixed
firefox61 --- fixed

People

(Reporter: mccr8, Assigned: froydnj)

References

Details

(Whiteboard: [necko-triaged])

Attachments

(1 file)

I'm seeing this in a local icecc build of Firefox, with clang. It is an opt build.

amccreight@bangles:/media/ssd/mc$ /usr/bin/clang --version
clang version 3.8.0-2ubuntu4 (tags/RELEASE_380/final)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin

My mozconfig is:

export CC="/usr/bin/clang"
export CXX="/usr/bin/clang++"

mk_add_options 'export CCACHE_PREFIX=icecc'
mk_add_options MOZ_MAKE_FLAGS="-j100"

mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/obj-opt.noindex
mk_add_options AUTOCLOBBER=1

ac_add_options --enable-optimize
ac_add_options --disable-debug
ac_add_options --with-ccache
#ac_add_options --disable-ipdl-tests

#ac_add_options --disable-webrender

# Doesn't work with icecream.
#ac_add_options --enable-warnings-as-errors
The actual full error is:

 0:09.30 In file included from /media/ssd/mc/obj-opt.noindex/netwerk/protocol/http/Unified_cpp_protocol_http1.cpp:74:
 0:09.30 /media/ssd/mc/netwerk/protocol/http/nsCORSListenerProxy.cpp:230:5: error: default initialization of an object of const type 'const struct CheckHeaderToken' without a user-provided default constructor
 0:09.30   } checker;
 0:09.30     ^
 0:09.30            {}
 0:09.30 1 error generated.
GCC worked for me, FWIW.
This code was added in bug 1443316. Nathan, can you please fix it?
Flags: needinfo?(nfroyd)
Priority: -- → P3
Whiteboard: [necko-triaged]
Older versions of clang complain about this code, with:

netwerk/protocol/http/nsCORSListenerProxy.cpp:230:5: error: default initialization of an object of const type 'const struct CheckHeaderToken' without a user-provided default constructor

Later versions of the standard were amended to make this not an error,
but clang still warns.  Pacify clang by making the object not const.
Attachment #8958208 - Flags: review?(valentin.gosu)
Attachment #8958208 - Flags: review?(valentin.gosu) → review+
Pushed by nfroyd@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/fabb9cce9709
fix incorrect clang warning in nsCORSListenerProxy; r=valentin
Summary: error: default initialization of an object of const type 'const struct CheckHeaderToken' without a user-provided default constructor → error: default initialization of an object of const type 'const struct CheckHeaderToken' without a user-provided default constructor (nsCORSListenerProxy.cpp)
https://hg.mozilla.org/mozilla-central/rev/fabb9cce9709
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla61
Assignee: nobody → nfroyd
Flags: needinfo?(nfroyd)
[Tracking Requested - why for this release]:

Could we uplift this to beta? Since 60 is going to be ESR, it would be nice to avoid this build error there.
Flags: needinfo?(nfroyd)
Comment on attachment 8958208 [details] [diff] [review]
fix incorrect clang warning in nsCORSListenerProxy

(In reply to :Felipe Gomes (needinfo me!) from comment #7)
> [Tracking Requested - why for this release]:
> 
> Could we uplift this to beta? Since 60 is going to be ESR, it would be nice
> to avoid this build error there.

Sure, we could do that.

Approval Request Comment
[Feature/Bug causing the regression]: Bug 1443316
[User impact if declined]: None, strictly a packager/developer quality of life improvement.
[Is this code covered by automated tests?]: Yes.
[Has the fix been verified in Nightly?]: Yes?
[Needs manual test from QE? If yes, steps to reproduce]: No.
[List of other uplifts needed for the feature/fix]: None.
[Is the change risky?]: No.
[Why is the change risky/not risky?]: Just fixing a compiler warning for certain versions of clang.
[String changes made/needed]: None.
Flags: needinfo?(nfroyd)
Attachment #8958208 - Flags: approval-mozilla-beta?
Comment on attachment 8958208 [details] [diff] [review]
fix incorrect clang warning in nsCORSListenerProxy

I guess that's harmless enough.  beta60+
Attachment #8958208 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
(In reply to Nathan Froyd [:froydnj] from comment #8)
> [User impact if declined]: None, strictly a packager/developer quality of
> life improvement.
> [Is this code covered by automated tests?]: Yes.
> [Has the fix been verified in Nightly?]: Yes?
> [Needs manual test from QE? If yes, steps to reproduce]: No.

Setting qe-verify- based on Nathan's assessment on manual testing needs and the fact that this fix has automated coverage.
Flags: qe-verify-
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: