Last Comment Bug 623126 - Add constructor for nsDebugImpl, nsTraceRefcntImpl, EmptyEnumeratorImpl, and nsSimpleUnicharStreamFactory to placate CLang
: Add constructor for nsDebugImpl, nsTraceRefcntImpl, EmptyEnumeratorImpl, and ...
Status: RESOLVED FIXED
:
Product: Core
Classification: Components
Component: XPCOM (show other bugs)
: Trunk
: x86_64 Mac OS X
: -- normal (vote)
: ---
Assigned To: Rafael Ávila de Espíndola (:espindola) (not reading bugmail)
:
Mentors:
: 614789 645469 (view as bug list)
Depends on:
Blocks: clang
  Show dependency treegraph
 
Reported: 2011-01-04 20:11 PST by Rafael Ávila de Espíndola (:espindola) (not reading bugmail)
Modified: 2013-10-13 02:16 PDT (History)
11 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
patch (1.44 KB, patch)
2011-01-04 20:11 PST, Rafael Ávila de Espíndola (:espindola) (not reading bugmail)
benjamin: review+
Details | Diff | Review

Description Rafael Ávila de Espíndola (:espindola) (not reading bugmail) 2011-01-04 20:11:54 PST
Created attachment 501245 [details] [diff] [review]
patch

nsSimpleUnicharStreamFactory is missing a user defined constructor,
but in nsUnicharInputStream.cpp a const variable of this type is defined.

This is not valid c++. For more information see "Default initialization of
const variable of a class type requires user-defined default constructor" in
http://clang.llvm.org/compatibility.html#c++
Comment 1 timeless 2011-01-05 02:44:57 PST
The reporter's summary and initial comment were both lame. I'm merely adjusting
the summary and providing a better link. I am not passing judgement on the
quality of the bug report.

http://clang.llvm.org/compatibility.html#default_init_const
Comment 2 Benjamin Smedberg [:bsmedberg] 2011-01-05 05:54:24 PST
Just as with the other bug, the missing constructor is intentional so that GCC does not emit a initialization function. Absent a detailed explanation from a language lawyer, I don't think I want to accept this change.
Comment 3 Rafael Ávila de Espíndola (:espindola) (not reading bugmail) 2011-01-05 13:32:48 PST
Given the discussion on bug 623123, are you ok with it?
Comment 4 Benjamin Smedberg [:bsmedberg] 2011-02-22 07:57:50 PST
*** Bug 614789 has been marked as a duplicate of this bug. ***
Comment 5 :Ehsan Akhgari (busy, don't ask for review please) 2011-03-25 11:34:41 PDT
http://hg.mozilla.org/mozilla-central/rev/ca41c5663999
Comment 6 Mike Hommey [:glandium] 2011-04-30 02:35:11 PDT
*** Bug 645469 has been marked as a duplicate of this bug. ***
Comment 7 Jonathan Wakely 2011-04-30 04:12:10 PDT
(In reply to comment #2)
> Just as with the other bug, the missing constructor is intentional so that GCC
> does not emit a initialization function. Absent a detailed explanation from a
> language lawyer, I don't think I want to accept this change.

A bit late, but language lawyer here, see http://gcc.gnu.org/bugzilla/show_bug.cgi?id=44499#c2 for chapter and verse. As pointed out by some of the dups of this bug, GCC 4.6 rejects this too, see the note I added to http://gcc.gnu.org/gcc-4.6/changes.html#cplusplus
Comment 8 Jonathan Wakely 2011-05-03 04:41:10 PDT
I see that the commit adds empty user-defined constructors. Did anyone consider the alternative of adding an initializer instead, as I suggested in the GCC 4.6 changes and in Bug 645469 c5?
That might avoid emitting an initialization function.
Comment 9 Mike Hommey [:glandium] 2011-05-03 05:09:22 PDT
(In reply to comment #8)
> I see that the commit adds empty user-defined constructors. Did anyone consider
> the alternative of adding an initializer instead, as I suggested in the GCC 4.6
> changes and in Bug 645469 c5?
> That might avoid emitting an initialization function.

I don't think it makes any difference in the generated code.
Comment 10 Alex Vincent [:WeirdAl] 2011-05-24 21:07:23 PDT
requesting approval for mozilla-2.0 branch:  with Fedora 15, gcc 4.6.0, FF4 will not compile.  #developers pointed me to this bug.
Comment 11 Benjamin Smedberg [:bsmedberg] 2011-05-25 05:48:58 PDT
the 2.0 branch doesn't have any planned updates, what is the purpose of the nomination?
Comment 12 docbill+bugzilla@freeshell.org 2011-10-20 16:26:25 PDT
I wonder why this is marked as resolved fix?  In Fedora 15 it is still a problem, was the patch applied upstream and then not brought into Fedora?  I'm trying to rebuild sunbird, and this bug in xulrunner is breaking the sunbird build.  I just created an updated version of the xulrunner rpm using this patch to fix the problem, but if there is something upstream I can grab it is probably better to use that.

Note You need to log in before you can comment on or make changes to this bug.