mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-05 05:30:29 +00:00
Bug 525063 - add attribute to mark member variables that should be skipped by clang plugin initialization checker. r=nfroyd
MozReview-Commit-ID: 4V1YcK2thiF
This commit is contained in:
parent
4616a049e9
commit
12bac0f757
@ -527,6 +527,12 @@
|
||||
* declarations where an instance of the template should be considered, for
|
||||
* static analysis purposes, to inherit any type annotations (such as
|
||||
* MOZ_MUST_USE_TYPE and MOZ_STACK_CLASS) from its template arguments.
|
||||
* MOZ_IGNORE_INITIALIZATION: Applies to class member declarations. Occasionally
|
||||
* there are class members that are not initialized in the constructor, but logic
|
||||
* elsewhere in the class ensures they are initialized prior to use. Using this
|
||||
* attribute on a member disables the check that this member must be initialized
|
||||
* in constructors via list-initialization, in the constructor body, or via functions
|
||||
* called from the constructor body.
|
||||
* MOZ_NON_AUTOABLE: Applies to class declarations. Makes it a compile time error to
|
||||
* use `auto` in place of this type in variable declarations. This is intended to
|
||||
* be used with types which are intended to be implicitly constructed into other
|
||||
@ -560,6 +566,8 @@
|
||||
# define MOZ_INHERIT_TYPE_ANNOTATIONS_FROM_TEMPLATE_ARGS \
|
||||
__attribute__((annotate("moz_inherit_type_annotations_from_template_args")))
|
||||
# define MOZ_NON_AUTOABLE __attribute__((annotate("moz_non_autoable")))
|
||||
# define MOZ_INITIALIZED_OUTSIDE_CONSTRUCTOR \
|
||||
__attribute__((annotate("moz_ignore_ctor_initialization")))
|
||||
/*
|
||||
* It turns out that clang doesn't like void func() __attribute__ {} without a
|
||||
* warning, so use pragmas to disable the warning. This code won't work on GCC
|
||||
@ -591,6 +599,7 @@
|
||||
# define MOZ_NEEDS_MEMMOVABLE_TYPE /* nothing */
|
||||
# define MOZ_NEEDS_MEMMOVABLE_MEMBERS /* nothing */
|
||||
# define MOZ_INHERIT_TYPE_ANNOTATIONS_FROM_TEMPLATE_ARGS /* nothing */
|
||||
# define MOZ_INITIALIZED_OUTSIDE_CONSTRUCTOR /* nothing */
|
||||
# define MOZ_NON_AUTOABLE /* nothing */
|
||||
#endif /* MOZ_CLANG_PLUGIN */
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user