Newer
Older

Richard Smith
committed
..
-------------------------------------------------------------------
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;

Richard Smith
committed
padding: 0 0 0 0.2em;

Richard Smith
committed
vertical-align: middle;
white-space: nowrap;
width: 1px;

Richard Smith
committed
font-family: monospace;

Richard Smith
committed
}
table.docutils tr + tr {
border-top: 0.2em solid #aaa;
}
.error {
font-family: monospace;
font-weight: bold;

Richard Smith
committed
}
.warning {
font-family: monospace;
font-weight: bold;
color: #80a;

Richard Smith
committed
}
.remark {
font-family: monospace;
font-weight: bold;
color: #00c;
}
.diagtext {
font-family: monospace;
font-weight: bold;
}
</style>

Richard Smith
committed
.. FIXME: rST doesn't support formatting this, so we format all <td> elements
as monospace font face instead.

Richard Smith
committed
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
.. |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`_.

Richard Smith
committed
-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`|
+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+

Richard Smith
committed
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
-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.

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

Richard Smith
committed
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
-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
-----

Richard Smith
committed
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`|
+-------------------------------------------------------------------------------------+

Richard Smith
committed
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
-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
-------------------

Richard Smith
committed
Controls `-Wcustom-atomic-properties`_, `-Wimplicit-atomic-properties`_.

Richard Smith
committed
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
-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.

Richard Smith
committed
Controls `-Wignored-attributes`_, `-Wunknown-attributes`_.

Richard Smith
committed
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
-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:**

Richard Smith
committed
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
|: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`|
+----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+

Richard Smith
committed
-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`|
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+

Richard Smith
committed
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
-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:`'`|
+-----------------------------------------------------------------------------------------------------------+

Richard Smith
committed
-Wblock-capture-autoreleasing
-----------------------------
This diagnostic is enabled by default.

Richard Smith
committed
**Diagnostic text:**
+-----------------------------------------------------------------------------------------------------------------------------+
|:warning:`warning:` |nbsp| :diagtext:`block captures an autoreleasing out-parameter, which may result in use-after-free bugs`|
+-----------------------------------------------------------------------------------------------------------------------------+

Richard Smith
committed
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
-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.

Richard Smith
committed
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`_.

Richard Smith
committed
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
**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`|