Skip to content
Snippets Groups Projects
DiagnosticsReference.rst 897 KiB
Newer Older
..
  -------------------------------------------------------------------
  NOTE: This file is automatically generated by running clang-tblgen
  -gen-diag-docs. Do not edit this file by hand!!
  -------------------------------------------------------------------

.. Add custom CSS to output. FIXME: This should be put into <head> rather
   than the start of <body>.
.. raw:: html

    <style>
    table.docutils {
      width: 1px;
    }
    table.docutils td {
      border: none;
      vertical-align: middle;
      white-space: nowrap;
      width: 1px;
    }
    table.docutils tr + tr {
      border-top: 0.2em solid #aaa;
    }
    .error {
      font-family: monospace;
      font-weight: bold;
    }
    .warning {
      font-family: monospace;
      font-weight: bold;
    }
    .remark {
      font-family: monospace;
      font-weight: bold;
      color: #00c;
    }
    .diagtext {
      font-family: monospace;
      font-weight: bold;
    }
    </style>

.. FIXME: rST doesn't support formatting this, so we format all <td> elements
          as monospace font face instead.
.. |nbsp| unicode:: 0xA0
   :trim:

.. Roles generated by clang-tblgen.
.. role:: error
.. role:: warning
.. role:: remark
.. role:: diagtext
.. role:: placeholder(emphasis)

=========================
Diagnostic flags in Clang
=========================
.. contents::
   :local:

Introduction
============

This page lists the diagnostic flags currently supported by Clang.

Diagnostic flags
================

-W
--
Synonym for `-Wextra`_.


-W#pragma-messages
------------------
This diagnostic is enabled by default.

**Diagnostic text:**

The text of this diagnostic is not controlled by Clang.


-W#warnings
-----------
This diagnostic is enabled by default.

**Diagnostic text:**

The text of this diagnostic is not controlled by Clang.


-WCFString-literal
------------------
This diagnostic is enabled by default.

**Diagnostic text:**

+------------------------------------------------------------------------------------------------------------------------------------+
|:warning:`warning:` |nbsp| :diagtext:`input conversion stopped due to an input byte that does not belong to the input codeset UTF-8`|
+------------------------------------------------------------------------------------------------------------------------------------+


-WCL4
-----
Some of the diagnostics controlled by this flag are enabled by default.

Controls `-Wall`_, `-Wextra`_.


-WIndependentClass-attribute
----------------------------
This diagnostic is enabled by default.

**Diagnostic text:**

+------------------------------------------------------------------------------------------------------------------------------+
|:warning:`warning:` |nbsp| :diagtext:`'objc\_independent\_class' attribute may be put on a typedef only; attribute is ignored`|
+------------------------------------------------------------------------------------------------------------------------------+

+----------------------------------------------------------------------------------------------------------------------------------------------------+
|:warning:`warning:` |nbsp| :diagtext:`'objc\_independent\_class' attribute may be put on Objective-C object pointer type only; attribute is ignored`|
+----------------------------------------------------------------------------------------------------------------------------------------------------+


-WNSObject-attribute
--------------------
This diagnostic is enabled by default.

**Diagnostic text:**

+--------------------------------------------------------------------------------------------------------------+
|:warning:`warning:` |nbsp| :diagtext:`'NSObject' attribute may be put on a typedef only; attribute is ignored`|
+--------------------------------------------------------------------------------------------------------------+


-Wabi
-----
This diagnostic flag exists for GCC compatibility, and has no effect in Clang.

-Wabsolute-value
----------------
This diagnostic is enabled by default.

**Diagnostic text:**

+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|:warning:`warning:` |nbsp| :diagtext:`absolute value function` |nbsp| :placeholder:`A` |nbsp| :diagtext:`given an argument of type` |nbsp| :placeholder:`B` |nbsp| :diagtext:`but has parameter of type` |nbsp| :placeholder:`C` |nbsp| :diagtext:`which may cause truncation of value`|
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+

+---------------------------------------------------------------------------+----------------------+---------------------------------------------------------------------------------+
|:warning:`warning:` |nbsp| :diagtext:`taking the absolute value of` |nbsp| |+--------------------+| |nbsp| :diagtext:`type` |nbsp| :placeholder:`B` |nbsp| :diagtext:`is suspicious`|
|                                                                           ||:diagtext:`pointer` ||                                                                                 |
|                                                                           |+--------------------+|                                                                                 |
|                                                                           ||:diagtext:`function`||                                                                                 |
|                                                                           |+--------------------+|                                                                                 |
|                                                                           ||:diagtext:`array`   ||                                                                                 |
|                                                                           |+--------------------+|                                                                                 |
+---------------------------------------------------------------------------+----------------------+---------------------------------------------------------------------------------+

+------------------------------------------------------------------------------------------------------------------------------------------+
|:warning:`warning:` |nbsp| :diagtext:`taking the absolute value of unsigned type` |nbsp| :placeholder:`A` |nbsp| :diagtext:`has no effect`|
+------------------------------------------------------------------------------------------------------------------------------------------+

+----------------------------------------------------+----------------------------+------------------------------------------------------------------------------------------------------------------+----------------------------+------------------------+
|:warning:`warning:` |nbsp| :diagtext:`using` |nbsp| |+--------------------------+| |nbsp| :diagtext:`absolute value function` |nbsp| :placeholder:`A` |nbsp| :diagtext:`when argument is of` |nbsp| |+--------------------------+| |nbsp| :diagtext:`type`|
|                                                    ||:diagtext:`integer`       ||                                                                                                                  ||:diagtext:`integer`       ||                        |
|                                                    |+--------------------------+|                                                                                                                  |+--------------------------+|                        |
|                                                    ||:diagtext:`floating point`||                                                                                                                  ||:diagtext:`floating point`||                        |
|                                                    |+--------------------------+|                                                                                                                  |+--------------------------+|                        |
|                                                    ||:diagtext:`complex`       ||                                                                                                                  ||:diagtext:`complex`       ||                        |
|                                                    |+--------------------------+|                                                                                                                  |+--------------------------+|                        |
+----------------------------------------------------+----------------------------+------------------------------------------------------------------------------------------------------------------+----------------------------+------------------------+


-Wabstract-final-class
----------------------
This diagnostic is enabled by default.

**Diagnostic text:**

+-----------------------------------------------------------------+--------------------+-------------+
|:warning:`warning:` |nbsp| :diagtext:`abstract class is marked '`|+------------------+|:diagtext:`'`|
|                                                                 ||:diagtext:`final` ||             |
|                                                                 |+------------------+|             |
|                                                                 ||:diagtext:`sealed`||             |
|                                                                 |+------------------+|             |
+-----------------------------------------------------------------+--------------------+-------------+


-Wabstract-vbase-init
---------------------
**Diagnostic text:**

+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|:warning:`warning:` |nbsp| :diagtext:`initializer for virtual base class` |nbsp| :placeholder:`A` |nbsp| :diagtext:`of abstract class` |nbsp| :placeholder:`B` |nbsp| :diagtext:`will never be used`|
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+


-Waddress
---------
This diagnostic is enabled by default.

Controls `-Wpointer-bool-conversion`_, `-Wstring-compare`_, `-Wtautological-pointer-compare`_.


-Waddress-of-array-temporary
----------------------------
This diagnostic is enabled by default.

**Diagnostic text:**

+---------------------------------------------------------------------------------------------------------------------------------------------+
|:warning:`warning:` |nbsp| :diagtext:`pointer is initialized by a temporary array, which will be destroyed at the end of the full-expression`|
+---------------------------------------------------------------------------------------------------------------------------------------------+


-Waddress-of-packed-member
--------------------------
This diagnostic is enabled by default.

**Diagnostic text:**

+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|:warning:`warning:` |nbsp| :diagtext:`taking address of packed member` |nbsp| :placeholder:`A` |nbsp| :diagtext:`of class or structure` |nbsp| :placeholder:`B` |nbsp| :diagtext:`may result in an unaligned pointer value`|
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+


-Waddress-of-temporary
----------------------
This diagnostic is an error by default, but the flag ``-Wno-address-of-temporary`` can be used to disable the error.

**Diagnostic text:**

+-----------------------------------------------------------------------------------------------------------+
|:error:`error:` |nbsp| :diagtext:`taking the address of a temporary object of type` |nbsp| :placeholder:`A`|
+-----------------------------------------------------------------------------------------------------------+


-Waggregate-return
------------------
This diagnostic flag exists for GCC compatibility, and has no effect in Clang.

-Wall
-----
Some of the diagnostics controlled by this flag are enabled by default.

Controls `-Wmost`_, `-Wparentheses`_, `-Wswitch`_, `-Wswitch-bool`_.


-Walloca-with-align-alignof
---------------------------
This diagnostic is enabled by default.

**Diagnostic text:**

+--------------------------------------------------------------------------------------------------------------------+
|:warning:`warning:` |nbsp| :diagtext:`second argument to \_\_builtin\_alloca\_with\_align is supposed to be in bits`|
+--------------------------------------------------------------------------------------------------------------------+


-Wambiguous-delete
------------------
This diagnostic is enabled by default.

**Diagnostic text:**

+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|:warning:`warning:` |nbsp| :diagtext:`multiple suitable` |nbsp| :placeholder:`A` |nbsp| :diagtext:`functions for` |nbsp| :placeholder:`B`:diagtext:`; no 'operator delete' function will be invoked if initialization throws an exception`|
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+


-Wambiguous-ellipsis
--------------------
This diagnostic is enabled by default.

**Diagnostic text:**

+------------------------------------------------------------------------------------------------+---------------------------------------------+
|:warning:`warning:` |nbsp| :diagtext:`'...' in this location creates a C-style varargs function`|+-------------------------------------------+|
|                                                                                                ||:diagtext:`, not a function parameter pack`||
|                                                                                                |+-------------------------------------------+|
|                                                                                                ||                                           ||
|                                                                                                |+-------------------------------------------+|
+------------------------------------------------------------------------------------------------+---------------------------------------------+


-Wambiguous-macro
-----------------
This diagnostic is enabled by default.

**Diagnostic text:**

+-------------------------------------------------------------------------------------------+
|:warning:`warning:` |nbsp| :diagtext:`ambiguous expansion of macro` |nbsp| :placeholder:`A`|
+-------------------------------------------------------------------------------------------+


-Wambiguous-member-template
---------------------------
This diagnostic is enabled by default.

**Diagnostic text:**

+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|:warning:`warning:` |nbsp| :diagtext:`lookup of` |nbsp| :placeholder:`A` |nbsp| :diagtext:`in member access expression is ambiguous; using member of` |nbsp| :placeholder:`B`|
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------+


-Wanalyzer-incompatible-plugin
------------------------------
This diagnostic is enabled by default.

**Diagnostic text:**

+----------------------------------------------------------------------------------------------------------------------------------------+
|:warning:`warning:` |nbsp| :diagtext:`checker plugin '`:placeholder:`A`:diagtext:`' is not compatible with this version of the analyzer`|
+----------------------------------------------------------------------------------------------------------------------------------------+


-Wanonymous-pack-parens
-----------------------
This diagnostic is enabled by default.

**Diagnostic text:**

+---------------------------------------------------------------------------------------------------------+
|:warning:`warning:` |nbsp| :diagtext:`ISO C++11 requires a parenthesized pack declaration to have a name`|
+---------------------------------------------------------------------------------------------------------+


-Warc
-----
This diagnostic is enabled by default.

Controls `-Warc-non-pod-memaccess`_, `-Warc-retain-cycles`_, `-Warc-unsafe-retained-assign`_.


-Warc-bridge-casts-disallowed-in-nonarc
---------------------------------------
This diagnostic is enabled by default.

**Diagnostic text:**

+-------------------------------------------------------------------------------------------------------------+
|:warning:`warning:` |nbsp| :diagtext:`'`:placeholder:`A`:diagtext:`' casts have no effect when not using ARC`|
+-------------------------------------------------------------------------------------------------------------+


-Warc-maybe-repeated-use-of-weak
--------------------------------
**Diagnostic text:**

+---------------------------------------------------+-------------------------------+------------------------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------------------------------------------+
|:warning:`warning:` |nbsp| :diagtext:`weak` |nbsp| |+-----------------------------+| |nbsp| :placeholder:`B` |nbsp| :diagtext:`may be accessed multiple times in this` |nbsp| |+--------------------+| |nbsp| :diagtext:`and may be unpredictably set to nil; assign to a strong variable to keep the object alive`|
|                                                   ||:diagtext:`variable`         ||                                                                                          ||:diagtext:`function`||                                                                                                             |
|                                                   |+-----------------------------+|                                                                                          |+--------------------+|                                                                                                             |
|                                                   ||:diagtext:`property`         ||                                                                                          ||:diagtext:`method`  ||                                                                                                             |
|                                                   |+-----------------------------+|                                                                                          |+--------------------+|                                                                                                             |
|                                                   ||:diagtext:`implicit property`||                                                                                          ||:diagtext:`block`   ||                                                                                                             |
|                                                   |+-----------------------------+|                                                                                          |+--------------------+|                                                                                                             |
|                                                   ||:diagtext:`instance variable`||                                                                                          ||:diagtext:`lambda`  ||                                                                                                             |
|                                                   |+-----------------------------+|                                                                                          |+--------------------+|                                                                                                             |
+---------------------------------------------------+-------------------------------+------------------------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------------------------------------------+


-Warc-non-pod-memaccess
-----------------------
This diagnostic is enabled by default.

**Diagnostic text:**

+---------------------------+-----------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+
|:warning:`warning:` |nbsp| |+---------------------------+| |nbsp| :diagtext:`this` |nbsp| :placeholder:`B` |nbsp| :diagtext:`call is a pointer to ownership-qualified type` |nbsp| :placeholder:`C`|
|                           ||:diagtext:`destination for`||                                                                                                                                         |
|                           |+---------------------------+|                                                                                                                                         |
|                           ||:diagtext:`source of`      ||                                                                                                                                         |
|                           |+---------------------------+|                                                                                                                                         |
+---------------------------+-----------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+


-Warc-performSelector-leaks
---------------------------
This diagnostic is enabled by default.

**Diagnostic text:**

+-------------------------------------------------------------------------------------------------------+
|:warning:`warning:` |nbsp| :diagtext:`performSelector may cause a leak because its selector is unknown`|
+-------------------------------------------------------------------------------------------------------+


-Warc-repeated-use-of-weak
--------------------------
Also controls `-Warc-maybe-repeated-use-of-weak`_.

**Diagnostic text:**

+---------------------------------------------------+-------------------------------+--------------------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------------------------------------------+
|:warning:`warning:` |nbsp| :diagtext:`weak` |nbsp| |+-----------------------------+| |nbsp| :placeholder:`B` |nbsp| :diagtext:`is accessed multiple times in this` |nbsp| |+--------------------+| |nbsp| :diagtext:`but may be unpredictably set to nil; assign to a strong variable to keep the object alive`|
|                                                   ||:diagtext:`variable`         ||                                                                                      ||:diagtext:`function`||                                                                                                             |
|                                                   |+-----------------------------+|                                                                                      |+--------------------+|                                                                                                             |
|                                                   ||:diagtext:`property`         ||                                                                                      ||:diagtext:`method`  ||                                                                                                             |
|                                                   |+-----------------------------+|                                                                                      |+--------------------+|                                                                                                             |
|                                                   ||:diagtext:`implicit property`||                                                                                      ||:diagtext:`block`   ||                                                                                                             |
|                                                   |+-----------------------------+|                                                                                      |+--------------------+|                                                                                                             |
|                                                   ||:diagtext:`instance variable`||                                                                                      ||:diagtext:`lambda`  ||                                                                                                             |
|                                                   |+-----------------------------+|                                                                                      |+--------------------+|                                                                                                             |
+---------------------------------------------------+-------------------------------+--------------------------------------------------------------------------------------+----------------------+-------------------------------------------------------------------------------------------------------------+


-Warc-retain-cycles
-------------------
This diagnostic is enabled by default.

**Diagnostic text:**

+------------------------------------------------------------------------------------------------------------------------------------------------------+
|:warning:`warning:` |nbsp| :diagtext:`capturing` |nbsp| :placeholder:`A` |nbsp| :diagtext:`strongly in this block is likely to lead to a retain cycle`|
+------------------------------------------------------------------------------------------------------------------------------------------------------+


-Warc-unsafe-retained-assign
----------------------------
This diagnostic is enabled by default.

**Diagnostic text:**

+--------------------------------------------------------+---------------------------------+-------------------------------------+----------------------+------------------------------------------------------+
|:warning:`warning:` |nbsp| :diagtext:`assigning` |nbsp| |+-------------------------------+| |nbsp| :diagtext:`to a weak` |nbsp| |+--------------------+|:diagtext:`; object will be released after assignment`|
|                                                        ||:diagtext:`array literal`      ||                                     ||:diagtext:`property`||                                                      |
|                                                        |+-------------------------------+|                                     |+--------------------+|                                                      |
|                                                        ||:diagtext:`dictionary literal` ||                                     ||:diagtext:`variable`||                                                      |
|                                                        |+-------------------------------+|                                     |+--------------------+|                                                      |
|                                                        ||:diagtext:`numeric literal`    ||                                     |                      |                                                      |
|                                                        |+-------------------------------+|                                     |                      |                                                      |
|                                                        ||:diagtext:`boxed expression`   ||                                     |                      |                                                      |
|                                                        |+-------------------------------+|                                     |                      |                                                      |
|                                                        ||:diagtext:`<should not happen>`||                                     |                      |                                                      |
|                                                        |+-------------------------------+|                                     |                      |                                                      |
|                                                        ||:diagtext:`block literal`      ||                                     |                      |                                                      |
|                                                        |+-------------------------------+|                                     |                      |                                                      |
+--------------------------------------------------------+---------------------------------+-------------------------------------+----------------------+------------------------------------------------------+

+---------------------------------------------------------------------------+--------------------------------+--------+----------------------+------------------------------------------------------+
|:warning:`warning:` |nbsp| :diagtext:`assigning retained object to` |nbsp| |+------------------------------+| |nbsp| |+--------------------+|:diagtext:`; object will be released after assignment`|
|                                                                           ||:diagtext:`weak`              ||        ||:diagtext:`property`||                                                      |
|                                                                           |+------------------------------+|        |+--------------------+|                                                      |
|                                                                           ||:diagtext:`unsafe\_unretained`||        ||:diagtext:`variable`||                                                      |
|                                                                           |+------------------------------+|        |+--------------------+|                                                      |
+---------------------------------------------------------------------------+--------------------------------+--------+----------------------+------------------------------------------------------+

+-----------------------------------------------------------------------------------------------------------------------------+
|:warning:`warning:` |nbsp| :diagtext:`assigning retained object to unsafe property; object will be released after assignment`|
+-----------------------------------------------------------------------------------------------------------------------------+


-Warray-bounds
--------------
This diagnostic is enabled by default.

**Diagnostic text:**

+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------+-------------+
|:warning:`warning:` |nbsp| :diagtext:`array index` |nbsp| :placeholder:`A` |nbsp| :diagtext:`is past the end of the array (which contains` |nbsp| :placeholder:`B` |nbsp| :diagtext:`element`|+-------------+|:diagtext:`)`|
|                                                                                                                                                                                             ||             ||             |
|                                                                                                                                                                                             |+-------------+|             |
|                                                                                                                                                                                             ||:diagtext:`s`||             |
|                                                                                                                                                                                             |+-------------+|             |
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------+-------------+

+----------------------------------------------------------------------------------------------------------------------------------+
|:warning:`warning:` |nbsp| :diagtext:`array index` |nbsp| :placeholder:`A` |nbsp| :diagtext:`is before the beginning of the array`|
+----------------------------------------------------------------------------------------------------------------------------------+

+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|:warning:`warning:` |nbsp| :diagtext:`array argument is too small; contains` |nbsp| :placeholder:`A` |nbsp| :diagtext:`elements, callee requires at least` |nbsp| :placeholder:`B`|
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+

+-----------------------------------------------------------------------------------+
|:warning:`warning:` |nbsp| :diagtext:`'static' has no effect on zero-length arrays`|
+-----------------------------------------------------------------------------------+


-Warray-bounds-pointer-arithmetic
---------------------------------
**Diagnostic text:**

+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------+-------------+
|:warning:`warning:` |nbsp| :diagtext:`the pointer incremented by` |nbsp| :placeholder:`A` |nbsp| :diagtext:`refers past the end of the array (that contains` |nbsp| :placeholder:`B` |nbsp| :diagtext:`element`|+-------------+|:diagtext:`)`|
|                                                                                                                                                                                                               ||             ||             |
|                                                                                                                                                                                                               |+-------------+|             |
|                                                                                                                                                                                                               ||:diagtext:`s`||             |
|                                                                                                                                                                                                               |+-------------+|             |
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------+-------------+

+-----------------------------------------------------------------------------------------------------------------------------------------------------+
|:warning:`warning:` |nbsp| :diagtext:`the pointer decremented by` |nbsp| :placeholder:`A` |nbsp| :diagtext:`refers before the beginning of the array`|
+-----------------------------------------------------------------------------------------------------------------------------------------------------+


-Wasm
-----
This diagnostic is enabled by default.

Controls `-Wasm-ignored-qualifier`_, `-Wasm-operand-widths`_.


-Wasm-ignored-qualifier
-----------------------
This diagnostic is enabled by default.

**Diagnostic text:**

+----------------------------------------------------------------------------------------------------------+
|:warning:`warning:` |nbsp| :diagtext:`ignored` |nbsp| :placeholder:`A` |nbsp| :diagtext:`qualifier on asm`|
+----------------------------------------------------------------------------------------------------------+

+-------------------------------------------------------------------------------------+
|:warning:`warning:` |nbsp| :diagtext:`meaningless 'volatile' on asm outside function`|
+-------------------------------------------------------------------------------------+


-Wasm-operand-widths
--------------------
This diagnostic is enabled by default.

**Diagnostic text:**

+-----------------------------------------------------------------------------------------------------------------------+
|:warning:`warning:` |nbsp| :diagtext:`value size does not match register size specified by the constraint and modifier`|
+-----------------------------------------------------------------------------------------------------------------------+


-Wassign-enum
-------------
**Diagnostic text:**

+---------------------------------------------------------------------------------------------------------------+
|:warning:`warning:` |nbsp| :diagtext:`integer constant not in range of enumerated type` |nbsp| :placeholder:`A`|
+---------------------------------------------------------------------------------------------------------------+


-Wassume
--------
This diagnostic is enabled by default.

**Diagnostic text:**

+-----------------------------------------------------------------------------------------------------------------------------------------+
|:warning:`warning:` |nbsp| :diagtext:`the argument to` |nbsp| :placeholder:`A` |nbsp| :diagtext:`has side effects that will be discarded`|
+-----------------------------------------------------------------------------------------------------------------------------------------+


-Wat-protocol
-------------
This diagnostic is enabled by default.

**Diagnostic text:**

+-------------------------------------------------------------------------------------------------------------------+
|:warning:`warning:` |nbsp| :diagtext:`@protocol is using a forward protocol declaration of` |nbsp| :placeholder:`A`|
+-------------------------------------------------------------------------------------------------------------------+


-Watomic-memory-ordering
------------------------
This diagnostic is enabled by default.

**Diagnostic text:**

+-------------------------------------------------------------------------------------------+
|:warning:`warning:` |nbsp| :diagtext:`memory order argument to atomic operation is invalid`|
+-------------------------------------------------------------------------------------------+


-Watomic-properties
-------------------
Controls `-Wcustom-atomic-properties`_, `-Wimplicit-atomic-properties`_.


-Watomic-property-with-user-defined-accessor
--------------------------------------------
This diagnostic is enabled by default.

**Diagnostic text:**

+--------------------------------------------------------------------------------------------------------------------------------------------+--------------------+-----------------------------------------------+--------------------+
|:warning:`warning:` |nbsp| :diagtext:`writable atomic property` |nbsp| :placeholder:`A` |nbsp| :diagtext:`cannot pair a synthesized` |nbsp| |+------------------+| |nbsp| :diagtext:`with a user defined` |nbsp| |+------------------+|
|                                                                                                                                            ||:diagtext:`getter`||                                               ||:diagtext:`getter`||
|                                                                                                                                            |+------------------+|                                               |+------------------+|
|                                                                                                                                            ||:diagtext:`setter`||                                               ||:diagtext:`setter`||
|                                                                                                                                            |+------------------+|                                               |+------------------+|
+--------------------------------------------------------------------------------------------------------------------------------------------+--------------------+-----------------------------------------------+--------------------+


-Wattribute-packed-for-bitfield
-------------------------------
This diagnostic is enabled by default.

**Diagnostic text:**

+-------------------------------------------------------------------------------------------------------------------------------------------------+
|:warning:`warning:` |nbsp| :diagtext:`'packed' attribute was ignored on bit-fields with single-byte alignment in older versions of GCC and Clang`|
+-------------------------------------------------------------------------------------------------------------------------------------------------+


-Wattributes
------------
This diagnostic is enabled by default.

Controls `-Wignored-attributes`_, `-Wunknown-attributes`_.


-Wauto-disable-vptr-sanitizer
-----------------------------
This diagnostic is enabled by default.

**Diagnostic text:**

+------------------------------------------------------------------------------------------------------+
|:warning:`warning:` |nbsp| :diagtext:`implicitly disabling vptr sanitizer because rtti wasn't enabled`|
+------------------------------------------------------------------------------------------------------+


-Wauto-import
-------------
**Diagnostic text:**

+-------------------------------------------------+---------------------------------+-------------------------------------------------------------------------+
|:warning:`warning:` |nbsp| :diagtext:`treating #`|+-------------------------------+| |nbsp| :diagtext:`as an import of module '`:placeholder:`B`:diagtext:`'`|
|                                                 ||:diagtext:`include`            ||                                                                         |
|                                                 |+-------------------------------+|                                                                         |
|                                                 ||:diagtext:`import`             ||                                                                         |
|                                                 |+-------------------------------+|                                                                         |
|                                                 ||:diagtext:`include\_next`      ||                                                                         |
|                                                 |+-------------------------------+|                                                                         |
|                                                 ||:diagtext:`\_\_include\_macros`||                                                                         |
|                                                 |+-------------------------------+|                                                                         |
+-------------------------------------------------+---------------------------------+-------------------------------------------------------------------------+


-Wauto-storage-class
--------------------
This diagnostic is enabled by default.

**Diagnostic text:**

+---------------------------------------------------------------------------------------------------------------------------------------------+
|:warning:`warning:` |nbsp| :diagtext:`'auto' storage class specifier is not permitted in C++11, and will not be supported in future releases`|
+---------------------------------------------------------------------------------------------------------------------------------------------+


-Wauto-var-id
-------------
This diagnostic is enabled by default.

**Diagnostic text:**

+-------------------------------------------------------------------------------------------------------+
|:warning:`warning:` |nbsp| :diagtext:`'auto' deduced as 'id' in declaration of` |nbsp| :placeholder:`A`|
+-------------------------------------------------------------------------------------------------------+


-Wavailability
--------------
This diagnostic is enabled by default.

**Diagnostic text:**

+--------------------------------------------------------------------------------------------------------------+
|:warning:`warning:` |nbsp| :diagtext:`'unavailable' availability overrides all other availability information`|
+--------------------------------------------------------------------------------------------------------------+

+------------------------------------------------------------------------------------------------------------------------+
|:warning:`warning:` |nbsp| :diagtext:`unknown platform` |nbsp| :placeholder:`A` |nbsp| :diagtext:`in availability macro`|
+------------------------------------------------------------------------------------------------------------------------+

+----------------------------------------------------------------+------------------------+------------------------------------------------------------------------------------------------------------------------------------------+------------------------+-------------------------------------------------------------------------------------+
|:warning:`warning:` |nbsp| :diagtext:`feature cannot be` |nbsp| |+----------------------+| |nbsp| :diagtext:`in` |nbsp| :placeholder:`B` |nbsp| :diagtext:`version` |nbsp| :placeholder:`C` |nbsp| :diagtext:`before it was` |nbsp| |+----------------------+| |nbsp| :diagtext:`in version` |nbsp| :placeholder:`E`:diagtext:`; attribute ignored`|
|                                                                ||:diagtext:`introduced`||                                                                                                                                          ||:diagtext:`introduced`||                                                                                     |
|                                                                |+----------------------+|                                                                                                                                          |+----------------------+|                                                                                     |
|                                                                ||:diagtext:`deprecated`||                                                                                                                                          ||:diagtext:`deprecated`||                                                                                     |
|                                                                |+----------------------+|                                                                                                                                          |+----------------------+|                                                                                     |
|                                                                ||:diagtext:`obsoleted` ||                                                                                                                                          ||:diagtext:`obsoleted` ||                                                                                     |
|                                                                |+----------------------+|                                                                                                                                          |+----------------------+|                                                                                     |
+----------------------------------------------------------------+------------------------+------------------------------------------------------------------------------------------------------------------------------------------+------------------------+-------------------------------------------------------------------------------------+

+---------------------------------------------------------------------------------------------------------------------------+
|:warning:`warning:` |nbsp| :diagtext:`use same version number separators '\_' or '.'; as in 'major\[.minor\[.subminor\]\]'`|
+---------------------------------------------------------------------------------------------------------------------------+

+---------------------------------------------------------------------------------------+
|:warning:`warning:` |nbsp| :diagtext:`availability does not match previous declaration`|
+---------------------------------------------------------------------------------------+

+---------------------------+--------------------------------+--------------------------+-------------------------------+--------+-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+
|:warning:`warning:` |nbsp| |+------------------------------+|:diagtext:`method` |nbsp| |+-----------------------------+| |nbsp| |+---------------------------------------------+| |nbsp| :diagtext:`on` |nbsp| :placeholder:`B` |nbsp| :diagtext:`(`:placeholder:`C` |nbsp| :diagtext:`vs.` |nbsp| :placeholder:`D`:diagtext:`)`|
|                           ||                              ||                          ||:diagtext:`introduced after` ||        ||:diagtext:`the protocol method it implements`||                                                                                                                                               |
|                           |+------------------------------+|                          |+-----------------------------+|        |+---------------------------------------------+|                                                                                                                                               |
|                           ||:diagtext:`overriding` |nbsp| ||                          ||:diagtext:`deprecated before`||        ||:diagtext:`overridden method`                ||                                                                                                                                               |
|                           |+------------------------------+|                          |+-----------------------------+|        |+---------------------------------------------+|                                                                                                                                               |
|                           |                                |                          ||:diagtext:`obsoleted before` ||        |                                               |                                                                                                                                               |
|                           |                                |                          |+-----------------------------+|        |                                               |                                                                                                                                               |
+---------------------------+--------------------------------+--------------------------+-------------------------------+--------+-----------------------------------------------+-----------------------------------------------------------------------------------------------------------------------------------------------+

+---------------------------+--------------------------------+---------------------------------------------------------------------------------------------------+-----------------------------------------------+--------------------------------+
|:warning:`warning:` |nbsp| |+------------------------------+|:diagtext:`method cannot be unavailable on` |nbsp| :placeholder:`A` |nbsp| :diagtext:`when` |nbsp| |+---------------------------------------------+| |nbsp| :diagtext:`is available`|
|                           ||                              ||                                                                                                   ||:diagtext:`the protocol method it implements`||                                |
|                           |+------------------------------+|                                                                                                   |+---------------------------------------------+|                                |
|                           ||:diagtext:`overriding` |nbsp| ||                                                                                                   ||:diagtext:`its overridden method`            ||                                |
|                           |+------------------------------+|                                                                                                   |+---------------------------------------------+|                                |
+---------------------------+--------------------------------+---------------------------------------------------------------------------------------------------+-----------------------------------------------+--------------------------------+


-Wbackend-plugin
----------------
This diagnostic is enabled by default.

**Diagnostic text:**

The text of this diagnostic is not controlled by Clang.


-Wbackslash-newline-escape
--------------------------
This diagnostic is enabled by default.

**Diagnostic text:**

+-------------------------------------------------------------------------------+
|:warning:`warning:` |nbsp| :diagtext:`backslash and newline separated by space`|
+-------------------------------------------------------------------------------+


-Wbad-function-cast
-------------------
**Diagnostic text:**

+--------------------------------------------------------------------------------------------------------------------------------------------------------------+
|:warning:`warning:` |nbsp| :diagtext:`cast from function call of type` |nbsp| :placeholder:`A` |nbsp| :diagtext:`to non-matching type` |nbsp| :placeholder:`B`|
+--------------------------------------------------------------------------------------------------------------------------------------------------------------+


-Wbind-to-temporary-copy
------------------------
Also controls `-Wc++98-compat-bind-to-temporary-copy`_.

**Diagnostic text:**

+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-----------------------+
|:warning:`warning:` |nbsp| :diagtext:`C++98 requires an accessible copy constructor for class` |nbsp| :placeholder:`C` |nbsp| :diagtext:`when binding a reference to a temporary; was` |nbsp| |+---------------------+|
|                                                                                                                                                                                              ||:diagtext:`private`  ||
|                                                                                                                                                                                              |+---------------------+|
|                                                                                                                                                                                              ||:diagtext:`protected`||
|                                                                                                                                                                                              |+---------------------+|
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-----------------------+

+--------------------------------------------------------------------+-----------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------+
|:warning:`warning:` |nbsp| :diagtext:`no viable constructor` |nbsp| |+---------------------------------------+| |nbsp| :diagtext:`of type` |nbsp| :placeholder:`B`:diagtext:`; C++98 requires a copy constructor when binding a reference to a temporary`|
|                                                                    ||:diagtext:`copying variable`           ||                                                                                                                                          |
|                                                                    |+---------------------------------------+|                                                                                                                                          |
|                                                                    ||:diagtext:`copying parameter`          ||                                                                                                                                          |
|                                                                    |+---------------------------------------+|                                                                                                                                          |
|                                                                    ||:diagtext:`returning object`           ||                                                                                                                                          |
|                                                                    |+---------------------------------------+|                                                                                                                                          |
|                                                                    ||:diagtext:`throwing object`            ||                                                                                                                                          |
|                                                                    |+---------------------------------------+|                                                                                                                                          |
|                                                                    ||:diagtext:`copying member subobject`   ||                                                                                                                                          |
|                                                                    |+---------------------------------------+|                                                                                                                                          |
|                                                                    ||:diagtext:`copying array element`      ||                                                                                                                                          |
|                                                                    |+---------------------------------------+|                                                                                                                                          |
|                                                                    ||:diagtext:`allocating object`          ||                                                                                                                                          |
|                                                                    |+---------------------------------------+|                                                                                                                                          |
|                                                                    ||:diagtext:`copying temporary`          ||                                                                                                                                          |
|                                                                    |+---------------------------------------+|                                                                                                                                          |
|                                                                    ||:diagtext:`initializing base subobject`||                                                                                                                                          |
|                                                                    |+---------------------------------------+|                                                                                                                                          |
|                                                                    ||:diagtext:`initializing vector element`||                                                                                                                                          |
|                                                                    |+---------------------------------------+|                                                                                                                                          |
|                                                                    ||:diagtext:`capturing value`            ||                                                                                                                                          |
|                                                                    |+---------------------------------------+|                                                                                                                                          |
+--------------------------------------------------------------------+-----------------------------------------+------------------------------------------------------------------------------------------------------------------------------------------+


-Wbitfield-constant-conversion
------------------------------
This diagnostic is enabled by default.

**Diagnostic text:**

+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|:warning:`warning:` |nbsp| :diagtext:`implicit truncation from` |nbsp| :placeholder:`C` |nbsp| :diagtext:`to bit-field changes value from` |nbsp| :placeholder:`A` |nbsp| :diagtext:`to` |nbsp| :placeholder:`B`|
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
-Wbitfield-enum-conversion
--------------------------
**Diagnostic text:**

+------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|:warning:`warning:` |nbsp| :diagtext:`bit-field` |nbsp| :placeholder:`A` |nbsp| :diagtext:`is not wide enough to store all enumerators of` |nbsp| :placeholder:`B`|
+------------------------------------------------------------------------------------------------------------------------------------------------------------------+

+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|:warning:`warning:` |nbsp| :diagtext:`signed bit-field` |nbsp| :placeholder:`A` |nbsp| :diagtext:`needs an extra bit to represent the largest positive enumerators of` |nbsp| :placeholder:`B`|
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+

+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|:warning:`warning:` |nbsp| :diagtext:`assigning value of signed enum type` |nbsp| :placeholder:`B` |nbsp| :diagtext:`to unsigned bit-field` |nbsp| :placeholder:`A`:diagtext:`; negative enumerators of enum` |nbsp| :placeholder:`B` |nbsp| :diagtext:`will be converted to positive values`|
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+


-Wbitfield-width
----------------
This diagnostic is enabled by default.

**Diagnostic text:**

+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------+
|:warning:`warning:` |nbsp| :diagtext:`width of anonymous bit-field (`:placeholder:`A` |nbsp| :diagtext:`bits) exceeds width of its type; value will be truncated to` |nbsp| :placeholder:`B` |nbsp| :diagtext:`bit`|+-------------+|
|                                                                                                                                                                                                                   ||             ||
|                                                                                                                                                                                                                   |+-------------+|
|                                                                                                                                                                                                                   ||:diagtext:`s`||
|                                                                                                                                                                                                                   |+-------------+|
+-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------+

+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------+
|:warning:`warning:` |nbsp| :diagtext:`width of bit-field` |nbsp| :placeholder:`A` |nbsp| :diagtext:`(`:placeholder:`B` |nbsp| :diagtext:`bits) exceeds the width of its type; value will be truncated to` |nbsp| :placeholder:`C` |nbsp| :diagtext:`bit`|+-------------+|
|                                                                                                                                                                                                                                                        ||             ||
|                                                                                                                                                                                                                                                        |+-------------+|
|                                                                                                                                                                                                                                                        ||:diagtext:`s`||
|                                                                                                                                                                                                                                                        |+-------------+|
+--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+---------------+


-Wbitwise-op-parentheses
------------------------
This diagnostic is enabled by default.

**Diagnostic text:**

+-----------------------------------------------------------------------------------------------------------+
|:warning:`warning:` |nbsp| :diagtext:`'`:placeholder:`A`:diagtext:`' within '`:placeholder:`B`:diagtext:`'`|
+-----------------------------------------------------------------------------------------------------------+


-Wblock-capture-autoreleasing
-----------------------------
This diagnostic is enabled by default.

**Diagnostic text:**

+-----------------------------------------------------------------------------------------------------------------------------+
|:warning:`warning:` |nbsp| :diagtext:`block captures an autoreleasing out-parameter, which may result in use-after-free bugs`|
+-----------------------------------------------------------------------------------------------------------------------------+


-Wbool-conversion
-----------------
This diagnostic is enabled by default.

Also controls `-Wpointer-bool-conversion`_, `-Wundefined-bool-conversion`_.

**Diagnostic text:**

+--------------------------------------------------------------------------------------------------------------------------------------------------------------+
|:warning:`warning:` |nbsp| :diagtext:`initialization of pointer of type` |nbsp| :placeholder:`A` |nbsp| :diagtext:`to null from a constant boolean expression`|
+--------------------------------------------------------------------------------------------------------------------------------------------------------------+


-Wbool-conversions
------------------
Synonym for `-Wbool-conversion`_.


-Wbraced-scalar-init
--------------------
This diagnostic is enabled by default.

**Diagnostic text:**

+-----------------------------------------------------------------------+
|:warning:`warning:` |nbsp| :diagtext:`braces around scalar initializer`|
+-----------------------------------------------------------------------+


-Wbridge-cast
-------------
This diagnostic is enabled by default.

**Diagnostic text:**

+------------------------------------------------------------------------------------------------------------------------------------------+
|:warning:`warning:` |nbsp| :placeholder:`A` |nbsp| :diagtext:`bridges to` |nbsp| :placeholder:`B`:diagtext:`, not` |nbsp| :placeholder:`C`|
+------------------------------------------------------------------------------------------------------------------------------------------+

+-------------------------------------------------------------------------------------------------------+
|:warning:`warning:` |nbsp| :placeholder:`A` |nbsp| :diagtext:`cannot bridge to` |nbsp| :placeholder:`B`|
+-------------------------------------------------------------------------------------------------------+


-Wbuiltin-macro-redefined
-------------------------
This diagnostic is enabled by default.

**Diagnostic text:**

+---------------------------------------------------------------+
|:warning:`warning:` |nbsp| :diagtext:`redefining builtin macro`|
+---------------------------------------------------------------+

+---------------------------------------------------------------+
|:warning:`warning:` |nbsp| :diagtext:`undefining builtin macro`|
+---------------------------------------------------------------+


-Wbuiltin-memcpy-chk-size
-------------------------
This diagnostic is enabled by default.

**Diagnostic text:**

+------------------------------------------------------------------------------------------------------+
|:warning:`warning:` |nbsp| :placeholder:`A` |nbsp| :diagtext:`will always overflow destination buffer`|
+------------------------------------------------------------------------------------------------------+


-Wbuiltin-requires-header
-------------------------
This diagnostic is enabled by default.

**Diagnostic text:**

+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|:warning:`warning:` |nbsp| :diagtext:`declaration of built-in function '`:placeholder:`B`:diagtext:`' requires inclusion of the header <`:placeholder:`A`:diagtext:`>`|
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------+


-Wc++-compat
------------
**Diagnostic text:**

+---------------------------+---------------------------+--------------------+--------------------------------------------+---------------------------+--------------------------+
|:warning:`warning:` |nbsp| |+-------------------------+|+------------------+| |nbsp| :diagtext:`has size 0 in C,` |nbsp| |+-------------------------+| |nbsp| :diagtext:`in C++`|
|                           ||                         |||:diagtext:`struct`||                                            ||:diagtext:`size 1`       ||                          |
|                           |+-------------------------+|+------------------+|                                            |+-------------------------+|                          |
|                           ||:diagtext:`empty` |nbsp| |||:diagtext:`union` ||                                            ||:diagtext:`non-zero size`||                          |
|                           |+-------------------------+|+------------------+|                                            |+-------------------------+|                          |
+---------------------------+---------------------------+--------------------+--------------------------------------------+---------------------------+--------------------------+


-Wc++0x-compat
--------------
Synonym for `-Wc++11-compat`_.


-Wc++0x-extensions
------------------
Synonym for `-Wc++11-extensions`_.


-Wc++0x-narrowing
-----------------
Synonym for `-Wc++11-narrowing`_.


-Wc++11-compat
--------------
Some of the diagnostics controlled by this flag are enabled by default.

Also controls `-Wc++11-compat-deprecated-writable-strings`_, `-Wc++11-compat-reserved-user-defined-literal`_, `-Wc++11-narrowing`_, `-Wc++98-c++11-c++14-compat`_, `-Wc++98-c++11-compat`_.

**Diagnostic text:**

+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-----------------------------------+------------------------------------+
|:warning:`warning:` |nbsp| :diagtext:`integer literal is too large to be represented in type 'long' and is subject to undefined behavior under C++98, interpreting as 'unsigned long'; this literal will` |nbsp| |+---------------------------------+| |nbsp| :diagtext:`in C++11 onwards`|
|                                                                                                                                                                                                                 ||:diagtext:`have type 'long long'`||                                    |
|                                                                                                                                                                                                                 |+---------------------------------+|                                    |
|                                                                                                                                                                                                                 ||:diagtext:`be ill-formed`        ||                                    |
|                                                                                                                                                                                                                 |+---------------------------------+|                                    |
+-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+-----------------------------------+------------------------------------+

+--------------------------------------------------------------------------------------------------------------+
|:warning:`warning:` |nbsp| :diagtext:`'auto' storage class specifier is redundant and incompatible with C++11`|
+--------------------------------------------------------------------------------------------------------------+

+-------------------------------------------------------------------------------------------------------------------------+
|:warning:`warning:` |nbsp| :diagtext:`identifier after literal will be treated as a user-defined literal suffix in C++11`|
+-------------------------------------------------------------------------------------------------------------------------+

+-------------------------------------------------------------------------------------------+
|:warning:`warning:` |nbsp| :diagtext:`'`:placeholder:`A`:diagtext:`' is a keyword in C++11`|
+-------------------------------------------------------------------------------------------+

+--------------------------------------------------------------------------------------------------------------------------------+
|:warning:`warning:` |nbsp| :diagtext:`use of right-shift operator ('>>') in template argument will require parentheses in C++11`|