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