1//==--- DiagnosticGroups.td - Diagnostic Group Definitions ----------------===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9def ImplicitFunctionDeclare : DiagGroup<"implicit-function-declaration">;
10def ImplicitInt : DiagGroup<"implicit-int">;
11
12// Aggregation warning settings.
13def Implicit : DiagGroup<"implicit", [
14    ImplicitFunctionDeclare,
15    ImplicitInt
16]>;
17
18// Empty DiagGroups are recognized by clang but ignored.
19def ODR : DiagGroup<"odr">;
20def : DiagGroup<"abi">;
21def AbsoluteValue : DiagGroup<"absolute-value">;
22def AddressOfTemporary : DiagGroup<"address-of-temporary">;
23def : DiagGroup<"aggregate-return">;
24def GNUAlignofExpression : DiagGroup<"gnu-alignof-expression">;
25def AmbigMemberTemplate : DiagGroup<"ambiguous-member-template">;
26def GNUAnonymousStruct : DiagGroup<"gnu-anonymous-struct">;
27def GNUAutoType : DiagGroup<"gnu-auto-type">;
28def ArrayBounds : DiagGroup<"array-bounds">;
29def ArrayBoundsPointerArithmetic : DiagGroup<"array-bounds-pointer-arithmetic">;
30def AutoDisableVptrSanitizer : DiagGroup<"auto-disable-vptr-sanitizer">;
31def Availability : DiagGroup<"availability">;
32def Section : DiagGroup<"section">;
33def AutoImport : DiagGroup<"auto-import">;
34def FrameworkHdrQuotedInclude : DiagGroup<"quoted-include-in-framework-header">;
35def FrameworkIncludePrivateFromPublic :
36  DiagGroup<"framework-include-private-from-public">;
37def FrameworkHdrAtImport : DiagGroup<"atimport-in-framework-header">;
38def CXX14BinaryLiteral : DiagGroup<"c++14-binary-literal">;
39def CXXPre14CompatBinaryLiteral : DiagGroup<"c++98-c++11-compat-binary-literal">;
40def GNUBinaryLiteral : DiagGroup<"gnu-binary-literal">;
41def BinaryLiteral : DiagGroup<"binary-literal", [CXX14BinaryLiteral,
42                                                 CXXPre14CompatBinaryLiteral,
43                                                 GNUBinaryLiteral]>;
44def GNUCompoundLiteralInitializer : DiagGroup<"gnu-compound-literal-initializer">;
45def BitFieldConstantConversion : DiagGroup<"bitfield-constant-conversion">;
46def BitFieldEnumConversion : DiagGroup<"bitfield-enum-conversion">;
47def BitFieldWidth : DiagGroup<"bitfield-width">;
48def CoroutineMissingUnhandledException :
49  DiagGroup<"coroutine-missing-unhandled-exception">;
50def Coroutine : DiagGroup<"coroutine", [CoroutineMissingUnhandledException]>;
51def ObjCBoolConstantConversion : DiagGroup<"objc-bool-constant-conversion">;
52def ConstantConversion : DiagGroup<"constant-conversion",
53                                   [BitFieldConstantConversion,
54                                    ObjCBoolConstantConversion]>;
55def LiteralConversion : DiagGroup<"literal-conversion">;
56def StringConversion : DiagGroup<"string-conversion">;
57def SignConversion : DiagGroup<"sign-conversion">;
58def PointerBoolConversion : DiagGroup<"pointer-bool-conversion">;
59def UndefinedBoolConversion : DiagGroup<"undefined-bool-conversion">;
60def BoolConversion : DiagGroup<"bool-conversion", [PointerBoolConversion,
61                                                   UndefinedBoolConversion]>;
62def IntConversion : DiagGroup<"int-conversion">;
63def DeprecatedEnumCompareConditional :
64  DiagGroup<"deprecated-enum-compare-conditional">;
65def EnumCompareConditional : DiagGroup<"enum-compare-conditional",
66                                       [DeprecatedEnumCompareConditional]>;
67def EnumCompareSwitch : DiagGroup<"enum-compare-switch">;
68def DeprecatedEnumCompare : DiagGroup<"deprecated-enum-compare">;
69def EnumCompare : DiagGroup<"enum-compare", [EnumCompareSwitch,
70                                             DeprecatedEnumCompare]>;
71def DeprecatedAnonEnumEnumConversion : DiagGroup<"deprecated-anon-enum-enum-conversion">;
72def DeprecatedEnumEnumConversion : DiagGroup<"deprecated-enum-enum-conversion">;
73def DeprecatedEnumFloatConversion : DiagGroup<"deprecated-enum-float-conversion">;
74def AnonEnumEnumConversion : DiagGroup<"anon-enum-enum-conversion",
75                                   [DeprecatedAnonEnumEnumConversion]>;
76def EnumEnumConversion : DiagGroup<"enum-enum-conversion",
77                                   [DeprecatedEnumEnumConversion]>;
78def EnumFloatConversion : DiagGroup<"enum-float-conversion",
79                                    [DeprecatedEnumFloatConversion]>;
80def EnumConversion : DiagGroup<"enum-conversion",
81                               [EnumEnumConversion,
82                                EnumFloatConversion,
83                                EnumCompareConditional]>;
84def ObjCSignedCharBoolImplicitIntConversion :
85  DiagGroup<"objc-signed-char-bool-implicit-int-conversion">;
86def ImplicitIntConversion : DiagGroup<"implicit-int-conversion",
87                                     [ObjCSignedCharBoolImplicitIntConversion]>;
88def ImplicitIntFloatConversion : DiagGroup<"implicit-int-float-conversion">;
89def ObjCSignedCharBoolImplicitFloatConversion :
90  DiagGroup<"objc-signed-char-bool-implicit-float-conversion">;
91def ImplicitFloatConversion : DiagGroup<"implicit-float-conversion",
92  [ImplicitIntFloatConversion,
93   ObjCSignedCharBoolImplicitFloatConversion]>;
94def ImplicitFixedPointConversion : DiagGroup<"implicit-fixed-point-conversion">;
95
96def FloatOverflowConversion : DiagGroup<"float-overflow-conversion">;
97def FloatZeroConversion : DiagGroup<"float-zero-conversion">;
98def FloatConversion :
99  DiagGroup<"float-conversion", [FloatOverflowConversion,
100                                 FloatZeroConversion]>;
101
102def DoublePromotion : DiagGroup<"double-promotion">;
103def EnumTooLarge : DiagGroup<"enum-too-large">;
104def UnsupportedNan : DiagGroup<"unsupported-nan">;
105def UnsupportedAbs : DiagGroup<"unsupported-abs">;
106def UnsupportedCB : DiagGroup<"unsupported-cb">;
107def UnsupportedGPOpt : DiagGroup<"unsupported-gpopt">;
108def UnsupportedTargetOpt : DiagGroup<"unsupported-target-opt">;
109def NonLiteralNullConversion : DiagGroup<"non-literal-null-conversion">;
110def NullConversion : DiagGroup<"null-conversion">;
111def ImplicitConversionFloatingPointToBool :
112  DiagGroup<"implicit-conversion-floating-point-to-bool">;
113def ObjCLiteralConversion : DiagGroup<"objc-literal-conversion">;
114def MacroRedefined : DiagGroup<"macro-redefined">;
115def BuiltinMacroRedefined : DiagGroup<"builtin-macro-redefined">;
116def BuiltinRequiresHeader : DiagGroup<"builtin-requires-header">;
117def C99Compat : DiagGroup<"c99-compat">;
118def CXXCompat: DiagGroup<"c++-compat">;
119def ExternCCompat : DiagGroup<"extern-c-compat">;
120def KeywordCompat : DiagGroup<"keyword-compat">;
121def GNUCaseRange : DiagGroup<"gnu-case-range">;
122def CastAlign : DiagGroup<"cast-align">;
123def CastQual : DiagGroup<"cast-qual">;
124def : DiagGroup<"char-align">;
125def Comment : DiagGroup<"comment">;
126def GNUComplexInteger : DiagGroup<"gnu-complex-integer">;
127def GNUConditionalOmittedOperand : DiagGroup<"gnu-conditional-omitted-operand">;
128def ConfigMacros : DiagGroup<"config-macros">;
129def : DiagGroup<"ctor-dtor-privacy">;
130def GNUStringLiteralOperatorTemplate :
131  DiagGroup<"gnu-string-literal-operator-template">;
132def UndefinedVarTemplate : DiagGroup<"undefined-var-template">;
133def UndefinedFuncTemplate : DiagGroup<"undefined-func-template">;
134def MissingNoEscape : DiagGroup<"missing-noescape">;
135
136def DefaultedFunctionDeleted : DiagGroup<"defaulted-function-deleted">;
137def DeleteIncomplete : DiagGroup<"delete-incomplete">;
138def DeleteNonAbstractNonVirtualDtor : DiagGroup<"delete-non-abstract-non-virtual-dtor">;
139def DeleteAbstractNonVirtualDtor : DiagGroup<"delete-abstract-non-virtual-dtor">;
140def DeleteNonVirtualDtor : DiagGroup<"delete-non-virtual-dtor",
141                                     [DeleteNonAbstractNonVirtualDtor,
142                                      DeleteAbstractNonVirtualDtor]>;
143def AbstractFinalClass : DiagGroup<"abstract-final-class">;
144def FinalDtorNonFinalClass : DiagGroup<"final-dtor-non-final-class">;
145
146def CXX11CompatDeprecatedWritableStr :
147  DiagGroup<"c++11-compat-deprecated-writable-strings">;
148
149def DeprecatedArrayCompare : DiagGroup<"deprecated-array-compare">;
150def DeprecatedAttributes : DiagGroup<"deprecated-attributes">;
151def DeprecatedCommaSubscript : DiagGroup<"deprecated-comma-subscript">;
152def DeprecatedCopy : DiagGroup<"deprecated-copy">;
153def DeprecatedCopyDtor : DiagGroup<"deprecated-copy-dtor">;
154def DeprecatedDeclarations : DiagGroup<"deprecated-declarations">;
155def UnavailableDeclarations : DiagGroup<"unavailable-declarations">;
156def UnguardedAvailabilityNew : DiagGroup<"unguarded-availability-new">;
157def UnguardedAvailability : DiagGroup<"unguarded-availability",
158                                      [UnguardedAvailabilityNew]>;
159// partial-availability is an alias of unguarded-availability.
160def : DiagGroup<"partial-availability", [UnguardedAvailability]>;
161def DeprecatedDynamicExceptionSpec
162    : DiagGroup<"deprecated-dynamic-exception-spec">;
163def DeprecatedImplementations :DiagGroup<"deprecated-implementations">;
164def DeprecatedIncrementBool : DiagGroup<"deprecated-increment-bool">;
165def DeprecatedRegister : DiagGroup<"deprecated-register">;
166def DeprecatedThisCapture : DiagGroup<"deprecated-this-capture">;
167def DeprecatedVolatile : DiagGroup<"deprecated-volatile">;
168def DeprecatedWritableStr : DiagGroup<"deprecated-writable-strings",
169                                      [CXX11CompatDeprecatedWritableStr]>;
170// FIXME: Why is DeprecatedImplementations not in this group?
171def Deprecated : DiagGroup<"deprecated", [DeprecatedAnonEnumEnumConversion,
172                                          DeprecatedArrayCompare,
173                                          DeprecatedAttributes,
174                                          DeprecatedCommaSubscript,
175                                          DeprecatedCopy,
176                                          DeprecatedCopyDtor,
177                                          DeprecatedDeclarations,
178                                          DeprecatedDynamicExceptionSpec,
179                                          DeprecatedEnumCompare,
180                                          DeprecatedEnumCompareConditional,
181                                          DeprecatedEnumEnumConversion,
182                                          DeprecatedEnumFloatConversion,
183                                          DeprecatedIncrementBool,
184                                          DeprecatedRegister,
185                                          DeprecatedThisCapture,
186                                          DeprecatedVolatile,
187                                          DeprecatedWritableStr]>,
188                 DiagCategory<"Deprecations">;
189
190def CXX20Designator : DiagGroup<"c++20-designator">;
191// Allow -Wno-c99-designator to be used to turn off all warnings on valid C99
192// designators (including the warning controlled by -Wc++20-designator).
193def C99Designator : DiagGroup<"c99-designator", [CXX20Designator]>;
194def GNUDesignator : DiagGroup<"gnu-designator">;
195
196def DynamicExceptionSpec
197    : DiagGroup<"dynamic-exception-spec", [DeprecatedDynamicExceptionSpec]>;
198
199def LibLTO : DiagGroup<"liblto">;
200def : DiagGroup<"disabled-optimization">;
201def : DiagGroup<"discard-qual">;
202def DivZero : DiagGroup<"division-by-zero">;
203def : DiagGroup<"div-by-zero", [DivZero]>;
204
205def DocumentationHTML : DiagGroup<"documentation-html">;
206def DocumentationUnknownCommand : DiagGroup<"documentation-unknown-command">;
207def DocumentationPedantic : DiagGroup<"documentation-pedantic",
208                                      [DocumentationUnknownCommand]>;
209def DocumentationDeprecatedSync : DiagGroup<"documentation-deprecated-sync">;
210def Documentation : DiagGroup<"documentation",
211                              [DocumentationHTML,
212                               DocumentationDeprecatedSync]>;
213
214def EmptyBody : DiagGroup<"empty-body">;
215def Exceptions : DiagGroup<"exceptions">;
216
217def GNUEmptyInitializer : DiagGroup<"gnu-empty-initializer">;
218def GNUEmptyStruct : DiagGroup<"gnu-empty-struct">;
219def ExtraTokens : DiagGroup<"extra-tokens">;
220def CXX98CompatExtraSemi : DiagGroup<"c++98-compat-extra-semi">;
221def CXX11ExtraSemi : DiagGroup<"c++11-extra-semi">;
222def EmptyInitStatement : DiagGroup<"empty-init-stmt">;
223def ExportUnnamed : DiagGroup<"export-unnamed">;
224def ExtraSemiStmt : DiagGroup<"extra-semi-stmt", [EmptyInitStatement]>;
225def ExtraSemi : DiagGroup<"extra-semi", [CXX98CompatExtraSemi,
226                                         CXX11ExtraSemi]>;
227
228def GNUFlexibleArrayInitializer : DiagGroup<"gnu-flexible-array-initializer">;
229def GNUFlexibleArrayUnionMember : DiagGroup<"gnu-flexible-array-union-member">;
230def GNUFoldingConstant : DiagGroup<"gnu-folding-constant">;
231def FormatExtraArgs : DiagGroup<"format-extra-args">;
232def FormatZeroLength : DiagGroup<"format-zero-length">;
233
234def InvalidIOSDeploymentTarget : DiagGroup<"invalid-ios-deployment-target">;
235
236def CXX17CompatMangling : DiagGroup<"c++17-compat-mangling">;
237def : DiagGroup<"c++1z-compat-mangling", [CXX17CompatMangling]>;
238// Name of this warning in GCC.
239def NoexceptType : DiagGroup<"noexcept-type", [CXX17CompatMangling]>;
240
241// Warnings for C++1y code which is not compatible with prior C++ standards.
242def CXXPre14Compat : DiagGroup<"c++98-c++11-compat">;
243def CXXPre14CompatPedantic : DiagGroup<"c++98-c++11-compat-pedantic",
244                                       [CXXPre14Compat,
245                                        CXXPre14CompatBinaryLiteral]>;
246def CXXPre17Compat : DiagGroup<"c++98-c++11-c++14-compat">;
247def CXXPre17CompatPedantic : DiagGroup<"c++98-c++11-c++14-compat-pedantic",
248                                       [CXXPre17Compat]>;
249def CXXPre20Compat : DiagGroup<"c++98-c++11-c++14-c++17-compat">;
250def CXXPre20CompatPedantic : DiagGroup<"c++98-c++11-c++14-c++17-compat-pedantic",
251                                       [CXXPre20Compat]>;
252
253def CXX98CompatBindToTemporaryCopy :
254  DiagGroup<"c++98-compat-bind-to-temporary-copy">;
255def CXX98CompatLocalTypeTemplateArgs :
256  DiagGroup<"c++98-compat-local-type-template-args">;
257def CXX98CompatUnnamedTypeTemplateArgs :
258  DiagGroup<"c++98-compat-unnamed-type-template-args">;
259
260def CXX98Compat : DiagGroup<"c++98-compat",
261                            [CXX98CompatLocalTypeTemplateArgs,
262                             CXX98CompatUnnamedTypeTemplateArgs,
263                             CXXPre14Compat,
264                             CXXPre17Compat,
265                             CXXPre20Compat]>;
266// Warnings for C++11 features which are Extensions in C++98 mode.
267def CXX98CompatPedantic : DiagGroup<"c++98-compat-pedantic",
268                                    [CXX98Compat,
269                                     CXX98CompatBindToTemporaryCopy,
270                                     CXX98CompatExtraSemi,
271                                     CXXPre14CompatPedantic,
272                                     CXXPre17CompatPedantic,
273                                     CXXPre20CompatPedantic]>;
274
275def CXX11Narrowing : DiagGroup<"c++11-narrowing">;
276
277def CXX11WarnOverrideDestructor :
278  DiagGroup<"inconsistent-missing-destructor-override">;
279def CXX11WarnOverrideMethod : DiagGroup<"inconsistent-missing-override">;
280
281// Original name of this warning in Clang
282def : DiagGroup<"c++0x-narrowing", [CXX11Narrowing]>;
283
284// Name of this warning in GCC
285def : DiagGroup<"narrowing", [CXX11Narrowing]>;
286
287def CXX11CompatReservedUserDefinedLiteral :
288  DiagGroup<"c++11-compat-reserved-user-defined-literal">;
289def ReservedUserDefinedLiteral :
290  DiagGroup<"reserved-user-defined-literal",
291            [CXX11CompatReservedUserDefinedLiteral]>;
292
293def CXX11Compat : DiagGroup<"c++11-compat",
294                            [CXX11Narrowing,
295                             CXX11CompatReservedUserDefinedLiteral,
296                             CXX11CompatDeprecatedWritableStr,
297                             CXXPre14Compat,
298                             CXXPre17Compat,
299                             CXXPre20Compat]>;
300def : DiagGroup<"c++0x-compat", [CXX11Compat]>;
301def CXX11CompatPedantic : DiagGroup<"c++11-compat-pedantic",
302                                    [CXX11Compat,
303                                     CXXPre14CompatPedantic,
304                                     CXXPre17CompatPedantic,
305                                     CXXPre20CompatPedantic]>;
306
307def CXX14Compat : DiagGroup<"c++14-compat", [CXXPre17Compat,
308                                             CXXPre20Compat]>;
309def CXX14CompatPedantic : DiagGroup<"c++14-compat-pedantic",
310                                    [CXX14Compat,
311                                     CXXPre17CompatPedantic,
312                                     CXXPre20CompatPedantic]>;
313
314def CXX17Compat : DiagGroup<"c++17-compat", [DeprecatedRegister,
315                                             DeprecatedIncrementBool,
316                                             CXX17CompatMangling,
317                                             CXXPre20Compat]>;
318def CXX17CompatPedantic : DiagGroup<"c++17-compat-pedantic",
319                                    [CXX17Compat,
320                                     CXXPre20CompatPedantic]>;
321def : DiagGroup<"c++1z-compat", [CXX17Compat]>;
322
323def CXX20Compat : DiagGroup<"c++20-compat">;
324def CXX20CompatPedantic : DiagGroup<"c++20-compat-pedantic",
325                                    [CXX20Compat]>;
326def : DiagGroup<"c++2a-compat", [CXX20Compat]>;
327def : DiagGroup<"c++2a-compat-pedantic", [CXX20CompatPedantic]>;
328
329def ExitTimeDestructors : DiagGroup<"exit-time-destructors">;
330def FlexibleArrayExtensions : DiagGroup<"flexible-array-extensions">;
331def FourByteMultiChar : DiagGroup<"four-char-constants">;
332def GlobalConstructors : DiagGroup<"global-constructors">;
333def BitwiseConditionalParentheses: DiagGroup<"bitwise-conditional-parentheses">;
334def BitwiseOpParentheses: DiagGroup<"bitwise-op-parentheses">;
335def LogicalOpParentheses: DiagGroup<"logical-op-parentheses">;
336def LogicalNotParentheses: DiagGroup<"logical-not-parentheses">;
337def ShiftOpParentheses: DiagGroup<"shift-op-parentheses">;
338def OverloadedShiftOpParentheses: DiagGroup<"overloaded-shift-op-parentheses">;
339def DanglingElse: DiagGroup<"dangling-else">;
340def DanglingField : DiagGroup<"dangling-field">;
341def DanglingInitializerList : DiagGroup<"dangling-initializer-list">;
342def DanglingGsl : DiagGroup<"dangling-gsl">;
343def ReturnStackAddress : DiagGroup<"return-stack-address">;
344def Dangling : DiagGroup<"dangling", [DanglingField,
345                                      DanglingInitializerList,
346                                      DanglingGsl,
347                                      ReturnStackAddress]>;
348def DistributedObjectModifiers : DiagGroup<"distributed-object-modifiers">;
349def ExpansionToDefined : DiagGroup<"expansion-to-defined">;
350def FlagEnum : DiagGroup<"flag-enum">;
351def IncrementBool : DiagGroup<"increment-bool", [DeprecatedIncrementBool]>;
352def InfiniteRecursion : DiagGroup<"infinite-recursion">;
353def PureVirtualCallFromCtorDtor: DiagGroup<"call-to-pure-virtual-from-ctor-dtor">;
354def GNUImaginaryConstant : DiagGroup<"gnu-imaginary-constant">;
355def IgnoredQualifiers : DiagGroup<"ignored-qualifiers">;
356def : DiagGroup<"import">;
357def GNUIncludeNext : DiagGroup<"gnu-include-next">;
358def IncompatibleMSStruct : DiagGroup<"incompatible-ms-struct">;
359def IncompatiblePointerTypesDiscardsQualifiers
360  : DiagGroup<"incompatible-pointer-types-discards-qualifiers">;
361def IncompatibleFunctionPointerTypes
362  : DiagGroup<"incompatible-function-pointer-types">;
363def IncompatiblePointerTypes
364  : DiagGroup<"incompatible-pointer-types",
365    [IncompatiblePointerTypesDiscardsQualifiers,
366     IncompatibleFunctionPointerTypes]>;
367def IncompleteUmbrella : DiagGroup<"incomplete-umbrella">;
368def IncompleteFrameworkModuleDeclaration
369  : DiagGroup<"incomplete-framework-module-declaration">;
370def NonModularIncludeInFrameworkModule
371  : DiagGroup<"non-modular-include-in-framework-module">;
372def NonModularIncludeInModule : DiagGroup<"non-modular-include-in-module",
373                                          [NonModularIncludeInFrameworkModule]>;
374def IncompleteModule : DiagGroup<"incomplete-module",
375    [IncompleteUmbrella, NonModularIncludeInModule]>;
376def PrivateModule : DiagGroup<"private-module">;
377
378def CXX11InlineNamespace : DiagGroup<"c++11-inline-namespace">;
379def InvalidNoreturn : DiagGroup<"invalid-noreturn">;
380def InvalidSourceEncoding : DiagGroup<"invalid-source-encoding">;
381def KNRPromotedParameter : DiagGroup<"knr-promoted-parameter">;
382def : DiagGroup<"init-self">;
383def : DiagGroup<"inline">;
384def : DiagGroup<"invalid-pch">;
385def GNULabelsAsValue : DiagGroup<"gnu-label-as-value">;
386def LiteralRange : DiagGroup<"literal-range">;
387def LocalTypeTemplateArgs : DiagGroup<"local-type-template-args",
388                                      [CXX98CompatLocalTypeTemplateArgs]>;
389def RangeLoopConstruct : DiagGroup<"range-loop-construct">;
390def RangeLoopBindReference : DiagGroup<"range-loop-bind-reference">;
391def RangeLoopAnalysis : DiagGroup<"range-loop-analysis",
392                                  [RangeLoopConstruct, RangeLoopBindReference]>;
393def ForLoopAnalysis : DiagGroup<"for-loop-analysis">;
394def LoopAnalysis : DiagGroup<"loop-analysis", [ForLoopAnalysis,
395                                               RangeLoopAnalysis]>;
396def MalformedWarningCheck : DiagGroup<"malformed-warning-check">;
397def Main : DiagGroup<"main">;
398def MainReturnType : DiagGroup<"main-return-type">;
399def MaxUnsignedZero : DiagGroup<"max-unsigned-zero">;
400def MissingBraces : DiagGroup<"missing-braces">;
401def MissingDeclarations: DiagGroup<"missing-declarations">;
402def : DiagGroup<"missing-format-attribute">;
403def : DiagGroup<"missing-include-dirs">;
404def MissingNoreturn : DiagGroup<"missing-noreturn">;
405def MultiChar : DiagGroup<"multichar">;
406def : DiagGroup<"nested-externs">;
407def CXX11LongLong : DiagGroup<"c++11-long-long">;
408def LongLong : DiagGroup<"long-long", [CXX11LongLong]>;
409def ImplicitlyUnsignedLiteral : DiagGroup<"implicitly-unsigned-literal">;
410def MethodSignatures : DiagGroup<"method-signatures">;
411def MismatchedParameterTypes : DiagGroup<"mismatched-parameter-types">;
412def MismatchedReturnTypes : DiagGroup<"mismatched-return-types">;
413def MismatchedTags : DiagGroup<"mismatched-tags">;
414def MissingFieldInitializers : DiagGroup<"missing-field-initializers">;
415def ModuleBuild : DiagGroup<"module-build">;
416def ModuleImport : DiagGroup<"module-import">;
417def ModuleConflict : DiagGroup<"module-conflict">;
418def ModuleFileExtension : DiagGroup<"module-file-extension">;
419def NewlineEOF : DiagGroup<"newline-eof">;
420def Nullability : DiagGroup<"nullability">;
421def NullabilityDeclSpec : DiagGroup<"nullability-declspec">;
422def NullabilityInferredOnNestedType : DiagGroup<"nullability-inferred-on-nested-type">;
423def NullableToNonNullConversion : DiagGroup<"nullable-to-nonnull-conversion">;
424def NullabilityCompletenessOnArrays : DiagGroup<"nullability-completeness-on-arrays">;
425def NullabilityCompleteness : DiagGroup<"nullability-completeness",
426                                        [NullabilityCompletenessOnArrays]>;
427def NullArithmetic : DiagGroup<"null-arithmetic">;
428def NullCharacter : DiagGroup<"null-character">;
429def NullDereference : DiagGroup<"null-dereference">;
430def InitializerOverrides : DiagGroup<"initializer-overrides">;
431// For compatibility with GCC; -Woverride-init = -Winitializer-overrides
432def : DiagGroup<"override-init", [InitializerOverrides]>;
433def NonNull : DiagGroup<"nonnull">;
434def NonPODVarargs : DiagGroup<"non-pod-varargs">;
435def ClassVarargs : DiagGroup<"class-varargs", [NonPODVarargs]>;
436def : DiagGroup<"nonportable-cfstrings">;
437def NonVirtualDtor : DiagGroup<"non-virtual-dtor">;
438def NullPointerArithmetic : DiagGroup<"null-pointer-arithmetic">;
439def : DiagGroup<"effc++", [NonVirtualDtor]>;
440def OveralignedType : DiagGroup<"over-aligned">;
441def OldStyleCast : DiagGroup<"old-style-cast">;
442def : DiagGroup<"old-style-definition">;
443def OutOfLineDeclaration : DiagGroup<"out-of-line-declaration">;
444def : DiagGroup<"overflow">;
445def ForwardClassReceiver : DiagGroup<"receiver-forward-class">;
446def MethodAccess : DiagGroup<"objc-method-access">;
447def ObjCReceiver : DiagGroup<"receiver-expr">;
448def OperatorNewReturnsNull : DiagGroup<"new-returns-null">;
449def OverlengthStrings : DiagGroup<"overlength-strings">;
450def OverloadedVirtual : DiagGroup<"overloaded-virtual">;
451def PrivateExtern : DiagGroup<"private-extern">;
452def SelTypeCast : DiagGroup<"cast-of-sel-type">;
453def FunctionDefInObjCContainer : DiagGroup<"function-def-in-objc-container">;
454def BadFunctionCast : DiagGroup<"bad-function-cast">;
455def ObjCPropertyImpl : DiagGroup<"objc-property-implementation">;
456def ObjCPropertyNoAttribute : DiagGroup<"objc-property-no-attribute">;
457def ObjCPropertyAssignOnObjectType : DiagGroup<"objc-property-assign-on-object-type">;
458def ObjCProtocolQualifiers : DiagGroup<"objc-protocol-qualifiers">;
459def ObjCMissingSuperCalls : DiagGroup<"objc-missing-super-calls">;
460def ObjCDesignatedInit : DiagGroup<"objc-designated-initializers">;
461def ObjCRetainBlockProperty : DiagGroup<"objc-noncopy-retain-block-property">;
462def ObjCReadonlyPropertyHasSetter : DiagGroup<"objc-readonly-with-setter-property">;
463def ObjCInvalidIBOutletProperty : DiagGroup<"invalid-iboutlet">;
464def ObjCRootClass : DiagGroup<"objc-root-class">;
465def ObjCPointerIntrospectPerformSelector : DiagGroup<"deprecated-objc-pointer-introspection-performSelector">;
466def ObjCPointerIntrospect : DiagGroup<"deprecated-objc-pointer-introspection", [ObjCPointerIntrospectPerformSelector]>;
467def ObjCMultipleMethodNames : DiagGroup<"objc-multiple-method-names">;
468def ObjCFlexibleArray : DiagGroup<"objc-flexible-array">;
469def ObjCBoxing : DiagGroup<"objc-boxing">;
470def OpenCLUnsupportedRGBA: DiagGroup<"opencl-unsupported-rgba">;
471def UnderalignedExceptionObject : DiagGroup<"underaligned-exception-object">;
472def DeprecatedObjCIsaUsage : DiagGroup<"deprecated-objc-isa-usage">;
473def ExplicitInitializeCall : DiagGroup<"explicit-initialize-call">;
474def Packed : DiagGroup<"packed">;
475def Padded : DiagGroup<"padded">;
476
477def PessimizingMove : DiagGroup<"pessimizing-move">;
478def ReturnStdMoveInCXX11 : DiagGroup<"return-std-move-in-c++11">;
479def ReturnStdMove : DiagGroup<"return-std-move">;
480
481def PointerArith : DiagGroup<"pointer-arith">;
482def PoundWarning : DiagGroup<"#warnings">;
483def PoundPragmaMessage : DiagGroup<"#pragma-messages">,
484                         DiagCategory<"#pragma message Directive">;
485def : DiagGroup<"pointer-to-int-cast">;
486def : DiagGroup<"redundant-decls">;
487def RedeclaredClassMember : DiagGroup<"redeclared-class-member">;
488def GNURedeclaredEnum : DiagGroup<"gnu-redeclared-enum">;
489def RedundantMove : DiagGroup<"redundant-move">;
490def Register : DiagGroup<"register", [DeprecatedRegister]>;
491def ReturnTypeCLinkage : DiagGroup<"return-type-c-linkage">;
492def ReturnType : DiagGroup<"return-type", [ReturnTypeCLinkage]>;
493def BindToTemporaryCopy : DiagGroup<"bind-to-temporary-copy",
494                                    [CXX98CompatBindToTemporaryCopy]>;
495def SelfAssignmentField : DiagGroup<"self-assign-field">;
496def SelfAssignmentOverloaded : DiagGroup<"self-assign-overloaded">;
497def SelfAssignment : DiagGroup<"self-assign", [SelfAssignmentOverloaded, SelfAssignmentField]>;
498def SelfMove : DiagGroup<"self-move">;
499def SemiBeforeMethodBody : DiagGroup<"semicolon-before-method-body">;
500def Sentinel : DiagGroup<"sentinel">;
501def MissingMethodReturnType : DiagGroup<"missing-method-return-type">;
502
503def ShadowField : DiagGroup<"shadow-field">;
504def ShadowFieldInConstructorModified : DiagGroup<"shadow-field-in-constructor-modified">;
505def ShadowFieldInConstructor : DiagGroup<"shadow-field-in-constructor",
506                                         [ShadowFieldInConstructorModified]>;
507def ShadowIvar : DiagGroup<"shadow-ivar">;
508def ShadowUncapturedLocal : DiagGroup<"shadow-uncaptured-local">;
509
510// -Wshadow-all is a catch-all for all shadowing. -Wshadow is just the
511// shadowing that we think is unsafe.
512def Shadow : DiagGroup<"shadow", [ShadowFieldInConstructorModified,
513                                  ShadowIvar]>;
514def ShadowAll : DiagGroup<"shadow-all", [Shadow, ShadowFieldInConstructor,
515                                         ShadowUncapturedLocal, ShadowField]>;
516
517def Shorten64To32 : DiagGroup<"shorten-64-to-32">;
518def : DiagGroup<"sign-promo">;
519def SignCompare : DiagGroup<"sign-compare">;
520def : DiagGroup<"stack-protector">;
521def : DiagGroup<"switch-default">;
522def : DiagGroup<"synth">;
523def SizeofArrayArgument : DiagGroup<"sizeof-array-argument">;
524def SizeofArrayDecay : DiagGroup<"sizeof-array-decay">;
525def SizeofPointerMemaccess : DiagGroup<"sizeof-pointer-memaccess">;
526def MemsetTransposedArgs : DiagGroup<"memset-transposed-args">;
527def DynamicClassMemaccess : DiagGroup<"dynamic-class-memaccess">;
528def NonTrivialMemaccess : DiagGroup<"nontrivial-memaccess">;
529def SuspiciousBzero : DiagGroup<"suspicious-bzero">;
530def SuspiciousMemaccess : DiagGroup<"suspicious-memaccess",
531  [SizeofPointerMemaccess, DynamicClassMemaccess,
532   NonTrivialMemaccess, MemsetTransposedArgs, SuspiciousBzero]>;
533def StaticInInline : DiagGroup<"static-in-inline">;
534def StaticLocalInInline : DiagGroup<"static-local-in-inline">;
535def GNUStaticFloatInit : DiagGroup<"gnu-static-float-init">;
536def StaticFloatInit : DiagGroup<"static-float-init", [GNUStaticFloatInit]>;
537def GNUStatementExpression : DiagGroup<"gnu-statement-expression">;
538def StringCompare : DiagGroup<"string-compare">;
539def StringPlusInt : DiagGroup<"string-plus-int">;
540def StringPlusChar : DiagGroup<"string-plus-char">;
541def StrncatSize : DiagGroup<"strncat-size">;
542def IntInBoolContext : DiagGroup<"int-in-bool-context">;
543def TautologicalTypeLimitCompare : DiagGroup<"tautological-type-limit-compare">;
544def TautologicalUnsignedZeroCompare : DiagGroup<"tautological-unsigned-zero-compare">;
545def TautologicalUnsignedEnumZeroCompare : DiagGroup<"tautological-unsigned-enum-zero-compare">;
546def TautologicalInRangeCompare : DiagGroup<"tautological-constant-in-range-compare",
547                                           [TautologicalTypeLimitCompare,
548                                            TautologicalUnsignedZeroCompare,
549                                            TautologicalUnsignedEnumZeroCompare]>;
550// For compatibility with GCC; -Wtype-limits = -Wtautological-constant-in-range-compare
551def TypeLimits : DiagGroup<"type-limits", [TautologicalInRangeCompare]>;
552def TautologicalOutOfRangeCompare : DiagGroup<"tautological-constant-out-of-range-compare">;
553def TautologicalConstantCompare : DiagGroup<"tautological-constant-compare",
554                                            [TautologicalOutOfRangeCompare]>;
555def TautologicalPointerCompare : DiagGroup<"tautological-pointer-compare">;
556def TautologicalOverlapCompare : DiagGroup<"tautological-overlap-compare">;
557def TautologicalBitwiseCompare : DiagGroup<"tautological-bitwise-compare">;
558def TautologicalUndefinedCompare : DiagGroup<"tautological-undefined-compare">;
559def TautologicalObjCBoolCompare : DiagGroup<"tautological-objc-bool-compare">;
560def TautologicalCompare : DiagGroup<"tautological-compare",
561                                    [TautologicalConstantCompare,
562                                     TautologicalPointerCompare,
563                                     TautologicalOverlapCompare,
564                                     TautologicalBitwiseCompare,
565                                     TautologicalUndefinedCompare,
566                                     TautologicalObjCBoolCompare]>;
567def HeaderHygiene : DiagGroup<"header-hygiene">;
568def DuplicateDeclSpecifier : DiagGroup<"duplicate-decl-specifier">;
569def CompareDistinctPointerType : DiagGroup<"compare-distinct-pointer-types">;
570def GNUUnionCast : DiagGroup<"gnu-union-cast">;
571def GNUVariableSizedTypeNotAtEnd : DiagGroup<"gnu-variable-sized-type-not-at-end">;
572def Varargs : DiagGroup<"varargs">;
573def XorUsedAsPow : DiagGroup<"xor-used-as-pow">;
574
575def Unsequenced : DiagGroup<"unsequenced">;
576// GCC name for -Wunsequenced
577def : DiagGroup<"sequence-point", [Unsequenced]>;
578
579// Preprocessor warnings.
580def AmbiguousMacro : DiagGroup<"ambiguous-macro">;
581def KeywordAsMacro : DiagGroup<"keyword-macro">;
582def ReservedIdAsMacro : DiagGroup<"reserved-id-macro">;
583
584// Just silence warnings about -Wstrict-aliasing for now.
585def : DiagGroup<"strict-aliasing=0">;
586def : DiagGroup<"strict-aliasing=1">;
587def : DiagGroup<"strict-aliasing=2">;
588def : DiagGroup<"strict-aliasing">;
589
590// Just silence warnings about -Wstrict-overflow for now.
591def : DiagGroup<"strict-overflow=0">;
592def : DiagGroup<"strict-overflow=1">;
593def : DiagGroup<"strict-overflow=2">;
594def : DiagGroup<"strict-overflow=3">;
595def : DiagGroup<"strict-overflow=4">;
596def : DiagGroup<"strict-overflow=5">;
597def : DiagGroup<"strict-overflow">;
598
599def InvalidOffsetof : DiagGroup<"invalid-offsetof">;
600def : DiagGroup<"strict-prototypes">;
601def StrictSelector : DiagGroup<"strict-selector-match">;
602def MethodDuplicate : DiagGroup<"duplicate-method-match">;
603def ObjCCStringFormat : DiagGroup<"cstring-format-directive">;
604def CoveredSwitchDefault : DiagGroup<"covered-switch-default">;
605def SwitchBool     : DiagGroup<"switch-bool">;
606def SwitchEnum     : DiagGroup<"switch-enum">;
607def Switch         : DiagGroup<"switch">;
608def ImplicitFallthroughPerFunction :
609  DiagGroup<"implicit-fallthrough-per-function">;
610def ImplicitFallthrough  : DiagGroup<"implicit-fallthrough",
611                                     [ImplicitFallthroughPerFunction]>;
612def InvalidPPToken : DiagGroup<"invalid-pp-token">;
613def Trigraphs      : DiagGroup<"trigraphs">;
614
615def : DiagGroup<"type-limits">;
616def UndefinedReinterpretCast : DiagGroup<"undefined-reinterpret-cast">;
617def ReinterpretBaseClass : DiagGroup<"reinterpret-base-class">;
618def Unicode  : DiagGroup<"unicode">;
619def UninitializedMaybe : DiagGroup<"conditional-uninitialized">;
620def UninitializedSometimes : DiagGroup<"sometimes-uninitialized">;
621def UninitializedStaticSelfInit : DiagGroup<"static-self-init">;
622def Uninitialized  : DiagGroup<"uninitialized", [UninitializedSometimes,
623                                                 UninitializedStaticSelfInit]>;
624def IgnoredPragmaIntrinsic : DiagGroup<"ignored-pragma-intrinsic">;
625// #pragma optimize is often used to avoid to work around MSVC codegen bugs or
626// to disable inlining. It's not completely clear what alternative to suggest
627// (#pragma clang optimize, noinline) so suggest nothing for now.
628def IgnoredPragmaOptimize : DiagGroup<"ignored-pragma-optimize">;
629def UnknownPragmas : DiagGroup<"unknown-pragmas">;
630def IgnoredPragmas : DiagGroup<"ignored-pragmas",
631    [IgnoredPragmaIntrinsic, IgnoredPragmaOptimize]>;
632def PragmaClangAttribute : DiagGroup<"pragma-clang-attribute">;
633def PragmaPackSuspiciousInclude : DiagGroup<"pragma-pack-suspicious-include">;
634def PragmaPack : DiagGroup<"pragma-pack", [PragmaPackSuspiciousInclude]>;
635def Pragmas : DiagGroup<"pragmas", [UnknownPragmas, IgnoredPragmas,
636                                    PragmaClangAttribute, PragmaPack]>;
637def UnknownWarningOption : DiagGroup<"unknown-warning-option">;
638def NSobjectAttribute : DiagGroup<"NSObject-attribute">;
639def NSConsumedMismatch : DiagGroup<"nsconsumed-mismatch">;
640def NSReturnsMismatch : DiagGroup<"nsreturns-mismatch">;
641
642def IndependentClassAttribute : DiagGroup<"IndependentClass-attribute">;
643def UnknownAttributes : DiagGroup<"unknown-attributes">;
644def IgnoredAttributes : DiagGroup<"ignored-attributes">;
645def Attributes : DiagGroup<"attributes", [UnknownAttributes,
646                                          IgnoredAttributes]>;
647def UnknownSanitizers : DiagGroup<"unknown-sanitizers">;
648def UnnamedTypeTemplateArgs : DiagGroup<"unnamed-type-template-args",
649                                        [CXX98CompatUnnamedTypeTemplateArgs]>;
650def UnsupportedFriend : DiagGroup<"unsupported-friend">;
651def UnusedArgument : DiagGroup<"unused-argument">;
652def UnusedCommandLineArgument : DiagGroup<"unused-command-line-argument">;
653def IgnoredOptimizationArgument : DiagGroup<"ignored-optimization-argument">;
654def InvalidCommandLineArgument : DiagGroup<"invalid-command-line-argument",
655                                           [IgnoredOptimizationArgument]>;
656def UnusedComparison : DiagGroup<"unused-comparison">;
657def UnusedExceptionParameter : DiagGroup<"unused-exception-parameter">;
658def UnneededInternalDecl : DiagGroup<"unneeded-internal-declaration">;
659def UnneededMemberFunction : DiagGroup<"unneeded-member-function">;
660def UnusedPrivateField : DiagGroup<"unused-private-field">;
661def UnusedFunction : DiagGroup<"unused-function", [UnneededInternalDecl]>;
662def UnusedTemplate : DiagGroup<"unused-template", [UnneededInternalDecl]>;
663def UnusedMemberFunction : DiagGroup<"unused-member-function",
664                                     [UnneededMemberFunction]>;
665def UnusedLabel : DiagGroup<"unused-label">;
666def UnusedLambdaCapture : DiagGroup<"unused-lambda-capture">;
667def UnusedParameter : DiagGroup<"unused-parameter">;
668def UnusedResult : DiagGroup<"unused-result">;
669def PotentiallyEvaluatedExpression : DiagGroup<"potentially-evaluated-expression">;
670def UnevaluatedExpression : DiagGroup<"unevaluated-expression",
671                                      [PotentiallyEvaluatedExpression]>;
672def UnusedValue : DiagGroup<"unused-value", [UnusedComparison, UnusedResult,
673                                             UnevaluatedExpression]>;
674def UnusedConstVariable : DiagGroup<"unused-const-variable">;
675def UnusedVariable : DiagGroup<"unused-variable",
676                               [UnusedConstVariable]>;
677def UnusedLocalTypedef : DiagGroup<"unused-local-typedef">;
678def UnusedPropertyIvar :  DiagGroup<"unused-property-ivar">;
679def UnusedGetterReturnValue : DiagGroup<"unused-getter-return-value">;
680def UsedButMarkedUnused : DiagGroup<"used-but-marked-unused">;
681def UserDefinedLiterals : DiagGroup<"user-defined-literals">;
682def UserDefinedWarnings : DiagGroup<"user-defined-warnings">;
683def ReorderCtor : DiagGroup<"reorder-ctor">;
684def ReorderInitList : DiagGroup<"reorder-init-list">;
685def Reorder : DiagGroup<"reorder", [ReorderCtor, ReorderInitList]>;
686def UndeclaredSelector : DiagGroup<"undeclared-selector">;
687def ImplicitAtomic : DiagGroup<"implicit-atomic-properties">;
688def CustomAtomic : DiagGroup<"custom-atomic-properties">;
689def AtomicProperties : DiagGroup<"atomic-properties",
690                                 [ImplicitAtomic, CustomAtomic]>;
691def ARCUnsafeRetainedAssign : DiagGroup<"arc-unsafe-retained-assign">;
692def ARCRetainCycles : DiagGroup<"arc-retain-cycles">;
693def ARCNonPodMemAccess : DiagGroup<"arc-non-pod-memaccess">;
694def AutomaticReferenceCounting : DiagGroup<"arc",
695                                           [ARCUnsafeRetainedAssign,
696                                            ARCRetainCycles,
697                                            ARCNonPodMemAccess]>;
698def ARCRepeatedUseOfWeakMaybe : DiagGroup<"arc-maybe-repeated-use-of-weak">;
699def ARCRepeatedUseOfWeak : DiagGroup<"arc-repeated-use-of-weak",
700                                     [ARCRepeatedUseOfWeakMaybe]>;
701def BlockCaptureAutoReleasing : DiagGroup<"block-capture-autoreleasing">;
702def ObjCBridge : DiagGroup<"bridge-cast">;
703
704def DeallocInCategory:DiagGroup<"dealloc-in-category">;
705def SelectorTypeMismatch : DiagGroup<"selector-type-mismatch">;
706def Selector : DiagGroup<"selector", [SelectorTypeMismatch]>;
707def Protocol : DiagGroup<"protocol">;
708// No longer in use, preserve for backwards compatibility.
709def : DiagGroup<"at-protocol">;
710def PropertyAccessDotSyntax: DiagGroup<"property-access-dot-syntax">;
711def PropertyAttr : DiagGroup<"property-attribute-mismatch">;
712def SuperSubClassMismatch : DiagGroup<"super-class-method-mismatch">;
713def OverridingMethodMismatch : DiagGroup<"overriding-method-mismatch">;
714def VariadicMacros : DiagGroup<"variadic-macros">;
715def VectorConversion : DiagGroup<"vector-conversion">;      // clang specific
716def VexingParse : DiagGroup<"vexing-parse">;
717def VLA : DiagGroup<"vla">;
718def VLAExtension : DiagGroup<"vla-extension">;
719def VolatileRegisterVar : DiagGroup<"volatile-register-var">;
720def Visibility : DiagGroup<"visibility">;
721def ZeroLengthArray : DiagGroup<"zero-length-array">;
722def GNUZeroLineDirective : DiagGroup<"gnu-zero-line-directive">;
723def GNUZeroVariadicMacroArguments : DiagGroup<"gnu-zero-variadic-macro-arguments">;
724def Fallback : DiagGroup<"fallback">;
725def MisleadingIndentation : DiagGroup<"misleading-indentation">;
726
727// This covers both the deprecated case (in C++98)
728// and the extension case (in C++11 onwards).
729def WritableStrings : DiagGroup<"writable-strings", [DeprecatedWritableStr]>;
730
731// GCC calls -Wdeprecated-writable-strings -Wwrite-strings.
732//
733// Bizarrely, this warning flag enables -fconst-strings in C. This is
734// GCC-compatible, but really weird.
735//
736// FIXME: Should this affect C++11 (where this is an error,
737//        not just deprecated) or not?
738def GCCWriteStrings : DiagGroup<"write-strings" , [WritableStrings]>;
739
740def CharSubscript : DiagGroup<"char-subscripts">;
741def LargeByValueCopy : DiagGroup<"large-by-value-copy">;
742def DuplicateArgDecl : DiagGroup<"duplicate-method-arg">;
743def SignedEnumBitfield : DiagGroup<"signed-enum-bitfield">;
744
745// Unreachable code warning groups.
746//
747//  The goal is make -Wunreachable-code on by default, in -Wall, or at
748//  least actively used, with more noisy versions of the warning covered
749//  under separate flags.
750//
751def UnreachableCodeLoopIncrement : DiagGroup<"unreachable-code-loop-increment">;
752def UnreachableCode : DiagGroup<"unreachable-code",
753                                [UnreachableCodeLoopIncrement]>;
754def UnreachableCodeBreak : DiagGroup<"unreachable-code-break">;
755def UnreachableCodeReturn : DiagGroup<"unreachable-code-return">;
756def UnreachableCodeAggressive : DiagGroup<"unreachable-code-aggressive",
757                                    [UnreachableCode,
758                                     UnreachableCodeBreak,
759                                     UnreachableCodeReturn]>;
760
761// Aggregation warning settings.
762
763// Populate -Waddress with warnings from other groups.
764def : DiagGroup<"address", [PointerBoolConversion,
765                            StringCompare,
766                            TautologicalPointerCompare]>;
767
768// -Widiomatic-parentheses contains warnings about 'idiomatic'
769// missing parentheses;  it is off by default.  We do not include it
770// in -Wparentheses because most users who use -Wparentheses explicitly
771// do not want these warnings.
772def ParenthesesOnEquality : DiagGroup<"parentheses-equality">;
773def Parentheses : DiagGroup<"parentheses",
774                            [LogicalOpParentheses,
775                             LogicalNotParentheses,
776                             BitwiseConditionalParentheses,
777                             BitwiseOpParentheses,
778                             ShiftOpParentheses,
779                             OverloadedShiftOpParentheses,
780                             ParenthesesOnEquality,
781                             DanglingElse]>;
782
783// -Wconversion has its own warnings, but we split a few out for
784// legacy reasons:
785//   - some people want just 64-to-32 warnings
786//   - conversion warnings with constant sources are on by default
787//   - conversion warnings for literals are on by default
788//   - bool-to-pointer conversion warnings are on by default
789//   - __null-to-integer conversion warnings are on by default
790def Conversion : DiagGroup<"conversion",
791                           [BoolConversion,
792                            ConstantConversion,
793                            EnumConversion,
794                            BitFieldEnumConversion,
795                            FloatConversion,
796                            Shorten64To32,
797                            IntConversion,
798                            ImplicitIntConversion,
799                            ImplicitFloatConversion,
800                            LiteralConversion,
801                            NonLiteralNullConversion, // (1-1)->pointer (etc)
802                            NullConversion, // NULL->non-pointer
803                            ObjCLiteralConversion,
804                            SignConversion,
805                            StringConversion]>,
806                 DiagCategory<"Value Conversion Issue">;
807
808def Unused : DiagGroup<"unused",
809                       [UnusedArgument, UnusedFunction, UnusedLabel,
810                        // UnusedParameter, (matches GCC's behavior)
811                        // UnusedTemplate, (clean-up libc++ before enabling)
812                        // UnusedMemberFunction, (clean-up llvm before enabling)
813                        UnusedPrivateField, UnusedLambdaCapture,
814                        UnusedLocalTypedef, UnusedValue, UnusedVariable,
815                        UnusedPropertyIvar]>,
816                        DiagCategory<"Unused Entity Issue">;
817
818// Format settings.
819def FormatInvalidSpecifier : DiagGroup<"format-invalid-specifier">;
820def FormatSecurity : DiagGroup<"format-security">;
821def FormatNonStandard : DiagGroup<"format-non-iso">;
822def FormatY2K : DiagGroup<"format-y2k">;
823def FormatPedantic : DiagGroup<"format-pedantic">;
824def FormatTypeConfusion : DiagGroup<"format-type-confusion">;
825def Format : DiagGroup<"format",
826                       [FormatExtraArgs, FormatZeroLength, NonNull,
827                        FormatSecurity, FormatY2K, FormatInvalidSpecifier]>,
828             DiagCategory<"Format String Issue">;
829def FormatNonLiteral : DiagGroup<"format-nonliteral">;
830def Format2 : DiagGroup<"format=2",
831                        [FormatNonLiteral, FormatSecurity, FormatY2K]>;
832
833def TypeSafety : DiagGroup<"type-safety">;
834
835def IncompatibleExceptionSpec : DiagGroup<"incompatible-exception-spec">;
836
837def IntToVoidPointerCast : DiagGroup<"int-to-void-pointer-cast">;
838def IntToPointerCast : DiagGroup<"int-to-pointer-cast",
839                                 [IntToVoidPointerCast]>;
840
841def Move : DiagGroup<"move", [
842    PessimizingMove,
843    RedundantMove,
844    ReturnStdMove,
845    SelfMove
846  ]>;
847
848def Extra : DiagGroup<"extra", [
849    DeprecatedCopy,
850    MissingFieldInitializers,
851    IgnoredQualifiers,
852    InitializerOverrides,
853    SemiBeforeMethodBody,
854    MissingMethodReturnType,
855    SignCompare,
856    UnusedParameter,
857    NullPointerArithmetic,
858    EmptyInitStatement
859  ]>;
860
861def Most : DiagGroup<"most", [
862    CharSubscript,
863    Comment,
864    DeleteNonVirtualDtor,
865    Format,
866    ForLoopAnalysis,
867    Implicit,
868    InfiniteRecursion,
869    IntInBoolContext,
870    MismatchedTags,
871    MissingBraces,
872    Move,
873    MultiChar,
874    RangeLoopConstruct,
875    Reorder,
876    ReturnType,
877    SelfAssignment,
878    SelfMove,
879    SizeofArrayArgument,
880    SizeofArrayDecay,
881    StringPlusInt,
882    TautologicalCompare,
883    Trigraphs,
884    Uninitialized,
885    UnknownPragmas,
886    Unused,
887    VolatileRegisterVar,
888    ObjCMissingSuperCalls,
889    ObjCDesignatedInit,
890    ObjCFlexibleArray,
891    OverloadedVirtual,
892    PrivateExtern,
893    SelTypeCast,
894    ExternCCompat,
895    UserDefinedWarnings
896 ]>;
897
898// Thread Safety warnings
899def ThreadSafetyAttributes : DiagGroup<"thread-safety-attributes">;
900def ThreadSafetyAnalysis   : DiagGroup<"thread-safety-analysis">;
901def ThreadSafetyPrecise    : DiagGroup<"thread-safety-precise">;
902def ThreadSafetyReference  : DiagGroup<"thread-safety-reference">;
903def ThreadSafetyNegative   : DiagGroup<"thread-safety-negative">;
904def ThreadSafety : DiagGroup<"thread-safety",
905                             [ThreadSafetyAttributes,
906                              ThreadSafetyAnalysis,
907                              ThreadSafetyPrecise,
908                              ThreadSafetyReference]>;
909def ThreadSafetyVerbose : DiagGroup<"thread-safety-verbose">;
910def ThreadSafetyBeta : DiagGroup<"thread-safety-beta">;
911
912// Uniqueness Analysis warnings
913def Consumed       : DiagGroup<"consumed">;
914
915// Note that putting warnings in -Wall will not disable them by default. If a
916// warning should be active _only_ when -Wall is passed in, mark it as
917// DefaultIgnore in addition to putting it here.
918def All : DiagGroup<"all", [Most, Parentheses, Switch, SwitchBool, MisleadingIndentation]>;
919
920// Warnings that should be in clang-cl /w4.
921def : DiagGroup<"CL4", [All, Extra]>;
922
923// Warnings enabled by -pedantic.  This is magically filled in by TableGen.
924def Pedantic : DiagGroup<"pedantic">;
925
926// Aliases.
927def : DiagGroup<"", [Extra]>;                   // -W = -Wextra
928def : DiagGroup<"endif-labels", [ExtraTokens]>; // -Wendif-labels=-Wextra-tokens
929def : DiagGroup<"cpp", [PoundWarning]>;         // -Wcpp = -W#warnings
930def : DiagGroup<"comments", [Comment]>;         // -Wcomments = -Wcomment
931def : DiagGroup<"conversion-null",
932                [NullConversion]>; // -Wconversion-null = -Wnull-conversion
933def : DiagGroup<"bool-conversions",
934                [BoolConversion]>; // -Wbool-conversions  = -Wbool-conversion
935def : DiagGroup<"int-conversions",
936                [IntConversion]>; // -Wint-conversions = -Wint-conversion
937def : DiagGroup<"vector-conversions",
938                [VectorConversion]>; // -Wvector-conversions = -Wvector-conversion
939def : DiagGroup<"unused-local-typedefs", [UnusedLocalTypedef]>;
940                // -Wunused-local-typedefs = -Wunused-local-typedef
941
942// A warning group for warnings that we want to have on by default in clang,
943// but which aren't on by default in GCC.
944def NonGCC : DiagGroup<"non-gcc",
945    [SignCompare, Conversion, LiteralRange]>;
946
947// A warning group for warnings about using C++11 features as extensions in
948// earlier C++ versions.
949def CXX11 : DiagGroup<"c++11-extensions", [CXX11ExtraSemi, CXX11InlineNamespace,
950                                           CXX11LongLong]>;
951
952// A warning group for warnings about using C++14 features as extensions in
953// earlier C++ versions.
954def CXX14 : DiagGroup<"c++14-extensions", [CXX14BinaryLiteral]>;
955
956// A warning group for warnings about using C++17 features as extensions in
957// earlier C++ versions.
958def CXX17 : DiagGroup<"c++17-extensions">;
959
960// A warning group for warnings about using C++20 features as extensions in
961// earlier C++ versions.
962def CXX20 : DiagGroup<"c++20-extensions", [CXX20Designator]>;
963
964def : DiagGroup<"c++0x-extensions", [CXX11]>;
965def : DiagGroup<"c++1y-extensions", [CXX14]>;
966def : DiagGroup<"c++1z-extensions", [CXX17]>;
967def : DiagGroup<"c++2a-extensions", [CXX20]>;
968
969def DelegatingCtorCycles :
970  DiagGroup<"delegating-ctor-cycles">;
971
972// A warning group for warnings about using C11 features as extensions.
973def C11 : DiagGroup<"c11-extensions">;
974
975// A warning group for warnings about using C99 features as extensions.
976def C99 : DiagGroup<"c99-extensions", [C99Designator]>;
977
978// A warning group for warnings about GCC extensions.
979def GNU : DiagGroup<"gnu", [GNUAlignofExpression, GNUAnonymousStruct,
980                            GNUAutoType,
981                            GNUBinaryLiteral, GNUCaseRange,
982                            GNUComplexInteger, GNUCompoundLiteralInitializer,
983                            GNUConditionalOmittedOperand, GNUDesignator,
984                            GNUEmptyInitializer, GNUEmptyStruct,
985                            VLAExtension, GNUFlexibleArrayInitializer,
986                            GNUFlexibleArrayUnionMember, GNUFoldingConstant,
987                            GNUImaginaryConstant, GNUIncludeNext,
988                            GNULabelsAsValue,
989                            RedeclaredClassMember, GNURedeclaredEnum,
990                            GNUStatementExpression, GNUStaticFloatInit,
991                            GNUStringLiteralOperatorTemplate,
992                            GNUUnionCast, GNUVariableSizedTypeNotAtEnd,
993                            ZeroLengthArray, GNUZeroLineDirective,
994                            GNUZeroVariadicMacroArguments]>;
995// A warning group for warnings about code that clang accepts but gcc doesn't.
996def GccCompat : DiagGroup<"gcc-compat">;
997
998// Warnings for Microsoft extensions.
999def MicrosoftCharize : DiagGroup<"microsoft-charize">;
1000def MicrosoftDrectveSection : DiagGroup<"microsoft-drectve-section">;
1001def MicrosoftInclude : DiagGroup<"microsoft-include">;
1002def MicrosoftCppMacro : DiagGroup<"microsoft-cpp-macro">;
1003def MicrosoftFixedEnum : DiagGroup<"microsoft-fixed-enum">;
1004def MicrosoftSealed : DiagGroup<"microsoft-sealed">;
1005def MicrosoftUnqualifiedFriend : DiagGroup<"microsoft-unqualified-friend">;
1006def MicrosoftExceptionSpec : DiagGroup<"microsoft-exception-spec">;
1007def MicrosoftUsingDecl : DiagGroup<"microsoft-using-decl">;
1008def MicrosoftMutableReference : DiagGroup<"microsoft-mutable-reference">;
1009def MicrosoftPureDefinition : DiagGroup<"microsoft-pure-definition">;
1010def MicrosoftUnionMemberReference : DiagGroup<
1011    "microsoft-union-member-reference">;
1012def MicrosoftExplicitConstructorCall : DiagGroup<
1013    "microsoft-explicit-constructor-call">;
1014def MicrosoftEnumValue : DiagGroup<"microsoft-enum-value">;
1015def MicrosoftDefaultArgRedefinition :
1016    DiagGroup<"microsoft-default-arg-redefinition">;
1017def MicrosoftTemplateShadow : DiagGroup<"microsoft-template-shadow">;
1018def MicrosoftTemplate : DiagGroup<"microsoft-template", [MicrosoftTemplateShadow]>;
1019def MicrosoftInconsistentDllImport : DiagGroup<"inconsistent-dllimport">;
1020def MicrosoftRedeclareStatic : DiagGroup<"microsoft-redeclare-static">;
1021def MicrosoftEnumForwardReference :
1022    DiagGroup<"microsoft-enum-forward-reference">;
1023def MicrosoftGoto : DiagGroup<"microsoft-goto">;
1024def MicrosoftFlexibleArray : DiagGroup<"microsoft-flexible-array">;
1025def MicrosoftExtraQualification : DiagGroup<"microsoft-extra-qualification">;
1026def MicrosoftCast : DiagGroup<"microsoft-cast">;
1027def MicrosoftConstInit : DiagGroup<"microsoft-const-init">;
1028def MicrosoftVoidPseudoDtor : DiagGroup<"microsoft-void-pseudo-dtor">;
1029def MicrosoftAnonTag : DiagGroup<"microsoft-anon-tag">;
1030def MicrosoftCommentPaste : DiagGroup<"microsoft-comment-paste">;
1031def MicrosoftEndOfFile : DiagGroup<"microsoft-end-of-file">;
1032def MicrosoftInaccessibleBase : DiagGroup<"microsoft-inaccessible-base">;
1033// Aliases.
1034def : DiagGroup<"msvc-include", [MicrosoftInclude]>;
1035                // -Wmsvc-include = -Wmicrosoft-include
1036
1037// Warnings group for warnings about Microsoft extensions.
1038def Microsoft : DiagGroup<"microsoft",
1039    [MicrosoftCharize, MicrosoftDrectveSection, MicrosoftInclude,
1040     MicrosoftCppMacro, MicrosoftFixedEnum, MicrosoftSealed,
1041     MicrosoftUnqualifiedFriend, MicrosoftExceptionSpec, MicrosoftUsingDecl,
1042     MicrosoftMutableReference, MicrosoftPureDefinition,
1043     MicrosoftUnionMemberReference, MicrosoftExplicitConstructorCall,
1044     MicrosoftEnumValue, MicrosoftDefaultArgRedefinition, MicrosoftTemplate,
1045     MicrosoftRedeclareStatic, MicrosoftEnumForwardReference, MicrosoftGoto,
1046     MicrosoftFlexibleArray, MicrosoftExtraQualification, MicrosoftCast,
1047     MicrosoftConstInit, MicrosoftVoidPseudoDtor, MicrosoftAnonTag,
1048     MicrosoftCommentPaste, MicrosoftEndOfFile,
1049     MicrosoftInconsistentDllImport]>;
1050
1051def ClangClPch : DiagGroup<"clang-cl-pch">;
1052
1053def ObjCNonUnifiedException : DiagGroup<"objc-nonunified-exceptions">;
1054
1055def ObjCProtocolMethodImpl : DiagGroup<"objc-protocol-method-implementation">;
1056
1057def ObjCNoPropertyAutoSynthesis : DiagGroup<"objc-property-synthesis">;
1058
1059// ObjC API warning groups.
1060def ObjCRedundantLiteralUse : DiagGroup<"objc-redundant-literal-use">;
1061def ObjCRedundantAPIUse : DiagGroup<"objc-redundant-api-use", [
1062    ObjCRedundantLiteralUse
1063  ]>;
1064
1065def ObjCCocoaAPI : DiagGroup<"objc-cocoa-api", [
1066    ObjCRedundantAPIUse
1067  ]>;
1068
1069def ObjCStringComparison : DiagGroup<"objc-string-compare">;
1070def ObjCStringConcatenation : DiagGroup<"objc-string-concatenation">;
1071def ObjCLiteralComparison : DiagGroup<"objc-literal-compare", [
1072    ObjCStringComparison
1073  ]>;
1074
1075def ObjCSignedCharBool : DiagGroup<"objc-signed-char-bool",
1076  [ObjCSignedCharBoolImplicitIntConversion,
1077   ObjCSignedCharBoolImplicitFloatConversion,
1078   ObjCBoolConstantConversion,
1079   TautologicalObjCBoolCompare]>;
1080
1081// Inline ASM warnings.
1082def ASMOperandWidths : DiagGroup<"asm-operand-widths">;
1083def ASMIgnoredQualifier : DiagGroup<"asm-ignored-qualifier">;
1084def ASM : DiagGroup<"asm", [
1085    ASMOperandWidths, ASMIgnoredQualifier
1086  ]>;
1087
1088// OpenMP warnings.
1089def SourceUsesOpenMP : DiagGroup<"source-uses-openmp">;
1090def OpenMPClauses : DiagGroup<"openmp-clauses">;
1091def OpenMPLoopForm : DiagGroup<"openmp-loop-form">;
1092def OpenMPMapping : DiagGroup<"openmp-mapping">;
1093def OpenMPTarget : DiagGroup<"openmp-target", [OpenMPMapping]>;
1094def OpenMP : DiagGroup<"openmp", [
1095    SourceUsesOpenMP, OpenMPClauses, OpenMPLoopForm, OpenMPTarget, OpenMPMapping
1096  ]>;
1097
1098// Backend warnings.
1099def BackendInlineAsm : DiagGroup<"inline-asm">;
1100def BackendFrameLargerThanEQ : DiagGroup<"frame-larger-than=">;
1101def BackendPlugin : DiagGroup<"backend-plugin">;
1102def RemarkBackendPlugin : DiagGroup<"remark-backend-plugin">;
1103def BackendOptimizationRemark : DiagGroup<"pass">;
1104def BackendOptimizationRemarkMissed : DiagGroup<"pass-missed">;
1105def BackendOptimizationRemarkAnalysis : DiagGroup<"pass-analysis">;
1106def BackendOptimizationFailure : DiagGroup<"pass-failed">;
1107
1108// Instrumentation based profiling warnings.
1109def ProfileInstrMissing : DiagGroup<"profile-instr-missing">;
1110def ProfileInstrOutOfDate : DiagGroup<"profile-instr-out-of-date">;
1111def ProfileInstrUnprofiled : DiagGroup<"profile-instr-unprofiled">;
1112def MisExpect : DiagGroup<"misexpect">;
1113
1114// AddressSanitizer frontend instrumentation remarks.
1115def SanitizeAddressRemarks : DiagGroup<"sanitize-address">;
1116
1117// Issues with serialized diagnostics.
1118def SerializedDiagnostics : DiagGroup<"serialized-diagnostics">;
1119
1120// A warning group for warnings about code that clang accepts when
1121// compiling CUDA C/C++ but which is not compatible with the CUDA spec.
1122def CudaCompat : DiagGroup<"cuda-compat">;
1123
1124// Warning about unknown CUDA SDK version.
1125def CudaUnknownVersion: DiagGroup<"unknown-cuda-version">;
1126
1127// A warning group for warnings about features supported by HIP but
1128// ignored by CUDA.
1129def HIPOnly : DiagGroup<"hip-only">;
1130
1131// Warnings which cause linking of the runtime libraries like
1132// libc and the CRT to be skipped.
1133def AVRRtlibLinkingQuirks : DiagGroup<"avr-rtlib-linking-quirks">;
1134
1135// A warning group for things that will change semantics in the future.
1136def FutureCompat : DiagGroup<"future-compat">;
1137
1138def InvalidOrNonExistentDirectory : DiagGroup<"invalid-or-nonexistent-directory">;
1139
1140def OptionIgnored : DiagGroup<"option-ignored">;
1141
1142def UnknownArgument : DiagGroup<"unknown-argument">;
1143
1144// A warning group for warnings about code that clang accepts when
1145// compiling OpenCL C/C++ but which is not compatible with the SPIR spec.
1146def SpirCompat : DiagGroup<"spir-compat">;
1147
1148// Warning for the experimental-isel options.
1149def ExperimentalISel : DiagGroup<"experimental-isel">;
1150
1151// A warning group specifically for warnings related to function
1152// multiversioning.
1153def FunctionMultiVersioning : DiagGroup<"function-multiversion">;
1154
1155def NoDeref : DiagGroup<"noderef">;
1156
1157// A group for cross translation unit static analysis related warnings.
1158def CrossTU : DiagGroup<"ctu">;
1159
1160def CTADMaybeUnsupported : DiagGroup<"ctad-maybe-unsupported">;
1161
1162def FortifySource : DiagGroup<"fortify-source">;
1163