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