Closed Bug 812531 Opened 12 years ago Closed 12 years ago

Uses of TYPE_SPECIFIC_SCOPED_POINTER_TEMPLATE break when compiled with Clang

Categories

(Core :: MFBT, defect, P1)

defect

Tracking

()

RESOLVED FIXED
mozilla20
blocking-basecamp +
Tracking Status
firefox18 --- fixed
firefox19 --- fixed

People

(Reporter: briansmith, Assigned: briansmith)

References

Details

Attachments

(1 file)

+++ This bug was initially created as a clone of Bug #767240 +++

Clang strictly enforces the C++ rules for two-phase name lookup in templates, and TYPE_SPECIFIC_SCOPED_POINTER_TEMPLATE violates the rules.

This is blocking a P1 basecamp blocker.
Attachment #682490 - Flags: review?(jwalden+bmo)
Comment on attachment 682490 [details] [diff] [review]
Make MOZ_TYPE_SPECIFIC_SCOPED_POINTER_TEMPLATE comply with two-phase template name lookup rules, as clang requires

r=khuey
Attachment #682490 - Flags: review?(jwalden+bmo) → review+
Necessary for app signing (bug 772365).
blocking-basecamp: --- → +
Would you care to explain what the issue is this actually fixes?  I have too little time these days, but if I'd been able to get to this in time I'd probably just have rubberstamped it, without understanding exactly what makes it necessary in conformant compilers.
Jeff, it is basically an instance of this problem:
http://blog.llvm.org/2009/12/dreaded-two-phase-name-lookup.html.

clang will refuse to compile the TypeSpecificScopedPointerTraits::release template because TypeSpecificDelete wasn't declared before the definition of the template.

I did not notice the problem before because I had not actually checked in any uses of the template, and I'd only tested uses of the template on Windows.
Ah, that makes a lot of sense.  Thanks for the pointer!
Comment on attachment 682490 [details] [diff] [review]
Make MOZ_TYPE_SPECIFIC_SCOPED_POINTER_TEMPLATE comply with two-phase template name lookup rules, as clang requires

https://hg.mozilla.org/integration/mozilla-inbound/rev/1ca9218271b9

[Approval Request Comment]
User impact if declined: Prerequisite of packaged app support for B2G
Risk to taking this patch (and alternatives if risky): None.
String or UUID changes made by this patch: None
Attachment #682490 - Flags: approval-mozilla-beta?
Attachment #682490 - Flags: approval-mozilla-aurora?
https://hg.mozilla.org/mozilla-central/rev/1ca9218271b9
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: mozilla19 → mozilla20
Comment on attachment 682490 [details] [diff] [review]
Make MOZ_TYPE_SPECIFIC_SCOPED_POINTER_TEMPLATE comply with two-phase template name lookup rules, as clang requires

Approval isn't currently required to uplift bb+ bugs.
Attachment #682490 - Flags: approval-mozilla-beta?
Attachment #682490 - Flags: approval-mozilla-aurora?
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: