Closed Bug 1137583 Opened 8 years ago Closed 8 years ago

mozilla::IsPointer does not work on CV-qualified pointers like std::is_pointer

Categories

(Core :: MFBT, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla39
Tracking Status
firefox39 --- fixed

People

(Reporter: mozbugz, Assigned: mozbugz)

References

Details

Attachments

(1 file, 1 obsolete file)

Spawned from bug 1131445 comment 12.

Reading the standard, 20.9.4.1-2 (related to std::is_pointer and other primary type categories):

"""
For any given type T, the result of applying one of these templates to T and to cv-qualified T shall yield the same result.
"""

The current implementation of mozilla:IsPointer doesn't match std::is_pointer.
Blocks: 1131445
Assignee: nobody → from_mozilla
Attached patch 1137583-IsCVPointer.patch (obsolete) — Splinter Review
Fix for IsPointer to work with CV-qualified pointers.
Added tests.
Attachment #8570841 - Flags: review?(jwalden+bmo)
Comment on attachment 8570841 [details] [diff] [review]
1137583-IsCVPointer.patch

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

Looks good with the ordering fix.  No need for me to review that, just post a new version of the patch with that change made to it and flag it for checkin the usual way.  (Probably best if someone else does it than me -- I usually do for patches I review, but my queue is not in great shape to land things very soon right now.)

::: mfbt/tests/TestTypeTraits.cpp
@@ +8,5 @@
>  #include "mozilla/TypeTraits.h"
>  
>  using mozilla::AddLvalueReference;
>  using mozilla::IsArray;
> +using mozilla::IsPointer;

Actually, on second look -- move this down after |using mozilla::IsLvalueRference;| to preserve alphabetical order.
Attachment #8570841 - Flags: review?(jwalden+bmo) → review+
https://treeherder.mozilla.org/#/jobs?repo=try&revision=b88981f9e32c
Status: UNCONFIRMED → ASSIGNED
Ever confirmed: true
Keywords: checkin-needed
Keywords: checkin-needed
Changes as recommended (cosmetic only).
Attachment #8570841 - Attachment is obsolete: true
Keywords: checkin-needed
https://hg.mozilla.org/mozilla-central/rev/1c64893b5fdd
Status: ASSIGNED → RESOLVED
Closed: 8 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla39
You need to log in before you can comment on or make changes to this bug.