Closed Bug 1209227 Opened 9 years ago Closed 9 years ago

Apply MOZ_INHERIT_TYPE_ANNOTATIONS_FROM_TEMPLATE_ARGS to mozilla::Variant

Categories

(Core :: MFBT, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla49
Tracking Status
firefox44 --- affected
firefox49 --- fixed

People

(Reporter: jld, Assigned: nika)

References

Details

Attachments

(2 files, 1 obsolete file)

mozilla::Variant uses mozilla::AlignedStorage with the largest size of the possible types, rather than a union of AlignedStorage2 like the IPDL compiler currently does (also, mozilla::Maybe), so it won't inherit static analysis annotations. It ought to Just Work to apply MOZ_INHERIT_TYPE_ANNOTATIONS_FROM_TEMPLATE_ARGS to the class, but this should be tested.
MOZ_INHERIT_TYPE_ANNOTATIONS_FROM_TEMPLATE_ARGS should work with variable arg counts, but it would still be good to check, because I'm not sure how clang interacts with `typename... Ts`, There's a chance that that entire block of substitutions appears as a single item in the AST or something. It would be super awesome if we could add a test for stuff like that to TestInheritTypeAnnotationsFromTemplateArgs.cpp, so that it doesn't get broken in the future.
I've done some testing - and MOZ_INHERIT_TYPE_ANNOTATIONS_FROM_TEMPLATE_ARGS doesn't play well with pack expansions. I'll have to modify the clang plugin to take them into account before we can do this.
Assignee: nobody → michael
Attachment #8667406 - Flags: review?(nfroyd) → review+
I'm avoiding using std::function under the assumption that that is what the linux failure was compalaining about. try: https://treeherder.mozilla.org/#/jobs?repo=try&revision=979617bb3e97
Attachment #8667405 - Attachment is obsolete: true
Attachment #8667405 - Flags: review?(ehsan)
Attachment #8667949 - Flags: review?(ehsan)
Attachment #8667949 - Flags: review?(ehsan) → review+
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla49
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: