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