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