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