Closed Bug 1209227 Opened 4 years ago Closed 3 years ago

Apply MOZ_INHERIT_TYPE_ANNOTATIONS_FROM_TEMPLATE_ARGS to mozilla::Variant

Categories

(Core :: MFBT, defect)

defect
Not set

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+
https://hg.mozilla.org/mozilla-central/rev/ed89ff77c920
https://hg.mozilla.org/mozilla-central/rev/e12e09384b27
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla49
You need to log in before you can comment on or make changes to this bug.