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 EnumConversion : DiagGroup<"enum-conversion">;
64 def ImplicitIntConversion : DiagGroup<"implicit-int-conversion">;
65 def ImplicitFloatConversion : DiagGroup<"implicit-float-conversion">;
66 def ImplicitFixedPointConversion : DiagGroup<"implicit-fixed-point-conversion">;
68 def FloatOverflowConversion : DiagGroup<"float-overflow-conversion">;
69 def FloatZeroConversion : DiagGroup<"float-zero-conversion">;
71 DiagGroup<"float-conversion", [FloatOverflowConversion,
72 FloatZeroConversion]>;
74 def DoublePromotion : DiagGroup<"double-promotion">;
75 def EnumTooLarge : DiagGroup<"enum-too-large">;
76 def UnsupportedNan : DiagGroup<"unsupported-nan">;
77 def UnsupportedAbs : DiagGroup<"unsupported-abs">;
78 def UnsupportedCB : DiagGroup<"unsupported-cb">;
79 def UnsupportedGPOpt : DiagGroup<"unsupported-gpopt">;
80 def UnsupportedTargetOpt : DiagGroup<"unsupported-target-opt">;
81 def NonLiteralNullConversion : DiagGroup<"non-literal-null-conversion">;
82 def NullConversion : DiagGroup<"null-conversion">;
83 def ImplicitConversionFloatingPointToBool :
84 DiagGroup<"implicit-conversion-floating-point-to-bool">;
85 def ObjCLiteralConversion : DiagGroup<"objc-literal-conversion">;
86 def MacroRedefined : DiagGroup<"macro-redefined">;
87 def BuiltinMacroRedefined : DiagGroup<"builtin-macro-redefined">;
88 def BuiltinRequiresHeader : DiagGroup<"builtin-requires-header">;
89 def C99Compat : DiagGroup<"c99-compat">;
90 def CXXCompat: DiagGroup<"c++-compat">;
91 def ExternCCompat : DiagGroup<"extern-c-compat">;
92 def KeywordCompat : DiagGroup<"keyword-compat">;
93 def GNUCaseRange : DiagGroup<"gnu-case-range">;
94 def CastAlign : DiagGroup<"cast-align">;
95 def CastQual : DiagGroup<"cast-qual">;
96 def : DiagGroup<"char-align">;
97 def Comment : DiagGroup<"comment">;
98 def GNUComplexInteger : DiagGroup<"gnu-complex-integer">;
99 def GNUConditionalOmittedOperand : DiagGroup<"gnu-conditional-omitted-operand">;
100 def ConfigMacros : DiagGroup<"config-macros">;
101 def : DiagGroup<"ctor-dtor-privacy">;
102 def GNUDesignator : DiagGroup<"gnu-designator">;
103 def GNUStringLiteralOperatorTemplate :
104 DiagGroup<"gnu-string-literal-operator-template">;
105 def UndefinedVarTemplate : DiagGroup<"undefined-var-template">;
106 def UndefinedFuncTemplate : DiagGroup<"undefined-func-template">;
107 def MissingNoEscape : DiagGroup<"missing-noescape">;
109 def DeleteIncomplete : DiagGroup<"delete-incomplete">;
110 def DeleteNonAbstractNonVirtualDtor : DiagGroup<"delete-non-abstract-non-virtual-dtor">;
111 def DeleteAbstractNonVirtualDtor : DiagGroup<"delete-abstract-non-virtual-dtor">;
112 def DeleteNonVirtualDtor : DiagGroup<"delete-non-virtual-dtor",
113 [DeleteNonAbstractNonVirtualDtor,
114 DeleteAbstractNonVirtualDtor]>;
115 def AbstractFinalClass : DiagGroup<"abstract-final-class">;
117 def CXX11CompatDeprecatedWritableStr :
118 DiagGroup<"c++11-compat-deprecated-writable-strings">;
120 def DeprecatedAttributes : DiagGroup<"deprecated-attributes">;
121 def DeprecatedDeclarations : DiagGroup<"deprecated-declarations">;
122 def UnavailableDeclarations : DiagGroup<"unavailable-declarations">;
123 def UnguardedAvailabilityNew : DiagGroup<"unguarded-availability-new">;
124 def UnguardedAvailability : DiagGroup<"unguarded-availability",
125 [UnguardedAvailabilityNew]>;
126 // partial-availability is an alias of unguarded-availability.
127 def : DiagGroup<"partial-availability", [UnguardedAvailability]>;
128 def DeprecatedDynamicExceptionSpec
129 : DiagGroup<"deprecated-dynamic-exception-spec">;
130 def DeprecatedImplementations :DiagGroup<"deprecated-implementations">;
131 def DeprecatedIncrementBool : DiagGroup<"deprecated-increment-bool">;
132 def DeprecatedRegister : DiagGroup<"deprecated-register">;
133 def DeprecatedThisCapture : DiagGroup<"deprecated-this-capture">;
134 def DeprecatedWritableStr : DiagGroup<"deprecated-writable-strings",
135 [CXX11CompatDeprecatedWritableStr]>;
136 // FIXME: Why is DeprecatedImplementations not in this group?
137 def Deprecated : DiagGroup<"deprecated", [DeprecatedAttributes,
138 DeprecatedDeclarations,
139 DeprecatedDynamicExceptionSpec,
140 DeprecatedIncrementBool,
142 DeprecatedThisCapture,
143 DeprecatedWritableStr]>,
144 DiagCategory<"Deprecations">;
146 def DynamicExceptionSpec
147 : DiagGroup<"dynamic-exception-spec", [DeprecatedDynamicExceptionSpec]>;
149 def LibLTO : DiagGroup<"liblto">;
150 def : DiagGroup<"disabled-optimization">;
151 def : DiagGroup<"discard-qual">;
152 def DivZero : DiagGroup<"division-by-zero">;
153 def : DiagGroup<"div-by-zero", [DivZero]>;
155 def DocumentationHTML : DiagGroup<"documentation-html">;
156 def DocumentationUnknownCommand : DiagGroup<"documentation-unknown-command">;
157 def DocumentationPedantic : DiagGroup<"documentation-pedantic",
158 [DocumentationUnknownCommand]>;
159 def DocumentationDeprecatedSync : DiagGroup<"documentation-deprecated-sync">;
160 def Documentation : DiagGroup<"documentation",
162 DocumentationDeprecatedSync]>;
164 def EmptyBody : DiagGroup<"empty-body">;
165 def Exceptions : DiagGroup<"exceptions">;
167 def GNUEmptyInitializer : DiagGroup<"gnu-empty-initializer">;
168 def GNUEmptyStruct : DiagGroup<"gnu-empty-struct">;
169 def ExtraTokens : DiagGroup<"extra-tokens">;
170 def CXX98CompatExtraSemi : DiagGroup<"c++98-compat-extra-semi">;
171 def CXX11ExtraSemi : DiagGroup<"c++11-extra-semi">;
172 def EmptyInitStatement : DiagGroup<"empty-init-stmt">;
173 def ExportUnnamed : DiagGroup<"export-unnamed">;
174 def ExtraSemiStmt : DiagGroup<"extra-semi-stmt", [EmptyInitStatement]>;
175 def ExtraSemi : DiagGroup<"extra-semi", [CXX98CompatExtraSemi,
178 def GNUFlexibleArrayInitializer : DiagGroup<"gnu-flexible-array-initializer">;
179 def GNUFlexibleArrayUnionMember : DiagGroup<"gnu-flexible-array-union-member">;
180 def GNUFoldingConstant : DiagGroup<"gnu-folding-constant">;
181 def FormatExtraArgs : DiagGroup<"format-extra-args">;
182 def FormatZeroLength : DiagGroup<"format-zero-length">;
184 def InvalidIOSDeploymentTarget : DiagGroup<"invalid-ios-deployment-target">;
186 def CXX17CompatMangling : DiagGroup<"c++17-compat-mangling">;
187 def : DiagGroup<"c++1z-compat-mangling", [CXX17CompatMangling]>;
188 // Name of this warning in GCC.
189 def NoexceptType : DiagGroup<"noexcept-type", [CXX17CompatMangling]>;
191 // Warnings for C++1y code which is not compatible with prior C++ standards.
192 def CXXPre14Compat : DiagGroup<"c++98-c++11-compat">;
193 def CXXPre14CompatPedantic : DiagGroup<"c++98-c++11-compat-pedantic",
195 CXXPre14CompatBinaryLiteral]>;
196 def CXXPre17Compat : DiagGroup<"c++98-c++11-c++14-compat">;
197 def CXXPre17CompatPedantic : DiagGroup<"c++98-c++11-c++14-compat-pedantic",
199 def CXXPre2aCompat : DiagGroup<"c++98-c++11-c++14-c++17-compat">;
200 def CXXPre2aCompatPedantic : DiagGroup<"c++98-c++11-c++14-c++17-compat-pedantic",
203 def CXX98CompatBindToTemporaryCopy :
204 DiagGroup<"c++98-compat-bind-to-temporary-copy">;
205 def CXX98CompatLocalTypeTemplateArgs :
206 DiagGroup<"c++98-compat-local-type-template-args">;
207 def CXX98CompatUnnamedTypeTemplateArgs :
208 DiagGroup<"c++98-compat-unnamed-type-template-args">;
210 def CXX98Compat : DiagGroup<"c++98-compat",
211 [CXX98CompatLocalTypeTemplateArgs,
212 CXX98CompatUnnamedTypeTemplateArgs,
216 // Warnings for C++11 features which are Extensions in C++98 mode.
217 def CXX98CompatPedantic : DiagGroup<"c++98-compat-pedantic",
219 CXX98CompatBindToTemporaryCopy,
220 CXX98CompatExtraSemi,
221 CXXPre14CompatPedantic,
222 CXXPre17CompatPedantic,
223 CXXPre2aCompatPedantic]>;
225 def CXX11Narrowing : DiagGroup<"c++11-narrowing">;
227 def CXX11WarnOverrideDestructor :
228 DiagGroup<"inconsistent-missing-destructor-override">;
229 def CXX11WarnOverrideMethod : DiagGroup<"inconsistent-missing-override">;
231 // Original name of this warning in Clang
232 def : DiagGroup<"c++0x-narrowing", [CXX11Narrowing]>;
234 // Name of this warning in GCC
235 def : DiagGroup<"narrowing", [CXX11Narrowing]>;
237 def CXX11CompatReservedUserDefinedLiteral :
238 DiagGroup<"c++11-compat-reserved-user-defined-literal">;
239 def ReservedUserDefinedLiteral :
240 DiagGroup<"reserved-user-defined-literal",
241 [CXX11CompatReservedUserDefinedLiteral]>;
243 def CXX11Compat : DiagGroup<"c++11-compat",
245 CXX11CompatReservedUserDefinedLiteral,
246 CXX11CompatDeprecatedWritableStr,
250 def : DiagGroup<"c++0x-compat", [CXX11Compat]>;
251 def CXX11CompatPedantic : DiagGroup<"c++11-compat-pedantic",
253 CXXPre14CompatPedantic,
254 CXXPre17CompatPedantic,
255 CXXPre2aCompatPedantic]>;
257 def CXX14Compat : DiagGroup<"c++14-compat", [CXXPre17Compat,
259 def CXX14CompatPedantic : DiagGroup<"c++14-compat-pedantic",
261 CXXPre17CompatPedantic,
262 CXXPre2aCompatPedantic]>;
264 def CXX17Compat : DiagGroup<"c++17-compat", [DeprecatedRegister,
265 DeprecatedIncrementBool,
268 def CXX17CompatPedantic : DiagGroup<"c++17-compat-pedantic",
270 CXXPre2aCompatPedantic]>;
271 def : DiagGroup<"c++1z-compat", [CXX17Compat]>;
273 def CXX2aCompat : DiagGroup<"c++2a-compat">;
274 def CXX2aCompatPedantic : DiagGroup<"c++2a-compat-pedantic",
277 def ExitTimeDestructors : DiagGroup<"exit-time-destructors">;
278 def FlexibleArrayExtensions : DiagGroup<"flexible-array-extensions">;
279 def FourByteMultiChar : DiagGroup<"four-char-constants">;
280 def GlobalConstructors : DiagGroup<"global-constructors">;
281 def BitwiseOpParentheses: DiagGroup<"bitwise-op-parentheses">;
282 def LogicalOpParentheses: DiagGroup<"logical-op-parentheses">;
283 def LogicalNotParentheses: DiagGroup<"logical-not-parentheses">;
284 def ShiftOpParentheses: DiagGroup<"shift-op-parentheses">;
285 def OverloadedShiftOpParentheses: DiagGroup<"overloaded-shift-op-parentheses">;
286 def DanglingElse: DiagGroup<"dangling-else">;
287 def DanglingField : DiagGroup<"dangling-field">;
288 def DanglingInitializerList : DiagGroup<"dangling-initializer-list">;
289 def ReturnStackAddress : DiagGroup<"return-stack-address">;
290 def Dangling : DiagGroup<"dangling", [DanglingField,
291 DanglingInitializerList,
292 ReturnStackAddress]>;
293 def DistributedObjectModifiers : DiagGroup<"distributed-object-modifiers">;
294 def ExpansionToDefined : DiagGroup<"expansion-to-defined">;
295 def FlagEnum : DiagGroup<"flag-enum">;
296 def IncrementBool : DiagGroup<"increment-bool", [DeprecatedIncrementBool]>;
297 def InfiniteRecursion : DiagGroup<"infinite-recursion">;
298 def PureVirtualCallFromCtorDtor: DiagGroup<"call-to-pure-virtual-from-ctor-dtor">;
299 def GNUImaginaryConstant : DiagGroup<"gnu-imaginary-constant">;
300 def IgnoredQualifiers : DiagGroup<"ignored-qualifiers">;
301 def : DiagGroup<"import">;
302 def GNUIncludeNext : DiagGroup<"gnu-include-next">;
303 def IncompatibleMSStruct : DiagGroup<"incompatible-ms-struct">;
304 def IncompatiblePointerTypesDiscardsQualifiers
305 : DiagGroup<"incompatible-pointer-types-discards-qualifiers">;
306 def IncompatibleFunctionPointerTypes
307 : DiagGroup<"incompatible-function-pointer-types">;
308 def IncompatiblePointerTypes
309 : DiagGroup<"incompatible-pointer-types",
310 [IncompatiblePointerTypesDiscardsQualifiers,
311 IncompatibleFunctionPointerTypes]>;
312 def IncompleteUmbrella : DiagGroup<"incomplete-umbrella">;
313 def IncompleteFrameworkModuleDeclaration
314 : DiagGroup<"incomplete-framework-module-declaration">;
315 def NonModularIncludeInFrameworkModule
316 : DiagGroup<"non-modular-include-in-framework-module">;
317 def NonModularIncludeInModule : DiagGroup<"non-modular-include-in-module",
318 [NonModularIncludeInFrameworkModule]>;
319 def IncompleteModule : DiagGroup<"incomplete-module",
320 [IncompleteUmbrella, NonModularIncludeInModule]>;
321 def PrivateModule : DiagGroup<"private-module">;
323 def CXX11InlineNamespace : DiagGroup<"c++11-inline-namespace">;
324 def InvalidNoreturn : DiagGroup<"invalid-noreturn">;
325 def InvalidSourceEncoding : DiagGroup<"invalid-source-encoding">;
326 def KNRPromotedParameter : DiagGroup<"knr-promoted-parameter">;
327 def : DiagGroup<"init-self">;
328 def : DiagGroup<"inline">;
329 def : DiagGroup<"invalid-pch">;
330 def GNULabelsAsValue : DiagGroup<"gnu-label-as-value">;
331 def LiteralRange : DiagGroup<"literal-range">;
332 def LocalTypeTemplateArgs : DiagGroup<"local-type-template-args",
333 [CXX98CompatLocalTypeTemplateArgs]>;
334 def RangeLoopAnalysis : DiagGroup<"range-loop-analysis">;
335 def ForLoopAnalysis : DiagGroup<"for-loop-analysis">;
336 def LoopAnalysis : DiagGroup<"loop-analysis", [ForLoopAnalysis,
338 def MalformedWarningCheck : DiagGroup<"malformed-warning-check">;
339 def Main : DiagGroup<"main">;
340 def MainReturnType : DiagGroup<"main-return-type">;
341 def MaxUnsignedZero : DiagGroup<"max-unsigned-zero">;
342 def MissingBraces : DiagGroup<"missing-braces">;
343 def MissingDeclarations: DiagGroup<"missing-declarations">;
344 def : DiagGroup<"missing-format-attribute">;
345 def : DiagGroup<"missing-include-dirs">;
346 def MissingNoreturn : DiagGroup<"missing-noreturn">;
347 def MultiChar : DiagGroup<"multichar">;
348 def : DiagGroup<"nested-externs">;
349 def CXX11LongLong : DiagGroup<"c++11-long-long">;
350 def LongLong : DiagGroup<"long-long", [CXX11LongLong]>;
351 def ImplicitlyUnsignedLiteral : DiagGroup<"implicitly-unsigned-literal">;
352 def MethodSignatures : DiagGroup<"method-signatures">;
353 def MismatchedParameterTypes : DiagGroup<"mismatched-parameter-types">;
354 def MismatchedReturnTypes : DiagGroup<"mismatched-return-types">;
355 def MismatchedTags : DiagGroup<"mismatched-tags">;
356 def MissingFieldInitializers : DiagGroup<"missing-field-initializers">;
357 def ModuleBuild : DiagGroup<"module-build">;
358 def ModuleImport : DiagGroup<"module-import">;
359 def ModuleConflict : DiagGroup<"module-conflict">;
360 def ModuleFileExtension : DiagGroup<"module-file-extension">;
361 def NewlineEOF : DiagGroup<"newline-eof">;
362 def Nullability : DiagGroup<"nullability">;
363 def NullabilityDeclSpec : DiagGroup<"nullability-declspec">;
364 def NullabilityInferredOnNestedType : DiagGroup<"nullability-inferred-on-nested-type">;
365 def NullableToNonNullConversion : DiagGroup<"nullable-to-nonnull-conversion">;
366 def NullabilityCompletenessOnArrays : DiagGroup<"nullability-completeness-on-arrays">;
367 def NullabilityCompleteness : DiagGroup<"nullability-completeness",
368 [NullabilityCompletenessOnArrays]>;
369 def NullArithmetic : DiagGroup<"null-arithmetic">;
370 def NullCharacter : DiagGroup<"null-character">;
371 def NullDereference : DiagGroup<"null-dereference">;
372 def InitializerOverrides : DiagGroup<"initializer-overrides">;
373 // For compatibility with GCC; -Woverride-init = -Winitializer-overrides
374 def : DiagGroup<"override-init", [InitializerOverrides]>;
375 def NonNull : DiagGroup<"nonnull">;
376 def NonPODVarargs : DiagGroup<"non-pod-varargs">;
377 def ClassVarargs : DiagGroup<"class-varargs", [NonPODVarargs]>;
378 def : DiagGroup<"nonportable-cfstrings">;
379 def NonVirtualDtor : DiagGroup<"non-virtual-dtor">;
380 def NullPointerArithmetic : DiagGroup<"null-pointer-arithmetic">;
381 def : DiagGroup<"effc++", [NonVirtualDtor]>;
382 def OveralignedType : DiagGroup<"over-aligned">;
383 def OldStyleCast : DiagGroup<"old-style-cast">;
384 def : DiagGroup<"old-style-definition">;
385 def OutOfLineDeclaration : DiagGroup<"out-of-line-declaration">;
386 def : DiagGroup<"overflow">;
387 def ForwardClassReceiver : DiagGroup<"receiver-forward-class">;
388 def MethodAccess : DiagGroup<"objc-method-access">;
389 def ObjCReceiver : DiagGroup<"receiver-expr">;
390 def OperatorNewReturnsNull : DiagGroup<"new-returns-null">;
391 def OverlengthStrings : DiagGroup<"overlength-strings">;
392 def OverloadedVirtual : DiagGroup<"overloaded-virtual">;
393 def PrivateExtern : DiagGroup<"private-extern">;
394 def SelTypeCast : DiagGroup<"cast-of-sel-type">;
395 def FunctionDefInObjCContainer : DiagGroup<"function-def-in-objc-container">;
396 def BadFunctionCast : DiagGroup<"bad-function-cast">;
397 def ObjCPropertyImpl : DiagGroup<"objc-property-implementation">;
398 def ObjCPropertyNoAttribute : DiagGroup<"objc-property-no-attribute">;
399 def ObjCPropertyAssignOnObjectType : DiagGroup<"objc-property-assign-on-object-type">;
400 def ObjCProtocolQualifiers : DiagGroup<"objc-protocol-qualifiers">;
401 def ObjCMissingSuperCalls : DiagGroup<"objc-missing-super-calls">;
402 def ObjCDesignatedInit : DiagGroup<"objc-designated-initializers">;
403 def ObjCRetainBlockProperty : DiagGroup<"objc-noncopy-retain-block-property">;
404 def ObjCReadonlyPropertyHasSetter : DiagGroup<"objc-readonly-with-setter-property">;
405 def ObjCInvalidIBOutletProperty : DiagGroup<"invalid-iboutlet">;
406 def ObjCRootClass : DiagGroup<"objc-root-class">;
407 def ObjCPointerIntrospectPerformSelector : DiagGroup<"deprecated-objc-pointer-introspection-performSelector">;
408 def ObjCPointerIntrospect : DiagGroup<"deprecated-objc-pointer-introspection", [ObjCPointerIntrospectPerformSelector]>;
409 def ObjCMultipleMethodNames : DiagGroup<"objc-multiple-method-names">;
410 def ObjCFlexibleArray : DiagGroup<"objc-flexible-array">;
411 def ObjCBoxing : DiagGroup<"objc-boxing">;
412 def OpenCLUnsupportedRGBA: DiagGroup<"opencl-unsupported-rgba">;
413 def UnderalignedExceptionObject : DiagGroup<"underaligned-exception-object">;
414 def DeprecatedObjCIsaUsage : DiagGroup<"deprecated-objc-isa-usage">;
415 def ExplicitInitializeCall : DiagGroup<"explicit-initialize-call">;
416 def Packed : DiagGroup<"packed">;
417 def Padded : DiagGroup<"padded">;
419 def PessimizingMove : DiagGroup<"pessimizing-move">;
420 def ReturnStdMoveInCXX11 : DiagGroup<"return-std-move-in-c++11">;
421 def ReturnStdMove : DiagGroup<"return-std-move">;
423 def PointerArith : DiagGroup<"pointer-arith">;
424 def PoundWarning : DiagGroup<"#warnings">;
425 def PoundPragmaMessage : DiagGroup<"#pragma-messages">,
426 DiagCategory<"#pragma message Directive">;
427 def : DiagGroup<"pointer-to-int-cast">;
428 def : DiagGroup<"redundant-decls">;
429 def RedeclaredClassMember : DiagGroup<"redeclared-class-member">;
430 def GNURedeclaredEnum : DiagGroup<"gnu-redeclared-enum">;
431 def RedundantMove : DiagGroup<"redundant-move">;
432 def Register : DiagGroup<"register", [DeprecatedRegister]>;
433 def ReturnTypeCLinkage : DiagGroup<"return-type-c-linkage">;
434 def ReturnType : DiagGroup<"return-type", [ReturnTypeCLinkage]>;
435 def BindToTemporaryCopy : DiagGroup<"bind-to-temporary-copy",
436 [CXX98CompatBindToTemporaryCopy]>;
437 def SelfAssignmentField : DiagGroup<"self-assign-field">;
438 def SelfAssignmentOverloaded : DiagGroup<"self-assign-overloaded">;
439 def SelfAssignment : DiagGroup<"self-assign", [SelfAssignmentOverloaded, SelfAssignmentField]>;
440 def SelfMove : DiagGroup<"self-move">;
441 def SemiBeforeMethodBody : DiagGroup<"semicolon-before-method-body">;
442 def Sentinel : DiagGroup<"sentinel">;
443 def MissingMethodReturnType : DiagGroup<"missing-method-return-type">;
445 def ShadowField : DiagGroup<"shadow-field">;
446 def ShadowFieldInConstructorModified : DiagGroup<"shadow-field-in-constructor-modified">;
447 def ShadowFieldInConstructor : DiagGroup<"shadow-field-in-constructor",
448 [ShadowFieldInConstructorModified]>;
449 def ShadowIvar : DiagGroup<"shadow-ivar">;
450 def ShadowUncapturedLocal : DiagGroup<"shadow-uncaptured-local">;
452 // -Wshadow-all is a catch-all for all shadowing. -Wshadow is just the
453 // shadowing that we think is unsafe.
454 def Shadow : DiagGroup<"shadow", [ShadowFieldInConstructorModified,
456 def ShadowAll : DiagGroup<"shadow-all", [Shadow, ShadowFieldInConstructor,
457 ShadowUncapturedLocal, ShadowField]>;
459 def Shorten64To32 : DiagGroup<"shorten-64-to-32">;
460 def : DiagGroup<"sign-promo">;
461 def SignCompare : DiagGroup<"sign-compare">;
462 def : DiagGroup<"stack-protector">;
463 def : DiagGroup<"switch-default">;
464 def : DiagGroup<"synth">;
465 def SizeofArrayArgument : DiagGroup<"sizeof-array-argument">;
466 def SizeofArrayDecay : DiagGroup<"sizeof-array-decay">;
467 def SizeofPointerMemaccess : DiagGroup<"sizeof-pointer-memaccess">;
468 def MemsetTransposedArgs : DiagGroup<"memset-transposed-args">;
469 def DynamicClassMemaccess : DiagGroup<"dynamic-class-memaccess">;
470 def NonTrivialMemaccess : DiagGroup<"nontrivial-memaccess">;
471 def SuspiciousBzero : DiagGroup<"suspicious-bzero">;
472 def SuspiciousMemaccess : DiagGroup<"suspicious-memaccess",
473 [SizeofPointerMemaccess, DynamicClassMemaccess,
474 NonTrivialMemaccess, MemsetTransposedArgs, SuspiciousBzero]>;
475 def StaticInInline : DiagGroup<"static-in-inline">;
476 def StaticLocalInInline : DiagGroup<"static-local-in-inline">;
477 def GNUStaticFloatInit : DiagGroup<"gnu-static-float-init">;
478 def StaticFloatInit : DiagGroup<"static-float-init", [GNUStaticFloatInit]>;
479 def GNUStatementExpression : DiagGroup<"gnu-statement-expression">;
480 def StringCompare : DiagGroup<"string-compare">;
481 def StringPlusInt : DiagGroup<"string-plus-int">;
482 def StringPlusChar : DiagGroup<"string-plus-char">;
483 def StrncatSize : DiagGroup<"strncat-size">;
484 def TautologicalTypeLimitCompare : DiagGroup<"tautological-type-limit-compare">;
485 def TautologicalUnsignedZeroCompare : DiagGroup<"tautological-unsigned-zero-compare">;
486 def TautologicalUnsignedEnumZeroCompare : DiagGroup<"tautological-unsigned-enum-zero-compare">;
487 def TautologicalInRangeCompare : DiagGroup<"tautological-constant-in-range-compare",
488 [TautologicalTypeLimitCompare,
489 TautologicalUnsignedZeroCompare,
490 TautologicalUnsignedEnumZeroCompare]>;
491 // For compatibility with GCC; -Wtype-limits = -Wtautological-constant-in-range-compare
492 def TypeLimits : DiagGroup<"type-limits", [TautologicalInRangeCompare]>;
493 def TautologicalOutOfRangeCompare : DiagGroup<"tautological-constant-out-of-range-compare">;
494 def TautologicalConstantCompare : DiagGroup<"tautological-constant-compare",
495 [TautologicalOutOfRangeCompare]>;
496 def TautologicalPointerCompare : DiagGroup<"tautological-pointer-compare">;
497 def TautologicalOverlapCompare : DiagGroup<"tautological-overlap-compare">;
498 def TautologicalUndefinedCompare : DiagGroup<"tautological-undefined-compare">;
499 def TautologicalObjCBoolCompare : DiagGroup<"tautological-objc-bool-compare">;
500 def TautologicalCompare : DiagGroup<"tautological-compare",
501 [TautologicalConstantCompare,
502 TautologicalPointerCompare,
503 TautologicalOverlapCompare,
504 TautologicalUndefinedCompare,
505 TautologicalObjCBoolCompare]>;
506 def HeaderHygiene : DiagGroup<"header-hygiene">;
507 def DuplicateDeclSpecifier : DiagGroup<"duplicate-decl-specifier">;
508 def CompareDistinctPointerType : DiagGroup<"compare-distinct-pointer-types">;
509 def GNUUnionCast : DiagGroup<"gnu-union-cast">;
510 def GNUVariableSizedTypeNotAtEnd : DiagGroup<"gnu-variable-sized-type-not-at-end">;
511 def Varargs : DiagGroup<"varargs">;
513 def Unsequenced : DiagGroup<"unsequenced">;
514 // GCC name for -Wunsequenced
515 def : DiagGroup<"sequence-point", [Unsequenced]>;
517 // Preprocessor warnings.
518 def AmbiguousMacro : DiagGroup<"ambiguous-macro">;
519 def KeywordAsMacro : DiagGroup<"keyword-macro">;
520 def ReservedIdAsMacro : DiagGroup<"reserved-id-macro">;
522 // Just silence warnings about -Wstrict-aliasing for now.
523 def : DiagGroup<"strict-aliasing=0">;
524 def : DiagGroup<"strict-aliasing=1">;
525 def : DiagGroup<"strict-aliasing=2">;
526 def : DiagGroup<"strict-aliasing">;
528 // Just silence warnings about -Wstrict-overflow for now.
529 def : DiagGroup<"strict-overflow=0">;
530 def : DiagGroup<"strict-overflow=1">;
531 def : DiagGroup<"strict-overflow=2">;
532 def : DiagGroup<"strict-overflow=3">;
533 def : DiagGroup<"strict-overflow=4">;
534 def : DiagGroup<"strict-overflow=5">;
535 def : DiagGroup<"strict-overflow">;
537 def InvalidOffsetof : DiagGroup<"invalid-offsetof">;
538 def : DiagGroup<"strict-prototypes">;
539 def StrictSelector : DiagGroup<"strict-selector-match">;
540 def MethodDuplicate : DiagGroup<"duplicate-method-match">;
541 def ObjCCStringFormat : DiagGroup<"cstring-format-directive">;
542 def CoveredSwitchDefault : DiagGroup<"covered-switch-default">;
543 def SwitchBool : DiagGroup<"switch-bool">;
544 def SwitchEnum : DiagGroup<"switch-enum">;
545 def Switch : DiagGroup<"switch">;
546 def EnumCompareSwitch : DiagGroup<"enum-compare-switch">;
547 def EnumCompare : DiagGroup<"enum-compare", [EnumCompareSwitch]>;
548 def ImplicitFallthroughPerFunction :
549 DiagGroup<"implicit-fallthrough-per-function">;
550 def ImplicitFallthrough : DiagGroup<"implicit-fallthrough",
551 [ImplicitFallthroughPerFunction]>;
552 def InvalidPPToken : DiagGroup<"invalid-pp-token">;
553 def Trigraphs : DiagGroup<"trigraphs">;
555 def : DiagGroup<"type-limits">;
556 def UndefinedReinterpretCast : DiagGroup<"undefined-reinterpret-cast">;
557 def ReinterpretBaseClass : DiagGroup<"reinterpret-base-class">;
558 def Unicode : DiagGroup<"unicode">;
559 def UninitializedMaybe : DiagGroup<"conditional-uninitialized">;
560 def UninitializedSometimes : DiagGroup<"sometimes-uninitialized">;
561 def UninitializedStaticSelfInit : DiagGroup<"static-self-init">;
562 def Uninitialized : DiagGroup<"uninitialized", [UninitializedSometimes,
563 UninitializedStaticSelfInit]>;
564 def IgnoredPragmaIntrinsic : DiagGroup<"ignored-pragma-intrinsic">;
565 // #pragma optimize is often used to avoid to work around MSVC codegen bugs or
566 // to disable inlining. It's not completely clear what alternative to suggest
567 // (#pragma clang optimize, noinline) so suggest nothing for now.
568 def IgnoredPragmaOptimize : DiagGroup<"ignored-pragma-optimize">;
569 def UnknownPragmas : DiagGroup<"unknown-pragmas">;
570 def IgnoredPragmas : DiagGroup<"ignored-pragmas",
571 [IgnoredPragmaIntrinsic, IgnoredPragmaOptimize]>;
572 def PragmaClangAttribute : DiagGroup<"pragma-clang-attribute">;
573 def PragmaPackSuspiciousInclude : DiagGroup<"pragma-pack-suspicious-include">;
574 def PragmaPack : DiagGroup<"pragma-pack", [PragmaPackSuspiciousInclude]>;
575 def Pragmas : DiagGroup<"pragmas", [UnknownPragmas, IgnoredPragmas,
576 PragmaClangAttribute, PragmaPack]>;
577 def UnknownWarningOption : DiagGroup<"unknown-warning-option">;
578 def NSobjectAttribute : DiagGroup<"NSObject-attribute">;
579 def NSConsumedMismatch : DiagGroup<"nsconsumed-mismatch">;
580 def NSReturnsMismatch : DiagGroup<"nsreturns-mismatch">;
582 def IndependentClassAttribute : DiagGroup<"IndependentClass-attribute">;
583 def UnknownAttributes : DiagGroup<"unknown-attributes">;
584 def IgnoredAttributes : DiagGroup<"ignored-attributes">;
585 def Attributes : DiagGroup<"attributes", [UnknownAttributes,
587 def UnknownSanitizers : DiagGroup<"unknown-sanitizers">;
588 def UnnamedTypeTemplateArgs : DiagGroup<"unnamed-type-template-args",
589 [CXX98CompatUnnamedTypeTemplateArgs]>;
590 def UnsupportedFriend : DiagGroup<"unsupported-friend">;
591 def UnusedArgument : DiagGroup<"unused-argument">;
592 def UnusedCommandLineArgument : DiagGroup<"unused-command-line-argument">;
593 def IgnoredOptimizationArgument : DiagGroup<"ignored-optimization-argument">;
594 def InvalidCommandLineArgument : DiagGroup<"invalid-command-line-argument",
595 [IgnoredOptimizationArgument]>;
596 def UnusedComparison : DiagGroup<"unused-comparison">;
597 def UnusedExceptionParameter : DiagGroup<"unused-exception-parameter">;
598 def UnneededInternalDecl : DiagGroup<"unneeded-internal-declaration">;
599 def UnneededMemberFunction : DiagGroup<"unneeded-member-function">;
600 def UnusedPrivateField : DiagGroup<"unused-private-field">;
601 def UnusedFunction : DiagGroup<"unused-function", [UnneededInternalDecl]>;
602 def UnusedTemplate : DiagGroup<"unused-template", [UnneededInternalDecl]>;
603 def UnusedMemberFunction : DiagGroup<"unused-member-function",
604 [UnneededMemberFunction]>;
605 def UnusedLabel : DiagGroup<"unused-label">;
606 def UnusedLambdaCapture : DiagGroup<"unused-lambda-capture">;
607 def UnusedParameter : DiagGroup<"unused-parameter">;
608 def UnusedResult : DiagGroup<"unused-result">;
609 def PotentiallyEvaluatedExpression : DiagGroup<"potentially-evaluated-expression">;
610 def UnevaluatedExpression : DiagGroup<"unevaluated-expression",
611 [PotentiallyEvaluatedExpression]>;
612 def UnusedValue : DiagGroup<"unused-value", [UnusedComparison, UnusedResult,
613 UnevaluatedExpression]>;
614 def UnusedConstVariable : DiagGroup<"unused-const-variable">;
615 def UnusedVariable : DiagGroup<"unused-variable",
616 [UnusedConstVariable]>;
617 def UnusedLocalTypedef : DiagGroup<"unused-local-typedef">;
618 def UnusedPropertyIvar : DiagGroup<"unused-property-ivar">;
619 def UnusedGetterReturnValue : DiagGroup<"unused-getter-return-value">;
620 def UsedButMarkedUnused : DiagGroup<"used-but-marked-unused">;
621 def UserDefinedLiterals : DiagGroup<"user-defined-literals">;
622 def UserDefinedWarnings : DiagGroup<"user-defined-warnings">;
623 def Reorder : DiagGroup<"reorder">;
624 def UndeclaredSelector : DiagGroup<"undeclared-selector">;
625 def ImplicitAtomic : DiagGroup<"implicit-atomic-properties">;
626 def CustomAtomic : DiagGroup<"custom-atomic-properties">;
627 def AtomicProperties : DiagGroup<"atomic-properties",
628 [ImplicitAtomic, CustomAtomic]>;
629 def ARCUnsafeRetainedAssign : DiagGroup<"arc-unsafe-retained-assign">;
630 def ARCRetainCycles : DiagGroup<"arc-retain-cycles">;
631 def ARCNonPodMemAccess : DiagGroup<"arc-non-pod-memaccess">;
632 def AutomaticReferenceCounting : DiagGroup<"arc",
633 [ARCUnsafeRetainedAssign,
635 ARCNonPodMemAccess]>;
636 def ARCRepeatedUseOfWeakMaybe : DiagGroup<"arc-maybe-repeated-use-of-weak">;
637 def ARCRepeatedUseOfWeak : DiagGroup<"arc-repeated-use-of-weak",
638 [ARCRepeatedUseOfWeakMaybe]>;
639 def BlockCaptureAutoReleasing : DiagGroup<"block-capture-autoreleasing">;
640 def ObjCBridge : DiagGroup<"bridge-cast">;
642 def DeallocInCategory:DiagGroup<"dealloc-in-category">;
643 def SelectorTypeMismatch : DiagGroup<"selector-type-mismatch">;
644 def Selector : DiagGroup<"selector", [SelectorTypeMismatch]>;
645 def Protocol : DiagGroup<"protocol">;
646 // No longer in use, preserve for backwards compatibility.
647 def : DiagGroup<"at-protocol">;
648 def PropertyAccessDotSyntax: DiagGroup<"property-access-dot-syntax">;
649 def PropertyAttr : DiagGroup<"property-attribute-mismatch">;
650 def SuperSubClassMismatch : DiagGroup<"super-class-method-mismatch">;
651 def OverridingMethodMismatch : DiagGroup<"overriding-method-mismatch">;
652 def VariadicMacros : DiagGroup<"variadic-macros">;
653 def VectorConversion : DiagGroup<"vector-conversion">; // clang specific
654 def VexingParse : DiagGroup<"vexing-parse">;
655 def VLA : DiagGroup<"vla">;
656 def VLAExtension : DiagGroup<"vla-extension">;
657 def VolatileRegisterVar : DiagGroup<"volatile-register-var">;
658 def Visibility : DiagGroup<"visibility">;
659 def ZeroLengthArray : DiagGroup<"zero-length-array">;
660 def GNUZeroLineDirective : DiagGroup<"gnu-zero-line-directive">;
661 def GNUZeroVariadicMacroArguments : DiagGroup<"gnu-zero-variadic-macro-arguments">;
662 def Fallback : DiagGroup<"fallback">;
664 // This covers both the deprecated case (in C++98)
665 // and the extension case (in C++11 onwards).
666 def WritableStrings : DiagGroup<"writable-strings", [DeprecatedWritableStr]>;
668 // GCC calls -Wdeprecated-writable-strings -Wwrite-strings.
670 // Bizarrely, this warning flag enables -fconst-strings in C. This is
671 // GCC-compatible, but really weird.
673 // FIXME: Should this affect C++11 (where this is an error,
674 // not just deprecated) or not?
675 def GCCWriteStrings : DiagGroup<"write-strings" , [WritableStrings]>;
677 def CharSubscript : DiagGroup<"char-subscripts">;
678 def LargeByValueCopy : DiagGroup<"large-by-value-copy">;
679 def DuplicateArgDecl : DiagGroup<"duplicate-method-arg">;
680 def SignedEnumBitfield : DiagGroup<"signed-enum-bitfield">;
682 // Unreachable code warning groups.
684 // The goal is make -Wunreachable-code on by default, in -Wall, or at
685 // least actively used, with more noisy versions of the warning covered
686 // under separate flags.
688 def UnreachableCodeLoopIncrement : DiagGroup<"unreachable-code-loop-increment">;
689 def UnreachableCode : DiagGroup<"unreachable-code",
690 [UnreachableCodeLoopIncrement]>;
691 def UnreachableCodeBreak : DiagGroup<"unreachable-code-break">;
692 def UnreachableCodeReturn : DiagGroup<"unreachable-code-return">;
693 def UnreachableCodeAggressive : DiagGroup<"unreachable-code-aggressive",
695 UnreachableCodeBreak,
696 UnreachableCodeReturn]>;
698 // Aggregation warning settings.
700 // Populate -Waddress with warnings from other groups.
701 def : DiagGroup<"address", [PointerBoolConversion,
703 TautologicalPointerCompare]>;
705 // -Widiomatic-parentheses contains warnings about 'idiomatic'
706 // missing parentheses; it is off by default. We do not include it
707 // in -Wparentheses because most users who use -Wparentheses explicitly
708 // do not want these warnings.
709 def ParenthesesOnEquality : DiagGroup<"parentheses-equality">;
710 def Parentheses : DiagGroup<"parentheses",
711 [LogicalOpParentheses,
712 LogicalNotParentheses,
713 BitwiseOpParentheses,
715 OverloadedShiftOpParentheses,
716 ParenthesesOnEquality,
719 // -Wconversion has its own warnings, but we split a few out for
721 // - some people want just 64-to-32 warnings
722 // - conversion warnings with constant sources are on by default
723 // - conversion warnings for literals are on by default
724 // - bool-to-pointer conversion warnings are on by default
725 // - __null-to-integer conversion warnings are on by default
726 def Conversion : DiagGroup<"conversion",
730 BitFieldEnumConversion,
734 ImplicitIntConversion,
735 ImplicitFloatConversion,
737 NonLiteralNullConversion, // (1-1)->pointer (etc)
738 NullConversion, // NULL->non-pointer
739 ObjCLiteralConversion,
742 DiagCategory<"Value Conversion Issue">;
744 def Unused : DiagGroup<"unused",
745 [UnusedArgument, UnusedFunction, UnusedLabel,
746 // UnusedParameter, (matches GCC's behavior)
747 // UnusedTemplate, (clean-up libc++ before enabling)
748 // UnusedMemberFunction, (clean-up llvm before enabling)
749 UnusedPrivateField, UnusedLambdaCapture,
750 UnusedLocalTypedef, UnusedValue, UnusedVariable,
751 UnusedPropertyIvar]>,
752 DiagCategory<"Unused Entity Issue">;
755 def FormatInvalidSpecifier : DiagGroup<"format-invalid-specifier">;
756 def FormatSecurity : DiagGroup<"format-security">;
757 def FormatNonStandard : DiagGroup<"format-non-iso">;
758 def FormatY2K : DiagGroup<"format-y2k">;
759 def FormatPedantic : DiagGroup<"format-pedantic">;
760 def Format : DiagGroup<"format",
761 [FormatExtraArgs, FormatZeroLength, NonNull,
762 FormatSecurity, FormatY2K, FormatInvalidSpecifier]>,
763 DiagCategory<"Format String Issue">;
764 def FormatNonLiteral : DiagGroup<"format-nonliteral">;
765 def Format2 : DiagGroup<"format=2",
766 [FormatNonLiteral, FormatSecurity, FormatY2K]>;
768 def TypeSafety : DiagGroup<"type-safety">;
770 def IncompatibleExceptionSpec : DiagGroup<"incompatible-exception-spec">;
772 def IntToVoidPointerCast : DiagGroup<"int-to-void-pointer-cast">;
773 def IntToPointerCast : DiagGroup<"int-to-pointer-cast",
774 [IntToVoidPointerCast]>;
776 def Move : DiagGroup<"move", [
783 def Extra : DiagGroup<"extra", [
784 MissingFieldInitializers,
786 InitializerOverrides,
787 SemiBeforeMethodBody,
788 MissingMethodReturnType,
791 NullPointerArithmetic,
795 def Most : DiagGroup<"most", [
798 DeleteNonVirtualDtor,
819 ObjCMissingSuperCalls,
829 // Thread Safety warnings
830 def ThreadSafetyAttributes : DiagGroup<"thread-safety-attributes">;
831 def ThreadSafetyAnalysis : DiagGroup<"thread-safety-analysis">;
832 def ThreadSafetyPrecise : DiagGroup<"thread-safety-precise">;
833 def ThreadSafetyReference : DiagGroup<"thread-safety-reference">;
834 def ThreadSafetyNegative : DiagGroup<"thread-safety-negative">;
835 def ThreadSafety : DiagGroup<"thread-safety",
836 [ThreadSafetyAttributes,
837 ThreadSafetyAnalysis,
839 ThreadSafetyReference]>;
840 def ThreadSafetyVerbose : DiagGroup<"thread-safety-verbose">;
841 def ThreadSafetyBeta : DiagGroup<"thread-safety-beta">;
843 // Uniqueness Analysis warnings
844 def Consumed : DiagGroup<"consumed">;
846 // Note that putting warnings in -Wall will not disable them by default. If a
847 // warning should be active _only_ when -Wall is passed in, mark it as
848 // DefaultIgnore in addition to putting it here.
849 def All : DiagGroup<"all", [Most, Parentheses, Switch, SwitchBool]>;
851 // Warnings that should be in clang-cl /w4.
852 def : DiagGroup<"CL4", [All, Extra]>;
854 // Warnings enabled by -pedantic. This is magically filled in by TableGen.
855 def Pedantic : DiagGroup<"pedantic">;
858 def : DiagGroup<"", [Extra]>; // -W = -Wextra
859 def : DiagGroup<"endif-labels", [ExtraTokens]>; // -Wendif-labels=-Wextra-tokens
860 def : DiagGroup<"cpp", [PoundWarning]>; // -Wcpp = -W#warnings
861 def : DiagGroup<"comments", [Comment]>; // -Wcomments = -Wcomment
862 def : DiagGroup<"conversion-null",
863 [NullConversion]>; // -Wconversion-null = -Wnull-conversion
864 def : DiagGroup<"bool-conversions",
865 [BoolConversion]>; // -Wbool-conversions = -Wbool-conversion
866 def : DiagGroup<"int-conversions",
867 [IntConversion]>; // -Wint-conversions = -Wint-conversion
868 def : DiagGroup<"vector-conversions",
869 [VectorConversion]>; // -Wvector-conversions = -Wvector-conversion
870 def : DiagGroup<"unused-local-typedefs", [UnusedLocalTypedef]>;
871 // -Wunused-local-typedefs = -Wunused-local-typedef
873 // A warning group for warnings that we want to have on by default in clang,
874 // but which aren't on by default in GCC.
875 def NonGCC : DiagGroup<"non-gcc",
876 [SignCompare, Conversion, LiteralRange]>;
878 // A warning group for warnings about using C++11 features as extensions in
879 // earlier C++ versions.
880 def CXX11 : DiagGroup<"c++11-extensions", [CXX11ExtraSemi, CXX11InlineNamespace,
883 // A warning group for warnings about using C++14 features as extensions in
884 // earlier C++ versions.
885 def CXX14 : DiagGroup<"c++14-extensions", [CXX14BinaryLiteral]>;
887 // A warning group for warnings about using C++17 features as extensions in
888 // earlier C++ versions.
889 def CXX17 : DiagGroup<"c++17-extensions">;
891 // A warning group for warnings about using C++2a features as extensions in
892 // earlier C++ versions.
893 def CXX2a : DiagGroup<"c++2a-extensions">;
895 def : DiagGroup<"c++0x-extensions", [CXX11]>;
896 def : DiagGroup<"c++1y-extensions", [CXX14]>;
897 def : DiagGroup<"c++1z-extensions", [CXX17]>;
899 def DelegatingCtorCycles :
900 DiagGroup<"delegating-ctor-cycles">;
902 // A warning group for warnings about using C11 features as extensions.
903 def C11 : DiagGroup<"c11-extensions">;
905 // A warning group for warnings about using C99 features as extensions.
906 def C99 : DiagGroup<"c99-extensions">;
908 // A warning group for warnings about GCC extensions.
909 def GNU : DiagGroup<"gnu", [GNUAlignofExpression, GNUAnonymousStruct,
911 GNUBinaryLiteral, GNUCaseRange,
912 GNUComplexInteger, GNUCompoundLiteralInitializer,
913 GNUConditionalOmittedOperand, GNUDesignator,
914 GNUEmptyInitializer, GNUEmptyStruct,
915 VLAExtension, GNUFlexibleArrayInitializer,
916 GNUFlexibleArrayUnionMember, GNUFoldingConstant,
917 GNUImaginaryConstant, GNUIncludeNext,
919 RedeclaredClassMember, GNURedeclaredEnum,
920 GNUStatementExpression, GNUStaticFloatInit,
921 GNUStringLiteralOperatorTemplate,
922 GNUUnionCast, GNUVariableSizedTypeNotAtEnd,
923 ZeroLengthArray, GNUZeroLineDirective,
924 GNUZeroVariadicMacroArguments]>;
925 // A warning group for warnings about code that clang accepts but gcc doesn't.
926 def GccCompat : DiagGroup<"gcc-compat">;
928 // Warnings for Microsoft extensions.
929 def MicrosoftCharize : DiagGroup<"microsoft-charize">;
930 def MicrosoftDrectveSection : DiagGroup<"microsoft-drectve-section">;
931 def MicrosoftInclude : DiagGroup<"microsoft-include">;
932 def MicrosoftCppMacro : DiagGroup<"microsoft-cpp-macro">;
933 def MicrosoftFixedEnum : DiagGroup<"microsoft-fixed-enum">;
934 def MicrosoftSealed : DiagGroup<"microsoft-sealed">;
935 def MicrosoftUnqualifiedFriend : DiagGroup<"microsoft-unqualified-friend">;
936 def MicrosoftExceptionSpec : DiagGroup<"microsoft-exception-spec">;
937 def MicrosoftUsingDecl : DiagGroup<"microsoft-using-decl">;
938 def MicrosoftMutableReference : DiagGroup<"microsoft-mutable-reference">;
939 def MicrosoftPureDefinition : DiagGroup<"microsoft-pure-definition">;
940 def MicrosoftUnionMemberReference : DiagGroup<
941 "microsoft-union-member-reference">;
942 def MicrosoftExplicitConstructorCall : DiagGroup<
943 "microsoft-explicit-constructor-call">;
944 def MicrosoftEnumValue : DiagGroup<"microsoft-enum-value">;
945 def MicrosoftDefaultArgRedefinition :
946 DiagGroup<"microsoft-default-arg-redefinition">;
947 def MicrosoftTemplate : DiagGroup<"microsoft-template">;
948 def MicrosoftInconsistentDllImport : DiagGroup<"inconsistent-dllimport">;
949 def MicrosoftRedeclareStatic : DiagGroup<"microsoft-redeclare-static">;
950 def MicrosoftEnumForwardReference :
951 DiagGroup<"microsoft-enum-forward-reference">;
952 def MicrosoftGoto : DiagGroup<"microsoft-goto">;
953 def MicrosoftFlexibleArray : DiagGroup<"microsoft-flexible-array">;
954 def MicrosoftExtraQualification : DiagGroup<"microsoft-extra-qualification">;
955 def MicrosoftCast : DiagGroup<"microsoft-cast">;
956 def MicrosoftConstInit : DiagGroup<"microsoft-const-init">;
957 def MicrosoftVoidPseudoDtor : DiagGroup<"microsoft-void-pseudo-dtor">;
958 def MicrosoftAnonTag : DiagGroup<"microsoft-anon-tag">;
959 def MicrosoftCommentPaste : DiagGroup<"microsoft-comment-paste">;
960 def MicrosoftEndOfFile : DiagGroup<"microsoft-end-of-file">;
961 def MicrosoftInaccessibleBase : DiagGroup<"microsoft-inaccessible-base">;
963 def : DiagGroup<"msvc-include", [MicrosoftInclude]>;
964 // -Wmsvc-include = -Wmicrosoft-include
966 // Warnings group for warnings about Microsoft extensions.
967 def Microsoft : DiagGroup<"microsoft",
968 [MicrosoftCharize, MicrosoftDrectveSection, MicrosoftInclude,
969 MicrosoftCppMacro, MicrosoftFixedEnum, MicrosoftSealed,
970 MicrosoftUnqualifiedFriend, MicrosoftExceptionSpec, MicrosoftUsingDecl,
971 MicrosoftMutableReference, MicrosoftPureDefinition,
972 MicrosoftUnionMemberReference, MicrosoftExplicitConstructorCall,
973 MicrosoftEnumValue, MicrosoftDefaultArgRedefinition, MicrosoftTemplate,
974 MicrosoftRedeclareStatic, MicrosoftEnumForwardReference, MicrosoftGoto,
975 MicrosoftFlexibleArray, MicrosoftExtraQualification, MicrosoftCast,
976 MicrosoftConstInit, MicrosoftVoidPseudoDtor, MicrosoftAnonTag,
977 MicrosoftCommentPaste, MicrosoftEndOfFile,
978 MicrosoftInconsistentDllImport]>;
980 def ClangClPch : DiagGroup<"clang-cl-pch">;
982 def ObjCNonUnifiedException : DiagGroup<"objc-nonunified-exceptions">;
984 def ObjCProtocolMethodImpl : DiagGroup<"objc-protocol-method-implementation">;
986 def ObjCNoPropertyAutoSynthesis : DiagGroup<"objc-property-synthesis">;
988 // ObjC API warning groups.
989 def ObjCRedundantLiteralUse : DiagGroup<"objc-redundant-literal-use">;
990 def ObjCRedundantAPIUse : DiagGroup<"objc-redundant-api-use", [
991 ObjCRedundantLiteralUse
994 def ObjCCocoaAPI : DiagGroup<"objc-cocoa-api", [
998 def ObjCStringComparison : DiagGroup<"objc-string-compare">;
999 def ObjCStringConcatenation : DiagGroup<"objc-string-concatenation">;
1000 def ObjCLiteralComparison : DiagGroup<"objc-literal-compare", [
1001 ObjCStringComparison
1004 // Inline ASM warnings.
1005 def ASMOperandWidths : DiagGroup<"asm-operand-widths">;
1006 def ASMIgnoredQualifier : DiagGroup<"asm-ignored-qualifier">;
1007 def ASM : DiagGroup<"asm", [
1008 ASMOperandWidths, ASMIgnoredQualifier
1012 def SourceUsesOpenMP : DiagGroup<"source-uses-openmp">;
1013 def OpenMPClauses : DiagGroup<"openmp-clauses">;
1014 def OpenMPLoopForm : DiagGroup<"openmp-loop-form">;
1015 def OpenMPTarget : DiagGroup<"openmp-target">;
1017 // Backend warnings.
1018 def BackendInlineAsm : DiagGroup<"inline-asm">;
1019 def BackendFrameLargerThanEQ : DiagGroup<"frame-larger-than=">;
1020 def BackendPlugin : DiagGroup<"backend-plugin">;
1021 def RemarkBackendPlugin : DiagGroup<"remark-backend-plugin">;
1022 def BackendOptimizationRemark : DiagGroup<"pass">;
1023 def BackendOptimizationRemarkMissed : DiagGroup<"pass-missed">;
1024 def BackendOptimizationRemarkAnalysis : DiagGroup<"pass-analysis">;
1025 def BackendOptimizationFailure : DiagGroup<"pass-failed">;
1027 // Instrumentation based profiling warnings.
1028 def ProfileInstrMissing : DiagGroup<"profile-instr-missing">;
1029 def ProfileInstrOutOfDate : DiagGroup<"profile-instr-out-of-date">;
1030 def ProfileInstrUnprofiled : DiagGroup<"profile-instr-unprofiled">;
1032 // AddressSanitizer frontend instrumentation remarks.
1033 def SanitizeAddressRemarks : DiagGroup<"sanitize-address">;
1035 // Issues with serialized diagnostics.
1036 def SerializedDiagnostics : DiagGroup<"serialized-diagnostics">;
1038 // A warning group for warnings about code that clang accepts when
1039 // compiling CUDA C/C++ but which is not compatible with the CUDA spec.
1040 def CudaCompat : DiagGroup<"cuda-compat">;
1042 // Warnings which cause linking of the runtime libraries like
1043 // libc and the CRT to be skipped.
1044 def AVRRtlibLinkingQuirks : DiagGroup<"avr-rtlib-linking-quirks">;
1046 // A warning group for things that will change semantics in the future.
1047 def FutureCompat : DiagGroup<"future-compat">;
1049 def InvalidOrNonExistentDirectory : DiagGroup<"invalid-or-nonexistent-directory">;
1051 def OptionIgnored : DiagGroup<"option-ignored">;
1053 def UnknownArgument : DiagGroup<"unknown-argument">;
1055 // A warning group for warnings about code that clang accepts when
1056 // compiling OpenCL C/C++ but which is not compatible with the SPIR spec.
1057 def SpirCompat : DiagGroup<"spir-compat">;
1059 // Warning for the experimental-isel options.
1060 def ExperimentalISel : DiagGroup<"experimental-isel">;
1062 // A warning group specifically for warnings related to function
1064 def FunctionMultiVersioning : DiagGroup<"function-multiversion">;
1066 def NoDeref : DiagGroup<"noderef">;
1068 // A group for cross translation unit static analysis related warnings.
1069 def CrossTU : DiagGroup<"ctu">;
1071 def CTADMaybeUnsupported : DiagGroup<"ctad-maybe-unsupported">;
1073 def FortifySource : DiagGroup<"fortify-source">;