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