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 Availability : DiagGroup<"availability">;
31 def Section : DiagGroup<"section">;
32 def AutoImport : DiagGroup<"auto-import">;
33 def CXX14BinaryLiteral : DiagGroup<"c++14-binary-literal">;
34 def GNUBinaryLiteral : DiagGroup<"gnu-binary-literal">;
35 def GNUCompoundLiteralInitializer : DiagGroup<"gnu-compound-literal-initializer">;
36 def BitFieldConstantConversion : DiagGroup<"bitfield-constant-conversion">;
37 def BitFieldWidth : DiagGroup<"bitfield-width">;
38 def ConstantConversion :
39 DiagGroup<"constant-conversion", [ BitFieldConstantConversion ] >;
40 def LiteralConversion : DiagGroup<"literal-conversion">;
41 def StringConversion : DiagGroup<"string-conversion">;
42 def SignConversion : DiagGroup<"sign-conversion">;
43 def PointerBoolConversion : DiagGroup<"pointer-bool-conversion">;
44 def UndefinedBoolConversion : DiagGroup<"undefined-bool-conversion">;
45 def BoolConversion : DiagGroup<"bool-conversion", [PointerBoolConversion,
46 UndefinedBoolConversion]>;
47 def IntConversion : DiagGroup<"int-conversion">;
48 def EnumConversion : DiagGroup<"enum-conversion">;
49 def FloatConversion : DiagGroup<"float-conversion">;
50 def DoublePromotion : DiagGroup<"double-promotion">;
51 def EnumTooLarge : DiagGroup<"enum-too-large">;
52 def UnsupportedNan : DiagGroup<"unsupported-nan">;
53 def NonLiteralNullConversion : DiagGroup<"non-literal-null-conversion">;
54 def NullConversion : DiagGroup<"null-conversion">;
55 def ImplicitConversionFloatingPointToBool :
56 DiagGroup<"implicit-conversion-floating-point-to-bool">;
57 def ObjCLiteralConversion : DiagGroup<"objc-literal-conversion">;
58 def BadArrayNewLength : DiagGroup<"bad-array-new-length">;
59 def MacroRedefined : DiagGroup<"macro-redefined">;
60 def BuiltinMacroRedefined : DiagGroup<"builtin-macro-redefined">;
61 def BuiltinRequiresHeader : DiagGroup<"builtin-requires-header">;
62 def C99Compat : DiagGroup<"c99-compat">;
63 def CXXCompat: DiagGroup<"c++-compat">;
64 def ExternCCompat : DiagGroup<"extern-c-compat">;
65 def KeywordCompat : DiagGroup<"keyword-compat">;
66 def GNUCaseRange : DiagGroup<"gnu-case-range">;
67 def CastAlign : DiagGroup<"cast-align">;
68 def CastQual : DiagGroup<"cast-qual">;
69 def : DiagGroup<"char-align">;
70 def Comment : DiagGroup<"comment">;
71 def GNUComplexInteger : DiagGroup<"gnu-complex-integer">;
72 def GNUConditionalOmittedOperand : DiagGroup<"gnu-conditional-omitted-operand">;
73 def ConfigMacros : DiagGroup<"config-macros">;
74 def : DiagGroup<"ctor-dtor-privacy">;
75 def GNUDesignator : DiagGroup<"gnu-designator">;
76 def GNUStringLiteralOperatorTemplate :
77 DiagGroup<"gnu-string-literal-operator-template">;
79 def DeleteIncomplete : DiagGroup<"delete-incomplete">;
80 def DeleteNonVirtualDtor : DiagGroup<"delete-non-virtual-dtor">;
81 def AbstractFinalClass : DiagGroup<"abstract-final-class">;
83 def CXX11CompatDeprecatedWritableStr :
84 DiagGroup<"c++11-compat-deprecated-writable-strings">;
86 def DeprecatedAttributes : DiagGroup<"deprecated-attributes">;
87 def DeprecatedDeclarations : DiagGroup<"deprecated-declarations">;
88 def UnavailableDeclarations : DiagGroup<"unavailable-declarations">;
89 def PartialAvailability : DiagGroup<"partial-availability">;
90 def DeprecatedImplementations :DiagGroup<"deprecated-implementations">;
91 def DeprecatedIncrementBool : DiagGroup<"deprecated-increment-bool">;
92 def DeprecatedRegister : DiagGroup<"deprecated-register">;
93 def DeprecatedWritableStr : DiagGroup<"deprecated-writable-strings",
94 [CXX11CompatDeprecatedWritableStr]>;
95 // FIXME: Why is DeprecatedImplementations not in this group?
96 def Deprecated : DiagGroup<"deprecated", [DeprecatedAttributes,
97 DeprecatedDeclarations,
98 DeprecatedIncrementBool,
100 DeprecatedWritableStr]>,
101 DiagCategory<"Deprecations">;
103 def LibLTO : DiagGroup<"liblto">;
104 def : DiagGroup<"disabled-optimization">;
105 def : DiagGroup<"discard-qual">;
106 def : DiagGroup<"div-by-zero">;
108 def DocumentationHTML : DiagGroup<"documentation-html">;
109 def DocumentationUnknownCommand : DiagGroup<"documentation-unknown-command">;
110 def DocumentationPedantic : DiagGroup<"documentation-pedantic",
111 [DocumentationUnknownCommand]>;
112 def DocumentationDeprecatedSync : DiagGroup<"documentation-deprecated-sync">;
113 def Documentation : DiagGroup<"documentation",
115 DocumentationDeprecatedSync]>;
117 def EmptyBody : DiagGroup<"empty-body">;
118 def Exceptions : DiagGroup<"exceptions">;
120 def GNUEmptyInitializer : DiagGroup<"gnu-empty-initializer">;
121 def GNUEmptyStruct : DiagGroup<"gnu-empty-struct">;
122 def ExtraTokens : DiagGroup<"extra-tokens">;
123 def CXX11ExtraSemi : DiagGroup<"c++11-extra-semi">;
124 def ExtraSemi : DiagGroup<"extra-semi", [CXX11ExtraSemi]>;
126 def GNUFlexibleArrayInitializer : DiagGroup<"gnu-flexible-array-initializer">;
127 def GNUFlexibleArrayUnionMember : DiagGroup<"gnu-flexible-array-union-member">;
128 def GNUFoldingConstant : DiagGroup<"gnu-folding-constant">;
129 def FormatExtraArgs : DiagGroup<"format-extra-args">;
130 def FormatZeroLength : DiagGroup<"format-zero-length">;
132 // Warnings for C++1y code which is not compatible with prior C++ standards.
133 def CXXPre14Compat : DiagGroup<"c++98-c++11-compat">;
134 def CXXPre14CompatPedantic : DiagGroup<"c++98-c++11-compat-pedantic",
136 def CXXPre1zCompat : DiagGroup<"c++98-c++11-c++14-compat">;
137 def CXXPre1zCompatPedantic : DiagGroup<"c++98-c++11-c++14-compat-pedantic",
140 def CXX98CompatBindToTemporaryCopy :
141 DiagGroup<"c++98-compat-bind-to-temporary-copy">;
142 def CXX98CompatLocalTypeTemplateArgs :
143 DiagGroup<"c++98-compat-local-type-template-args">;
144 def CXX98CompatUnnamedTypeTemplateArgs :
145 DiagGroup<"c++98-compat-unnamed-type-template-args">;
147 def CXX98Compat : DiagGroup<"c++98-compat",
148 [CXX98CompatLocalTypeTemplateArgs,
149 CXX98CompatUnnamedTypeTemplateArgs,
152 // Warnings for C++11 features which are Extensions in C++98 mode.
153 def CXX98CompatPedantic : DiagGroup<"c++98-compat-pedantic",
155 CXX98CompatBindToTemporaryCopy,
156 CXXPre14CompatPedantic,
157 CXXPre1zCompatPedantic]>;
159 def CXX11Narrowing : DiagGroup<"c++11-narrowing">;
161 def CXX11WarnOverrideMethod : DiagGroup<"inconsistent-missing-override">;
163 // Original name of this warning in Clang
164 def : DiagGroup<"c++0x-narrowing", [CXX11Narrowing]>;
166 // Name of this warning in GCC
167 def : DiagGroup<"narrowing", [CXX11Narrowing]>;
169 def CXX11CompatReservedUserDefinedLiteral :
170 DiagGroup<"c++11-compat-reserved-user-defined-literal">;
171 def ReservedUserDefinedLiteral :
172 DiagGroup<"reserved-user-defined-literal",
173 [CXX11CompatReservedUserDefinedLiteral]>;
175 def CXX11Compat : DiagGroup<"c++11-compat",
177 CXX11CompatReservedUserDefinedLiteral,
178 CXX11CompatDeprecatedWritableStr,
181 def : DiagGroup<"c++0x-compat", [CXX11Compat]>;
182 def CXX11CompatPedantic : DiagGroup<"c++11-compat-pedantic",
183 [CXXPre14CompatPedantic,
184 CXXPre1zCompatPedantic]>;
186 def CXX14Compat : DiagGroup<"c++14-compat", [CXXPre1zCompat]>;
187 def CXX14CompatPedantic : DiagGroup<"c++14-compat-pedantic",
188 [CXXPre1zCompatPedantic]>;
190 def CXX1zCompat : DiagGroup<"c++1z-compat", [DeprecatedRegister,
191 DeprecatedIncrementBool]>;
193 def : DiagGroup<"effc++">;
194 def DivZero : DiagGroup<"division-by-zero">;
195 def ExitTimeDestructors : DiagGroup<"exit-time-destructors">;
196 def FlexibleArrayExtensions : DiagGroup<"flexible-array-extensions">;
197 def FourByteMultiChar : DiagGroup<"four-char-constants">;
198 def GlobalConstructors : DiagGroup<"global-constructors">;
199 def BitwiseOpParentheses: DiagGroup<"bitwise-op-parentheses">;
200 def LogicalOpParentheses: DiagGroup<"logical-op-parentheses">;
201 def LogicalNotParentheses: DiagGroup<"logical-not-parentheses">;
202 def ShiftOpParentheses: DiagGroup<"shift-op-parentheses">;
203 def OverloadedShiftOpParentheses: DiagGroup<"overloaded-shift-op-parentheses">;
204 def DanglingElse: DiagGroup<"dangling-else">;
205 def DanglingField : DiagGroup<"dangling-field">;
206 def DistributedObjectModifiers : DiagGroup<"distributed-object-modifiers">;
207 def FlagEnum : DiagGroup<"flag-enum">;
208 def IncrementBool : DiagGroup<"increment-bool", [DeprecatedIncrementBool]>;
209 def InfiniteRecursion : DiagGroup<"infinite-recursion">;
210 def GNUImaginaryConstant : DiagGroup<"gnu-imaginary-constant">;
211 def IgnoredQualifiers : DiagGroup<"ignored-qualifiers">;
212 def : DiagGroup<"import">;
213 def GNUIncludeNext : DiagGroup<"gnu-include-next">;
214 def IncompatibleMSStruct : DiagGroup<"incompatible-ms-struct">;
215 def IncompatiblePointerTypesDiscardsQualifiers
216 : DiagGroup<"incompatible-pointer-types-discards-qualifiers">;
217 def IncompatiblePointerTypes
218 : DiagGroup<"incompatible-pointer-types",
219 [IncompatiblePointerTypesDiscardsQualifiers]>;
220 def IncompleteUmbrella : DiagGroup<"incomplete-umbrella">;
221 def NonModularIncludeInFrameworkModule
222 : DiagGroup<"non-modular-include-in-framework-module">;
223 def NonModularIncludeInModule : DiagGroup<"non-modular-include-in-module",
224 [NonModularIncludeInFrameworkModule]>;
225 def IncompleteModule : DiagGroup<"incomplete-module",
226 [IncompleteUmbrella, NonModularIncludeInModule]>;
228 def CXX11InlineNamespace : DiagGroup<"c++11-inline-namespace">;
229 def InvalidNoreturn : DiagGroup<"invalid-noreturn">;
230 def InvalidSourceEncoding : DiagGroup<"invalid-source-encoding">;
231 def KNRPromotedParameter : DiagGroup<"knr-promoted-parameter">;
232 def : DiagGroup<"init-self">;
233 def : DiagGroup<"inline">;
234 def : DiagGroup<"invalid-pch">;
235 def GNULabelsAsValue : DiagGroup<"gnu-label-as-value">;
236 def LiteralRange : DiagGroup<"literal-range">;
237 def LocalTypeTemplateArgs : DiagGroup<"local-type-template-args",
238 [CXX98CompatLocalTypeTemplateArgs]>;
239 def RangeLoopAnalysis : DiagGroup<"range-loop-analysis">;
240 def ForLoopAnalysis : DiagGroup<"for-loop-analysis">;
241 def LoopAnalysis : DiagGroup<"loop-analysis", [ForLoopAnalysis,
243 def MalformedWarningCheck : DiagGroup<"malformed-warning-check">;
244 def Main : DiagGroup<"main">;
245 def MainReturnType : DiagGroup<"main-return-type">;
246 def MissingBraces : DiagGroup<"missing-braces">;
247 def MissingDeclarations: DiagGroup<"missing-declarations">;
248 def : DiagGroup<"missing-format-attribute">;
249 def : DiagGroup<"missing-include-dirs">;
250 def MissingNoreturn : DiagGroup<"missing-noreturn">;
251 def MultiChar : DiagGroup<"multichar">;
252 def : DiagGroup<"nested-externs">;
253 def CXX11LongLong : DiagGroup<"c++11-long-long">;
254 def LongLong : DiagGroup<"long-long", [CXX11LongLong]>;
255 def ImplicitlyUnsignedLiteral : DiagGroup<"implicitly-unsigned-literal">;
256 def MethodSignatures : DiagGroup<"method-signatures">;
257 def MismatchedParameterTypes : DiagGroup<"mismatched-parameter-types">;
258 def MismatchedReturnTypes : DiagGroup<"mismatched-return-types">;
259 def MismatchedTags : DiagGroup<"mismatched-tags">;
260 def MissingFieldInitializers : DiagGroup<"missing-field-initializers">;
261 def ModuleBuild : DiagGroup<"module-build">;
262 def ModuleConflict : DiagGroup<"module-conflict">;
263 def ModuleFileExtension : DiagGroup<"module-file-extension">;
264 def NewlineEOF : DiagGroup<"newline-eof">;
265 def Nullability : DiagGroup<"nullability">;
266 def NullabilityDeclSpec : DiagGroup<"nullability-declspec">;
267 def NullableToNonNullConversion : DiagGroup<"nullable-to-nonnull-conversion">;
268 def NullabilityCompleteness : DiagGroup<"nullability-completeness">;
269 def NullArithmetic : DiagGroup<"null-arithmetic">;
270 def NullCharacter : DiagGroup<"null-character">;
271 def NullDereference : DiagGroup<"null-dereference">;
272 def InitializerOverrides : DiagGroup<"initializer-overrides">;
273 def NonNull : DiagGroup<"nonnull">;
274 def NonPODVarargs : DiagGroup<"non-pod-varargs">;
275 def ClassVarargs : DiagGroup<"class-varargs", [NonPODVarargs]>;
276 def : DiagGroup<"nonportable-cfstrings">;
277 def NonVirtualDtor : DiagGroup<"non-virtual-dtor">;
278 def OveralignedType : DiagGroup<"over-aligned">;
279 def OldStyleCast : DiagGroup<"old-style-cast">;
280 def : DiagGroup<"old-style-definition">;
281 def OutOfLineDeclaration : DiagGroup<"out-of-line-declaration">;
282 def : DiagGroup<"overflow">;
283 def ForwardClassReceiver : DiagGroup<"receiver-forward-class">;
284 def MethodAccess : DiagGroup<"objc-method-access">;
285 def ObjCReceiver : DiagGroup<"receiver-expr">;
286 // FIXME: Remove this when Xcode removes the warning setting.
287 def : DiagGroup<"receiver-is-weak">;
288 def OperatorNewReturnsNull : DiagGroup<"new-returns-null">;
289 def OverlengthStrings : DiagGroup<"overlength-strings">;
290 def OverloadedVirtual : DiagGroup<"overloaded-virtual">;
291 def PrivateExtern : DiagGroup<"private-extern">;
292 def SelTypeCast : DiagGroup<"cast-of-sel-type">;
293 def FunctionDefInObjCContainer : DiagGroup<"function-def-in-objc-container">;
294 def BadFunctionCast : DiagGroup<"bad-function-cast">;
295 def ObjCPropertyImpl : DiagGroup<"objc-property-implementation">;
296 def ObjCPropertyNoAttribute : DiagGroup<"objc-property-no-attribute">;
297 def ObjCProtocolQualifiers : DiagGroup<"objc-protocol-qualifiers">;
298 def ObjCMissingSuperCalls : DiagGroup<"objc-missing-super-calls">;
299 def ObjCDesignatedInit : DiagGroup<"objc-designated-initializers">;
300 def ObjCRetainBlockProperty : DiagGroup<"objc-noncopy-retain-block-property">;
301 def ObjCReadonlyPropertyHasSetter : DiagGroup<"objc-readonly-with-setter-property">;
302 def ObjCInvalidIBOutletProperty : DiagGroup<"invalid-iboutlet">;
303 def ObjCRootClass : DiagGroup<"objc-root-class">;
304 def ObjCPointerIntrospectPerformSelector : DiagGroup<"deprecated-objc-pointer-introspection-performSelector">;
305 def ObjCPointerIntrospect : DiagGroup<"deprecated-objc-pointer-introspection", [ObjCPointerIntrospectPerformSelector]>;
306 def ObjCMultipleMethodNames : DiagGroup<"objc-multiple-method-names">;
307 def DeprecatedObjCIsaUsage : DiagGroup<"deprecated-objc-isa-usage">;
308 def ExplicitInitializeCall : DiagGroup<"explicit-initialize-call">;
309 def Packed : DiagGroup<"packed">;
310 def Padded : DiagGroup<"padded">;
311 def PessimizingMove : DiagGroup<"pessimizing-move">;
312 def PointerArith : DiagGroup<"pointer-arith">;
313 def PoundWarning : DiagGroup<"#warnings">;
314 def PoundPragmaMessage : DiagGroup<"#pragma-messages">,
315 DiagCategory<"#pragma message Directive">;
316 def : DiagGroup<"pointer-to-int-cast">;
317 def : DiagGroup<"redundant-decls">;
318 def RedeclaredClassMember : DiagGroup<"redeclared-class-member">;
319 def GNURedeclaredEnum : DiagGroup<"gnu-redeclared-enum">;
320 def RedundantMove : DiagGroup<"redundant-move">;
321 def Register : DiagGroup<"register", [DeprecatedRegister]>;
322 def ReturnStackAddress : DiagGroup<"return-stack-address">;
323 def ReturnTypeCLinkage : DiagGroup<"return-type-c-linkage">;
324 def ReturnType : DiagGroup<"return-type", [ReturnTypeCLinkage]>;
325 def BindToTemporaryCopy : DiagGroup<"bind-to-temporary-copy",
326 [CXX98CompatBindToTemporaryCopy]>;
327 def SelfAssignmentField : DiagGroup<"self-assign-field">;
328 def SelfAssignment : DiagGroup<"self-assign", [SelfAssignmentField]>;
329 def SelfMove : DiagGroup<"self-move">;
330 def SemiBeforeMethodBody : DiagGroup<"semicolon-before-method-body">;
331 def Sentinel : DiagGroup<"sentinel">;
332 def MissingMethodReturnType : DiagGroup<"missing-method-return-type">;
333 def Shadow : DiagGroup<"shadow">;
334 def Shorten64To32 : DiagGroup<"shorten-64-to-32">;
335 def : DiagGroup<"sign-promo">;
336 def SignCompare : DiagGroup<"sign-compare">;
337 def : DiagGroup<"stack-protector">;
338 def : DiagGroup<"switch-default">;
339 def : DiagGroup<"synth">;
340 def SizeofArrayArgument : DiagGroup<"sizeof-array-argument">;
341 def SizeofArrayDecay : DiagGroup<"sizeof-array-decay">;
342 def SizeofPointerMemaccess : DiagGroup<"sizeof-pointer-memaccess">;
343 def StaticInInline : DiagGroup<"static-in-inline">;
344 def StaticLocalInInline : DiagGroup<"static-local-in-inline">;
345 def GNUStaticFloatInit : DiagGroup<"gnu-static-float-init">;
346 def StaticFloatInit : DiagGroup<"static-float-init", [GNUStaticFloatInit]>;
347 def GNUStatementExpression : DiagGroup<"gnu-statement-expression">;
348 def StringCompare : DiagGroup<"string-compare">;
349 def StringPlusInt : DiagGroup<"string-plus-int">;
350 def StringPlusChar : DiagGroup<"string-plus-char">;
351 def StrncatSize : DiagGroup<"strncat-size">;
352 def TautologicalOutOfRangeCompare : DiagGroup<"tautological-constant-out-of-range-compare">;
353 def TautologicalPointerCompare : DiagGroup<"tautological-pointer-compare">;
354 def TautologicalOverlapCompare : DiagGroup<"tautological-overlap-compare">;
355 def TautologicalUndefinedCompare : DiagGroup<"tautological-undefined-compare">;
356 def TautologicalCompare : DiagGroup<"tautological-compare",
357 [TautologicalOutOfRangeCompare,
358 TautologicalPointerCompare,
359 TautologicalOverlapCompare,
360 TautologicalUndefinedCompare]>;
361 def HeaderHygiene : DiagGroup<"header-hygiene">;
362 def DuplicateDeclSpecifier : DiagGroup<"duplicate-decl-specifier">;
363 def CompareDistinctPointerType : DiagGroup<"compare-distinct-pointer-types">;
364 def GNUUnionCast : DiagGroup<"gnu-union-cast">;
365 def GNUVariableSizedTypeNotAtEnd : DiagGroup<"gnu-variable-sized-type-not-at-end">;
366 def Varargs : DiagGroup<"varargs">;
368 def Unsequenced : DiagGroup<"unsequenced">;
369 // GCC name for -Wunsequenced
370 def : DiagGroup<"sequence-point", [Unsequenced]>;
372 // Preprocessor warnings.
373 def AmbiguousMacro : DiagGroup<"ambiguous-macro">;
374 def KeywordAsMacro : DiagGroup<"keyword-macro">;
375 def ReservedIdAsMacro : DiagGroup<"reserved-id-macro">;
377 // Just silence warnings about -Wstrict-aliasing for now.
378 def : DiagGroup<"strict-aliasing=0">;
379 def : DiagGroup<"strict-aliasing=1">;
380 def : DiagGroup<"strict-aliasing=2">;
381 def : DiagGroup<"strict-aliasing">;
383 // Just silence warnings about -Wstrict-overflow for now.
384 def : DiagGroup<"strict-overflow=0">;
385 def : DiagGroup<"strict-overflow=1">;
386 def : DiagGroup<"strict-overflow=2">;
387 def : DiagGroup<"strict-overflow=3">;
388 def : DiagGroup<"strict-overflow=4">;
389 def : DiagGroup<"strict-overflow=5">;
390 def : DiagGroup<"strict-overflow">;
392 def InvalidOffsetof : DiagGroup<"invalid-offsetof">;
393 def : DiagGroup<"strict-prototypes">;
394 def StrictSelector : DiagGroup<"strict-selector-match">;
395 def MethodDuplicate : DiagGroup<"duplicate-method-match">;
396 def ObjCCStringFormat : DiagGroup<"cstring-format-directive">;
397 def CoveredSwitchDefault : DiagGroup<"covered-switch-default">;
398 def SwitchBool : DiagGroup<"switch-bool">;
399 def SwitchEnum : DiagGroup<"switch-enum">;
400 def Switch : DiagGroup<"switch">;
401 def ImplicitFallthroughPerFunction :
402 DiagGroup<"implicit-fallthrough-per-function">;
403 def ImplicitFallthrough : DiagGroup<"implicit-fallthrough",
404 [ImplicitFallthroughPerFunction]>;
405 def InvalidPPToken : DiagGroup<"invalid-pp-token">;
406 def Trigraphs : DiagGroup<"trigraphs">;
408 def : DiagGroup<"type-limits">;
409 def UndefinedReinterpretCast : DiagGroup<"undefined-reinterpret-cast">;
410 def ReinterpretBaseClass : DiagGroup<"reinterpret-base-class">;
411 def Unicode : DiagGroup<"unicode">;
412 def UninitializedMaybe : DiagGroup<"conditional-uninitialized">;
413 def UninitializedSometimes : DiagGroup<"sometimes-uninitialized">;
414 def UninitializedStaticSelfInit : DiagGroup<"static-self-init">;
415 def Uninitialized : DiagGroup<"uninitialized", [UninitializedSometimes,
416 UninitializedStaticSelfInit]>;
417 def UnknownPragmas : DiagGroup<"unknown-pragmas">;
418 def IgnoredPragmas : DiagGroup<"ignored-pragmas">;
419 def Pragmas : DiagGroup<"pragmas", [UnknownPragmas, IgnoredPragmas]>;
420 def UnknownWarningOption : DiagGroup<"unknown-warning-option">;
421 def NSobjectAttribute : DiagGroup<"NSObject-attribute">;
422 def IndependentClassAttribute : DiagGroup<"IndependentClass-attribute">;
423 def UnknownAttributes : DiagGroup<"unknown-attributes">;
424 def IgnoredAttributes : DiagGroup<"ignored-attributes">;
425 def Attributes : DiagGroup<"attributes", [UnknownAttributes,
427 def UnknownSanitizers : DiagGroup<"unknown-sanitizers">;
428 def UnnamedTypeTemplateArgs : DiagGroup<"unnamed-type-template-args",
429 [CXX98CompatUnnamedTypeTemplateArgs]>;
430 def UnsupportedFriend : DiagGroup<"unsupported-friend">;
431 def UnusedArgument : DiagGroup<"unused-argument">;
432 def UnusedCommandLineArgument : DiagGroup<"unused-command-line-argument">;
433 def IgnoredOptimizationArgument : DiagGroup<"ignored-optimization-argument">;
434 def InvalidCommandLineArgument : DiagGroup<"invalid-command-line-argument",
435 [IgnoredOptimizationArgument]>;
436 def UnusedComparison : DiagGroup<"unused-comparison">;
437 def UnusedExceptionParameter : DiagGroup<"unused-exception-parameter">;
438 def UnneededInternalDecl : DiagGroup<"unneeded-internal-declaration">;
439 def UnneededMemberFunction : DiagGroup<"unneeded-member-function">;
440 def UnusedPrivateField : DiagGroup<"unused-private-field">;
441 def UnusedFunction : DiagGroup<"unused-function", [UnneededInternalDecl]>;
442 def UnusedMemberFunction : DiagGroup<"unused-member-function",
443 [UnneededMemberFunction]>;
444 def UnusedLabel : DiagGroup<"unused-label">;
445 def UnusedParameter : DiagGroup<"unused-parameter">;
446 def UnusedResult : DiagGroup<"unused-result">;
447 def PotentiallyEvaluatedExpression : DiagGroup<"potentially-evaluated-expression">;
448 def UnevaluatedExpression : DiagGroup<"unevaluated-expression",
449 [PotentiallyEvaluatedExpression]>;
450 def UnusedValue : DiagGroup<"unused-value", [UnusedComparison, UnusedResult,
451 UnevaluatedExpression]>;
452 def UnusedConstVariable : DiagGroup<"unused-const-variable">;
453 def UnusedVariable : DiagGroup<"unused-variable",
454 [UnusedConstVariable]>;
455 def UnusedLocalTypedef : DiagGroup<"unused-local-typedef">;
456 def UnusedPropertyIvar : DiagGroup<"unused-property-ivar">;
457 def UnusedGetterReturnValue : DiagGroup<"unused-getter-return-value">;
458 def UsedButMarkedUnused : DiagGroup<"used-but-marked-unused">;
459 def UserDefinedLiterals : DiagGroup<"user-defined-literals">;
460 def Reorder : DiagGroup<"reorder">;
461 def UndeclaredSelector : DiagGroup<"undeclared-selector">;
462 def ImplicitAtomic : DiagGroup<"implicit-atomic-properties">;
463 def CustomAtomic : DiagGroup<"custom-atomic-properties">;
464 def AtomicProperties : DiagGroup<"atomic-properties",
465 [ImplicitAtomic, CustomAtomic]>;
466 def ARCUnsafeRetainedAssign : DiagGroup<"arc-unsafe-retained-assign">;
467 def ARCRetainCycles : DiagGroup<"arc-retain-cycles">;
468 def ARCNonPodMemAccess : DiagGroup<"arc-non-pod-memaccess">;
469 def AutomaticReferenceCounting : DiagGroup<"arc",
470 [ARCUnsafeRetainedAssign,
472 ARCNonPodMemAccess]>;
473 def ARCRepeatedUseOfWeakMaybe : DiagGroup<"arc-maybe-repeated-use-of-weak">;
474 def ARCRepeatedUseOfWeak : DiagGroup<"arc-repeated-use-of-weak",
475 [ARCRepeatedUseOfWeakMaybe]>;
476 def ObjCBridge : DiagGroup<"bridge-cast">;
478 def DeallocInCategory:DiagGroup<"dealloc-in-category">;
479 def SelectorTypeMismatch : DiagGroup<"selector-type-mismatch">;
480 def Selector : DiagGroup<"selector", [SelectorTypeMismatch]>;
481 def Protocol : DiagGroup<"protocol">;
482 def AtProtocol : DiagGroup<"at-protocol">;
483 def PropertyAccessDotSyntax: DiagGroup<"property-access-dot-syntax">;
484 def PropertyAttr : DiagGroup<"property-attribute-mismatch">;
485 def SuperSubClassMismatch : DiagGroup<"super-class-method-mismatch">;
486 def OverridingMethodMismatch : DiagGroup<"overriding-method-mismatch">;
487 def VariadicMacros : DiagGroup<"variadic-macros">;
488 def VectorConversion : DiagGroup<"vector-conversion">; // clang specific
489 def VexingParse : DiagGroup<"vexing-parse">;
490 def VLA : DiagGroup<"vla">;
491 def VLAExtension : DiagGroup<"vla-extension">;
492 def VolatileRegisterVar : DiagGroup<"volatile-register-var">;
493 def Visibility : DiagGroup<"visibility">;
494 def ZeroLengthArray : DiagGroup<"zero-length-array">;
495 def GNUZeroLineDirective : DiagGroup<"gnu-zero-line-directive">;
496 def GNUZeroVariadicMacroArguments : DiagGroup<"gnu-zero-variadic-macro-arguments">;
497 def Fallback : DiagGroup<"fallback">;
499 // This covers both the deprecated case (in C++98)
500 // and the extension case (in C++11 onwards).
501 def WritableStrings : DiagGroup<"writable-strings", [DeprecatedWritableStr]>;
503 // GCC calls -Wdeprecated-writable-strings -Wwrite-strings.
505 // Bizarrely, this warning flag enables -fconst-strings in C. This is
506 // GCC-compatible, but really weird.
508 // FIXME: Should this affect C++11 (where this is an error,
509 // not just deprecated) or not?
510 def GCCWriteStrings : DiagGroup<"write-strings" , [WritableStrings]>;
512 def CharSubscript : DiagGroup<"char-subscripts">;
513 def LargeByValueCopy : DiagGroup<"large-by-value-copy">;
514 def DuplicateArgDecl : DiagGroup<"duplicate-method-arg">;
516 // Unreachable code warning groups.
518 // The goal is make -Wunreachable-code on by default, in -Wall, or at
519 // least actively used, with more noisy versions of the warning covered
520 // under separate flags.
522 def UnreachableCodeLoopIncrement : DiagGroup<"unreachable-code-loop-increment">;
523 def UnreachableCode : DiagGroup<"unreachable-code",
524 [UnreachableCodeLoopIncrement]>;
525 def UnreachableCodeBreak : DiagGroup<"unreachable-code-break">;
526 def UnreachableCodeReturn : DiagGroup<"unreachable-code-return">;
527 def UnreachableCodeAggressive : DiagGroup<"unreachable-code-aggressive",
529 UnreachableCodeBreak,
530 UnreachableCodeReturn]>;
532 // Aggregation warning settings.
534 // Populate -Waddress with warnings from other groups.
535 def : DiagGroup<"address", [PointerBoolConversion,
537 TautologicalPointerCompare]>;
539 // -Widiomatic-parentheses contains warnings about 'idiomatic'
540 // missing parentheses; it is off by default. We do not include it
541 // in -Wparentheses because most users who use -Wparentheses explicitly
542 // do not want these warnings.
543 def ParenthesesOnEquality : DiagGroup<"parentheses-equality">;
544 def Parentheses : DiagGroup<"parentheses",
545 [LogicalOpParentheses,
546 LogicalNotParentheses,
547 BitwiseOpParentheses,
549 OverloadedShiftOpParentheses,
550 ParenthesesOnEquality,
553 // -Wconversion has its own warnings, but we split a few out for
555 // - some people want just 64-to-32 warnings
556 // - conversion warnings with constant sources are on by default
557 // - conversion warnings for literals are on by default
558 // - bool-to-pointer conversion warnings are on by default
559 // - __null-to-integer conversion warnings are on by default
560 def Conversion : DiagGroup<"conversion",
568 NonLiteralNullConversion, // (1-1)->pointer (etc)
569 NullConversion, // NULL->non-pointer
570 ObjCLiteralConversion,
573 DiagCategory<"Value Conversion Issue">;
575 def Unused : DiagGroup<"unused",
576 [UnusedArgument, UnusedFunction, UnusedLabel,
577 // UnusedParameter, (matches GCC's behavior)
578 // UnusedMemberFunction, (clean-up llvm before enabling)
579 UnusedPrivateField, UnusedLocalTypedef,
580 UnusedValue, UnusedVariable, UnusedPropertyIvar]>,
581 DiagCategory<"Unused Entity Issue">;
584 def FormatInvalidSpecifier : DiagGroup<"format-invalid-specifier">;
585 def FormatSecurity : DiagGroup<"format-security">;
586 def FormatNonStandard : DiagGroup<"format-non-iso">;
587 def FormatY2K : DiagGroup<"format-y2k">;
588 def FormatPedantic : DiagGroup<"format-pedantic">;
589 def Format : DiagGroup<"format",
590 [FormatExtraArgs, FormatZeroLength, NonNull,
591 FormatSecurity, FormatY2K, FormatInvalidSpecifier]>,
592 DiagCategory<"Format String Issue">;
593 def FormatNonLiteral : DiagGroup<"format-nonliteral">;
594 def Format2 : DiagGroup<"format=2",
595 [FormatNonLiteral, FormatSecurity, FormatY2K]>;
597 def TypeSafety : DiagGroup<"type-safety">;
599 def IntToVoidPointerCast : DiagGroup<"int-to-void-pointer-cast">;
600 def IntToPointerCast : DiagGroup<"int-to-pointer-cast",
601 [IntToVoidPointerCast]>;
603 def Move : DiagGroup<"move", [PessimizingMove, RedundantMove, SelfMove]>;
605 def Extra : DiagGroup<"extra", [
606 MissingFieldInitializers,
608 InitializerOverrides,
609 SemiBeforeMethodBody,
610 MissingMethodReturnType,
615 def Most : DiagGroup<"most", [
618 DeleteNonVirtualDtor,
639 ObjCMissingSuperCalls,
647 // Thread Safety warnings
648 def ThreadSafetyAttributes : DiagGroup<"thread-safety-attributes">;
649 def ThreadSafetyAnalysis : DiagGroup<"thread-safety-analysis">;
650 def ThreadSafetyPrecise : DiagGroup<"thread-safety-precise">;
651 def ThreadSafetyReference : DiagGroup<"thread-safety-reference">;
652 def ThreadSafetyNegative : DiagGroup<"thread-safety-negative">;
653 def ThreadSafety : DiagGroup<"thread-safety",
654 [ThreadSafetyAttributes,
655 ThreadSafetyAnalysis,
657 ThreadSafetyReference]>;
658 def ThreadSafetyVerbose : DiagGroup<"thread-safety-verbose">;
659 def ThreadSafetyBeta : DiagGroup<"thread-safety-beta">;
661 // Uniqueness Analysis warnings
662 def Consumed : DiagGroup<"consumed">;
664 // Note that putting warnings in -Wall will not disable them by default. If a
665 // warning should be active _only_ when -Wall is passed in, mark it as
666 // DefaultIgnore in addition to putting it here.
667 def All : DiagGroup<"all", [Most, Parentheses, Switch, SwitchBool]>;
669 // Warnings that should be in clang-cl /w4.
670 def : DiagGroup<"CL4", [All, Extra]>;
672 // Warnings enabled by -pedantic. This is magically filled in by TableGen.
673 def Pedantic : DiagGroup<"pedantic">;
676 def : DiagGroup<"", [Extra]>; // -W = -Wextra
677 def : DiagGroup<"endif-labels", [ExtraTokens]>; // -Wendif-labels=-Wextra-tokens
678 def : DiagGroup<"comments", [Comment]>; // -Wcomments = -Wcomment
679 def : DiagGroup<"conversion-null",
680 [NullConversion]>; // -Wconversion-null = -Wnull-conversion
681 def : DiagGroup<"bool-conversions",
682 [BoolConversion]>; // -Wbool-conversions = -Wbool-conversion
683 def : DiagGroup<"int-conversions",
684 [IntConversion]>; // -Wint-conversions = -Wint-conversion
685 def : DiagGroup<"vector-conversions",
686 [VectorConversion]>; // -Wvector-conversions = -Wvector-conversion
687 def : DiagGroup<"unused-local-typedefs", [UnusedLocalTypedef]>;
688 // -Wunused-local-typedefs = -Wunused-local-typedef
690 // A warning group for warnings that we want to have on by default in clang,
691 // but which aren't on by default in GCC.
692 def NonGCC : DiagGroup<"non-gcc",
693 [SignCompare, Conversion, LiteralRange]>;
695 // A warning group for warnings about using C++11 features as extensions in
696 // earlier C++ versions.
697 def CXX11 : DiagGroup<"c++11-extensions", [CXX11ExtraSemi, CXX11InlineNamespace,
700 // A warning group for warnings about using C++14 features as extensions in
701 // earlier C++ versions.
702 def CXX14 : DiagGroup<"c++14-extensions", [CXX14BinaryLiteral]>;
704 // A warning group for warnings about using C++1z features as extensions in
705 // earlier C++ versions.
706 def CXX1z : DiagGroup<"c++1z-extensions">;
708 def : DiagGroup<"c++0x-extensions", [CXX11]>;
709 def : DiagGroup<"c++1y-extensions", [CXX14]>;
711 def DelegatingCtorCycles :
712 DiagGroup<"delegating-ctor-cycles">;
714 // A warning group for warnings about using C11 features as extensions.
715 def C11 : DiagGroup<"c11-extensions">;
717 // A warning group for warnings about using C99 features as extensions.
718 def C99 : DiagGroup<"c99-extensions">;
720 // A warning group for warnings about GCC extensions.
721 def GNU : DiagGroup<"gnu", [GNUAlignofExpression, GNUAnonymousStruct,
723 GNUBinaryLiteral, GNUCaseRange,
724 GNUComplexInteger, GNUCompoundLiteralInitializer,
725 GNUConditionalOmittedOperand, GNUDesignator,
726 GNUEmptyInitializer, GNUEmptyStruct,
727 VLAExtension, GNUFlexibleArrayInitializer,
728 GNUFlexibleArrayUnionMember, GNUFoldingConstant,
729 GNUImaginaryConstant, GNUIncludeNext,
731 RedeclaredClassMember, GNURedeclaredEnum,
732 GNUStatementExpression, GNUStaticFloatInit,
733 GNUStringLiteralOperatorTemplate,
734 GNUUnionCast, GNUVariableSizedTypeNotAtEnd,
735 ZeroLengthArray, GNUZeroLineDirective,
736 GNUZeroVariadicMacroArguments]>;
737 // A warning group for warnings about code that clang accepts but gcc doesn't.
738 def GccCompat : DiagGroup<"gcc-compat">;
740 // Warnings for Microsoft extensions.
741 def MicrosoftCharize : DiagGroup<"microsoft-charize">;
742 def MicrosoftInclude : DiagGroup<"microsoft-include">;
743 def MicrosoftCppMacro : DiagGroup<"microsoft-cpp-macro">;
744 def MicrosoftFixedEnum : DiagGroup<"microsoft-fixed-enum">;
745 def MicrosoftSealed : DiagGroup<"microsoft-sealed">;
746 def MicrosoftUnqualifiedFriend : DiagGroup<"microsoft-unqualified-friend">;
747 def MicrosoftExceptionSpec : DiagGroup<"microsoft-exception-spec">;
748 def MicrosoftUsingDecl : DiagGroup<"microsoft-using-decl">;
749 def MicrosoftMutableReference : DiagGroup<"microsoft-mutable-reference">;
750 def MicrosoftPureDefinition : DiagGroup<"microsoft-pure-definition">;
751 def MicrosoftUnionMemberReference : DiagGroup<
752 "microsoft-union-member-reference">;
753 def MicrosoftExplicitConstructorCall : DiagGroup<
754 "microsoft-explicit-constructor-call">;
755 def MicrosoftEnumValue : DiagGroup<"microsoft-enum-value">;
756 def MicrosoftDefaultArgRedefinition :
757 DiagGroup<"microsoft-default-arg-redefinition">;
758 def MicrosoftTemplate : DiagGroup<"microsoft-template">;
759 def MicrosoftRedeclareStatic : DiagGroup<"microsoft-redeclare-static">;
760 def MicrosoftEnumForwardReference :
761 DiagGroup<"microsoft-enum-forward-reference">;
762 def MicrosoftGoto : DiagGroup<"microsoft-goto">;
763 def MicrosoftFlexibleArray : DiagGroup<"microsoft-flexible-array">;
764 def MicrosoftExtraQualification : DiagGroup<"microsoft-extra-qualification">;
765 def MicrosoftCast : DiagGroup<"microsoft-cast">;
766 def MicrosoftConstInit : DiagGroup<"microsoft-const-init">;
767 def MicrosoftVoidPseudoDtor : DiagGroup<"microsoft-void-pseudo-dtor">;
768 def MicrosoftAnonTag : DiagGroup<"microsoft-anon-tag">;
769 def MicrosoftCommentPaste : DiagGroup<"microsoft-comment-paste">;
770 def MicrosoftEndOfFile : DiagGroup<"microsoft-end-of-file">;
772 def : DiagGroup<"msvc-include", [MicrosoftInclude]>;
773 // -Wmsvc-include = -Wmicrosoft-include
775 // Warnings group for warnings about Microsoft extensions.
776 def Microsoft : DiagGroup<"microsoft",
777 [MicrosoftCharize, MicrosoftInclude, MicrosoftCppMacro, MicrosoftFixedEnum,
778 MicrosoftSealed, MicrosoftUnqualifiedFriend, MicrosoftExceptionSpec,
779 MicrosoftUsingDecl, MicrosoftMutableReference, MicrosoftPureDefinition,
780 MicrosoftUnionMemberReference, MicrosoftExplicitConstructorCall,
781 MicrosoftEnumValue, MicrosoftDefaultArgRedefinition, MicrosoftTemplate,
782 MicrosoftRedeclareStatic, MicrosoftEnumForwardReference, MicrosoftGoto,
783 MicrosoftFlexibleArray, MicrosoftExtraQualification, MicrosoftCast,
784 MicrosoftConstInit, MicrosoftVoidPseudoDtor, MicrosoftAnonTag,
785 MicrosoftCommentPaste, MicrosoftEndOfFile]>;
787 def ObjCNonUnifiedException : DiagGroup<"objc-nonunified-exceptions">;
789 def ObjCProtocolMethodImpl : DiagGroup<"objc-protocol-method-implementation">;
791 def ObjCNoPropertyAutoSynthesis : DiagGroup<"objc-property-synthesis">;
793 // ObjC API warning groups.
794 def ObjCRedundantLiteralUse : DiagGroup<"objc-redundant-literal-use">;
795 def ObjCRedundantAPIUse : DiagGroup<"objc-redundant-api-use", [
796 ObjCRedundantLiteralUse
799 def ObjCCocoaAPI : DiagGroup<"objc-cocoa-api", [
803 def ObjCStringComparison : DiagGroup<"objc-string-compare">;
804 def ObjCStringConcatenation : DiagGroup<"objc-string-concatenation">;
805 def ObjCLiteralComparison : DiagGroup<"objc-literal-compare", [
809 // Inline ASM warnings.
810 def ASMOperandWidths : DiagGroup<"asm-operand-widths">;
811 def ASM : DiagGroup<"asm", [
816 def SourceUsesOpenMP : DiagGroup<"source-uses-openmp">;
817 def OpenMPClauses : DiagGroup<"openmp-clauses">;
818 def OpenMPLoopForm : DiagGroup<"openmp-loop-form">;
821 def BackendInlineAsm : DiagGroup<"inline-asm">;
822 def BackendFrameLargerThanEQ : DiagGroup<"frame-larger-than=">;
823 def BackendPlugin : DiagGroup<"backend-plugin">;
824 def RemarkBackendPlugin : DiagGroup<"remark-backend-plugin">;
825 def BackendOptimizationRemark : DiagGroup<"pass">;
826 def BackendOptimizationRemarkMissed : DiagGroup<"pass-missed">;
827 def BackendOptimizationRemarkAnalysis : DiagGroup<"pass-analysis">;
828 def BackendOptimizationFailure : DiagGroup<"pass-failed">;
830 // Instrumentation based profiling warnings.
831 def ProfileInstrOutOfDate : DiagGroup<"profile-instr-out-of-date">;
832 def ProfileInstrUnprofiled : DiagGroup<"profile-instr-unprofiled">;
834 // AddressSanitizer frontent instrumentation remarks.
835 def SanitizeAddressRemarks : DiagGroup<"sanitize-address">;
837 // Issues with serialized diagnostics.
838 def SerializedDiagnostics : DiagGroup<"serialized-diagnostics">;
840 // A warning group for warnings about code that clang accepts when
841 // compiling CUDA C/C++ but which is not compatible with the CUDA spec.
842 def CudaCompat : DiagGroup<"cuda-compat">;
844 // A warning group for things that will change semantics in the future.
845 def FutureCompat : DiagGroup<"future-compat">;
847 def InvalidOrNonExistentDirectory : DiagGroup<"invalid-or-nonexistent-directory">;
849 def OptionIgnored : DiagGroup<"option-ignored">;