Closed Bug 623116 Opened 9 years ago Closed 9 years ago
Add constructor for ns
ASCIICase Insensitive String Comparator (which inherits from ns String Comparator) to placate CLang
nsASCIICaseInsensitiveStringComparator is missing a user defined constructor, but in nsCSSRuleProcessor.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++
bugzilla doesn't linkify ++, and your link was poor anyway, http://clang.llvm.org/compatibility.html#default_init_const is I believe what you intended to reference.
OS: Mac OS X → Windows 7
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
Summary: Missing constructor → Add constructor for nsASCIICaseInsensitiveStringComparator (which inherits from nsStringComparator) to placate CLang
I'm far from a C++ language expert, but does that in fact apply? nsASCIICaseInsensitiveStringComparator is non-POD, since it has a base class.
Sorry for the lameness, but I had to open 13 silly bugs like this and with such an overhead copy and pasting becomes really tempting. The paragraph in question says: If no initializer is specified for an object, and the object is of (possibly cv-qualified) non-POD class type (or array thereof), the object shall be default-initialized; if the object is of const-qualified type, the underlying class type shall have a user-declared default constructor. Otherwise, if no initializer is specified for a non-static object, the object and its subobjects, if any, have an indeterminate initial; if the object or any of its subobjects are of const-qualified type, the program is ill-formed. So i think it applies because it is non-POD.
and it was not on windows
OS: Windows 7 → Mac OS X
Attachment #501232 - Flags: review?(smontagu) → review+
This patch along with the ones in bug #623123 , #623126 , #628371 also fixes compilation with gcc 4.6 , hats off to espindola, thanks!
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla2.2
You need to log in before you can comment on or make changes to this bug.