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