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 : DiagGroup<"address">;
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 BoolConversion : DiagGroup<"bool-conversion">;
41 def IntConversion : DiagGroup<"int-conversion">;
42 def EnumConversion : DiagGroup<"enum-conversion">;
43 def NonLiteralNullConversion : DiagGroup<"non-literal-null-conversion">;
44 def NullConversion : DiagGroup<"null-conversion">;
45 def ImplicitConversionFloatingPointToBool :
46 DiagGroup<"implicit-conversion-floating-point-to-bool">;
47 def BadArrayNewLength : DiagGroup<"bad-array-new-length">;
48 def BuiltinMacroRedefined : DiagGroup<"builtin-macro-redefined">;
49 def BuiltinRequiresHeader : DiagGroup<"builtin-requires-header">;
50 def C99Compat : DiagGroup<"c99-compat">;
51 def CXXCompat: DiagGroup<"c++-compat">;
52 def ExternCCompat : DiagGroup<"extern-c-compat">;
53 def KeywordCompat : DiagGroup<"keyword-compat">;
54 def GNUCaseRange : DiagGroup<"gnu-case-range">;
55 def CastAlign : DiagGroup<"cast-align">;
56 def : DiagGroup<"cast-qual">;
57 def : DiagGroup<"char-align">;
58 def Comment : DiagGroup<"comment">;
59 def GNUComplexInteger : DiagGroup<"gnu-complex-integer">;
60 def GNUConditionalOmittedOperand : DiagGroup<"gnu-conditional-omitted-operand">;
61 def ConfigMacros : DiagGroup<"config-macros">;
62 def : DiagGroup<"ctor-dtor-privacy">;
63 def GNUDesignator : DiagGroup<"gnu-designator">;
64 def GNUStringLiteralOperatorTemplate :
65 DiagGroup<"gnu-string-literal-operator-template">;
67 def DeleteNonVirtualDtor : DiagGroup<"delete-non-virtual-dtor">;
68 def AbstractFinalClass : DiagGroup<"abstract-final-class">;
70 def CXX11CompatDeprecatedWritableStr :
71 DiagGroup<"c++11-compat-deprecated-writable-strings">;
73 def DeprecatedDeclarations : DiagGroup<"deprecated-declarations">;
74 def DeprecatedImplementations :DiagGroup<"deprecated-implementations">;
75 def DeprecatedIncrementBool : DiagGroup<"deprecated-increment-bool">;
76 def DeprecatedRegister : DiagGroup<"deprecated-register">;
77 def DeprecatedWritableStr : DiagGroup<"deprecated-writable-strings",
78 [CXX11CompatDeprecatedWritableStr]>;
79 // FIXME: Why are DeprecatedImplementations and DeprecatedWritableStr
81 def Deprecated : DiagGroup<"deprecated", [DeprecatedDeclarations,
82 DeprecatedIncrementBool,
84 DiagCategory<"Deprecations">;
86 def : DiagGroup<"disabled-optimization">;
87 def : DiagGroup<"discard-qual">;
88 def : DiagGroup<"div-by-zero">;
90 def DocumentationHTML : DiagGroup<"documentation-html">;
91 def DocumentationUnknownCommand : DiagGroup<"documentation-unknown-command">;
92 def DocumentationPedantic : DiagGroup<"documentation-pedantic",
93 [DocumentationUnknownCommand]>;
94 def DocumentationDeprecatedSync : DiagGroup<"documentation-deprecated-sync">;
95 def Documentation : DiagGroup<"documentation",
97 DocumentationDeprecatedSync]>;
99 def EmptyBody : DiagGroup<"empty-body">;
100 def GNUEmptyInitializer : DiagGroup<"gnu-empty-initializer">;
101 def GNUEmptyStruct : DiagGroup<"gnu-empty-struct">;
102 def ExtraTokens : DiagGroup<"extra-tokens">;
103 def CXX11ExtraSemi : DiagGroup<"c++11-extra-semi">;
104 def ExtraSemi : DiagGroup<"extra-semi", [CXX11ExtraSemi]>;
106 def GNUFlexibleArrayInitializer : DiagGroup<"gnu-flexible-array-initializer">;
107 def GNUFlexibleArrayUnionMember : DiagGroup<"gnu-flexible-array-union-member">;
108 def GNUFoldingConstant : DiagGroup<"gnu-folding-constant">;
109 def FormatExtraArgs : DiagGroup<"format-extra-args">;
110 def FormatZeroLength : DiagGroup<"format-zero-length">;
112 // Warnings for C++1y code which is not compatible with prior C++ standards.
113 def CXXPre1yCompat : DiagGroup<"c++98-c++11-compat">;
114 def CXXPre1yCompatPedantic : DiagGroup<"c++98-c++11-compat-pedantic",
117 def CXX98CompatBindToTemporaryCopy :
118 DiagGroup<"c++98-compat-bind-to-temporary-copy">;
119 def CXX98CompatLocalTypeTemplateArgs :
120 DiagGroup<"c++98-compat-local-type-template-args">;
121 def CXX98CompatUnnamedTypeTemplateArgs :
122 DiagGroup<"c++98-compat-unnamed-type-template-args">;
124 def CXX98Compat : DiagGroup<"c++98-compat",
125 [CXX98CompatBindToTemporaryCopy,
126 CXX98CompatLocalTypeTemplateArgs,
127 CXX98CompatUnnamedTypeTemplateArgs,
129 // Warnings for C++11 features which are Extensions in C++98 mode.
130 def CXX98CompatPedantic : DiagGroup<"c++98-compat-pedantic",
132 CXXPre1yCompatPedantic]>;
134 def CXX11Narrowing : DiagGroup<"c++11-narrowing">;
136 // Original name of this warning in Clang
137 def : DiagGroup<"c++0x-narrowing", [CXX11Narrowing]>;
139 // Name of this warning in GCC
140 def : DiagGroup<"narrowing", [CXX11Narrowing]>;
142 def CXX11CompatReservedUserDefinedLiteral :
143 DiagGroup<"c++11-compat-reserved-user-defined-literal">;
144 def ReservedUserDefinedLiteral :
145 DiagGroup<"reserved-user-defined-literal",
146 [CXX11CompatReservedUserDefinedLiteral]>;
148 def CXX11Compat : DiagGroup<"c++11-compat",
150 CXX11CompatReservedUserDefinedLiteral,
151 CXX11CompatDeprecatedWritableStr,
153 def : DiagGroup<"c++0x-compat", [CXX11Compat]>;
154 def CXX11CompatPedantic : DiagGroup<"c++11-compat-pedantic",
155 [CXXPre1yCompatPedantic]>;
157 def : DiagGroup<"effc++">;
158 def DivZero : DiagGroup<"division-by-zero">;
159 def ExitTimeDestructors : DiagGroup<"exit-time-destructors">;
160 def FlexibleArrayExtensions : DiagGroup<"flexible-array-extensions">;
161 def FourByteMultiChar : DiagGroup<"four-char-constants">;
162 def GlobalConstructors : DiagGroup<"global-constructors">;
163 def BitwiseOpParentheses: DiagGroup<"bitwise-op-parentheses">;
164 def LogicalOpParentheses: DiagGroup<"logical-op-parentheses">;
165 def LogicalNotParentheses: DiagGroup<"logical-not-parentheses">;
166 def ShiftOpParentheses: DiagGroup<"shift-op-parentheses">;
167 def OverloadedShiftOpParentheses: DiagGroup<"overloaded-shift-op-parentheses">;
168 def DanglingElse: DiagGroup<"dangling-else">;
169 def DanglingField : DiagGroup<"dangling-field">;
170 def DistributedObjectModifiers : DiagGroup<"distributed-object-modifiers">;
171 def GNUImaginaryConstant : DiagGroup<"gnu-imaginary-constant">;
172 def IgnoredQualifiers : DiagGroup<"ignored-qualifiers">;
173 def : DiagGroup<"import">;
174 def IncompatiblePointerTypesDiscardsQualifiers
175 : DiagGroup<"incompatible-pointer-types-discards-qualifiers">;
176 def IncompatiblePointerTypes
177 : DiagGroup<"incompatible-pointer-types",
178 [IncompatiblePointerTypesDiscardsQualifiers]>;
179 def IncompleteUmbrella : DiagGroup<"incomplete-umbrella">;
180 def IncompleteModule : DiagGroup<"incomplete-module", [IncompleteUmbrella]>;
181 def InvalidNoreturn : DiagGroup<"invalid-noreturn">;
182 def InvalidSourceEncoding : DiagGroup<"invalid-source-encoding">;
183 def KNRPromotedParameter : DiagGroup<"knr-promoted-parameter">;
184 def : DiagGroup<"init-self">;
185 def : DiagGroup<"inline">;
186 def : DiagGroup<"invalid-pch">;
187 def GNULabelsAsValue : DiagGroup<"gnu-label-as-value">;
188 def LiteralRange : DiagGroup<"literal-range">;
189 def LocalTypeTemplateArgs : DiagGroup<"local-type-template-args",
190 [CXX98CompatLocalTypeTemplateArgs]>;
191 def LoopAnalysis : DiagGroup<"loop-analysis">;
192 def MalformedWarningCheck : DiagGroup<"malformed-warning-check">;
193 def Main : DiagGroup<"main">;
194 def MainReturnType : DiagGroup<"main-return-type">;
195 def MissingBraces : DiagGroup<"missing-braces">;
196 def MissingDeclarations: DiagGroup<"missing-declarations">;
197 def : DiagGroup<"missing-format-attribute">;
198 def : DiagGroup<"missing-include-dirs">;
199 def MissingNoreturn : DiagGroup<"missing-noreturn">;
200 def MultiChar : DiagGroup<"multichar">;
201 def : DiagGroup<"nested-externs">;
202 def CXX11LongLong : DiagGroup<"c++11-long-long">;
203 def LongLong : DiagGroup<"long-long", [CXX11LongLong]>;
204 def MethodSignatures : DiagGroup<"method-signatures">;
205 def MismatchedParameterTypes : DiagGroup<"mismatched-parameter-types">;
206 def MismatchedReturnTypes : DiagGroup<"mismatched-return-types">;
207 def MismatchedTags : DiagGroup<"mismatched-tags">;
208 def MissingFieldInitializers : DiagGroup<"missing-field-initializers">;
209 def ModuleConflict : DiagGroup<"module-conflict">;
210 def NewlineEOF : DiagGroup<"newline-eof">;
211 def NullArithmetic : DiagGroup<"null-arithmetic">;
212 def NullCharacter : DiagGroup<"null-character">;
213 def NullDereference : DiagGroup<"null-dereference">;
214 def InitializerOverrides : DiagGroup<"initializer-overrides">;
215 def NonNull : DiagGroup<"nonnull">;
216 def NonPODVarargs : DiagGroup<"non-pod-varargs">;
217 def : DiagGroup<"nonportable-cfstrings">;
218 def NonVirtualDtor : DiagGroup<"non-virtual-dtor">;
219 def OveralignedType : DiagGroup<"over-aligned">;
220 def : DiagGroup<"old-style-cast">;
221 def : DiagGroup<"old-style-definition">;
222 def OutOfLineDeclaration : DiagGroup<"out-of-line-declaration">;
223 def : DiagGroup<"overflow">;
224 def ForwardClassReceiver : DiagGroup<"receiver-forward-class">;
225 def MethodAccess : DiagGroup<"objc-method-access">;
226 def ObjCReceiver : DiagGroup<"receiver-expr">;
227 def OverlengthStrings : DiagGroup<"overlength-strings">;
228 def OverloadedVirtual : DiagGroup<"overloaded-virtual">;
229 def PrivateExtern : DiagGroup<"private-extern">;
230 def SelTypeCast : DiagGroup<"cast-of-sel-type">;
231 def BadFunctionCast : DiagGroup<"bad-function-cast">;
232 def ObjCPropertyImpl : DiagGroup<"objc-property-implementation">;
233 def ObjCPropertyNoAttribute : DiagGroup<"objc-property-no-attribute">;
234 def ObjCMissingSuperCalls : DiagGroup<"objc-missing-super-calls">;
235 def ObjCRetainBlockProperty : DiagGroup<"objc-noncopy-retain-block-property">;
236 def ObjCReadonlyPropertyHasSetter : DiagGroup<"objc-readonly-with-setter-property">;
237 def ObjCInvalidIBOutletProperty : DiagGroup<"invalid-iboutlet">;
238 def ObjCRootClass : DiagGroup<"objc-root-class">;
239 def ObjCPointerIntrospectPerformSelector : DiagGroup<"deprecated-objc-pointer-introspection-performSelector">;
240 def ObjCPointerIntrospect : DiagGroup<"deprecated-objc-pointer-introspection", [ObjCPointerIntrospectPerformSelector]>;
241 def DeprecatedObjCIsaUsage : DiagGroup<"deprecated-objc-isa-usage">;
242 def Packed : DiagGroup<"packed">;
243 def Padded : DiagGroup<"padded">;
244 def PointerArith : DiagGroup<"pointer-arith">;
245 def PoundWarning : DiagGroup<"#warnings">,
246 DiagCategory<"#warning Directive">;
247 def PoundPragmaMessage : DiagGroup<"#pragma-messages">,
248 DiagCategory<"#pragma message Directive">;
249 def : DiagGroup<"pointer-to-int-cast">;
250 def : DiagGroup<"redundant-decls">;
251 def RedeclaredClassMember : DiagGroup<"redeclared-class-member">;
252 def GNURedeclaredEnum : DiagGroup<"gnu-redeclared-enum">;
253 def ReturnStackAddress : DiagGroup<"return-stack-address">;
254 def ReturnTypeCLinkage : DiagGroup<"return-type-c-linkage">;
255 def ReturnType : DiagGroup<"return-type", [ReturnTypeCLinkage]>;
256 def BindToTemporaryCopy : DiagGroup<"bind-to-temporary-copy",
257 [CXX98CompatBindToTemporaryCopy]>;
258 def SelfAssignmentField : DiagGroup<"self-assign-field">;
259 def SelfAssignment : DiagGroup<"self-assign", [SelfAssignmentField]>;
260 def SemiBeforeMethodBody : DiagGroup<"semicolon-before-method-body">;
261 def Sentinel : DiagGroup<"sentinel">;
262 def MissingMethodReturnType : DiagGroup<"missing-method-return-type">;
263 def Shadow : DiagGroup<"shadow">;
264 def Shorten64To32 : DiagGroup<"shorten-64-to-32">;
265 def : DiagGroup<"sign-promo">;
266 def SignCompare : DiagGroup<"sign-compare">;
267 def : DiagGroup<"stack-protector">;
268 def : DiagGroup<"switch-default">;
269 def : DiagGroup<"synth">;
270 def SizeofArrayArgument : DiagGroup<"sizeof-array-argument">;
271 def SizeofArrayDecay : DiagGroup<"sizeof-array-decay">;
272 def SizeofPointerMemaccess : DiagGroup<"sizeof-pointer-memaccess">;
273 def StaticInInline : DiagGroup<"static-in-inline">;
274 def StaticLocalInInline : DiagGroup<"static-local-in-inline">;
275 def GNUStaticFloatInit : DiagGroup<"gnu-static-float-init">;
276 def StaticFloatInit : DiagGroup<"static-float-init", [GNUStaticFloatInit]>;
277 def GNUStatementExpression : DiagGroup<"gnu-statement-expression">;
278 def StringPlusInt : DiagGroup<"string-plus-int">;
279 def StringPlusChar : DiagGroup<"string-plus-char">;
280 def StrncatSize : DiagGroup<"strncat-size">;
281 def TautologicalOutOfRangeCompare : DiagGroup<"tautological-constant-out-of-range-compare">;
282 def TautologicalCompare : DiagGroup<"tautological-compare",
283 [TautologicalOutOfRangeCompare]>;
284 def HeaderHygiene : DiagGroup<"header-hygiene">;
285 def DuplicateDeclSpecifier : DiagGroup<"duplicate-decl-specifier">;
286 def CompareDistinctPointerType : DiagGroup<"compare-distinct-pointer-types">;
287 def GNUUnionCast : DiagGroup<"gnu-union-cast">;
288 def GNUVariableSizedTypeNotAtEnd : DiagGroup<"gnu-variable-sized-type-not-at-end">;
289 def Varargs : DiagGroup<"varargs">;
291 def Unsequenced : DiagGroup<"unsequenced">;
292 // GCC name for -Wunsequenced
293 def : DiagGroup<"sequence-point", [Unsequenced]>;
295 // Preprocessor warnings.
296 def AmbiguousMacro : DiagGroup<"ambiguous-macro">;
298 // Just silence warnings about -Wstrict-aliasing for now.
299 def : DiagGroup<"strict-aliasing=0">;
300 def : DiagGroup<"strict-aliasing=1">;
301 def : DiagGroup<"strict-aliasing=2">;
302 def : DiagGroup<"strict-aliasing">;
304 // Just silence warnings about -Wstrict-overflow for now.
305 def : DiagGroup<"strict-overflow=0">;
306 def : DiagGroup<"strict-overflow=1">;
307 def : DiagGroup<"strict-overflow=2">;
308 def : DiagGroup<"strict-overflow=3">;
309 def : DiagGroup<"strict-overflow=4">;
310 def : DiagGroup<"strict-overflow=5">;
311 def : DiagGroup<"strict-overflow">;
313 def InvalidOffsetof : DiagGroup<"invalid-offsetof">;
314 def : DiagGroup<"strict-prototypes">;
315 def StrictSelector : DiagGroup<"strict-selector-match">;
316 def MethodDuplicate : DiagGroup<"duplicate-method-match">;
317 def CoveredSwitchDefault : DiagGroup<"covered-switch-default">;
318 def SwitchEnum : DiagGroup<"switch-enum">;
319 def Switch : DiagGroup<"switch">;
320 def ImplicitFallthroughPerFunction :
321 DiagGroup<"implicit-fallthrough-per-function">;
322 def ImplicitFallthrough : DiagGroup<"implicit-fallthrough",
323 [ImplicitFallthroughPerFunction]>;
324 def InvalidPPToken : DiagGroup<"invalid-pp-token">;
325 def Trigraphs : DiagGroup<"trigraphs">;
327 def : DiagGroup<"type-limits">;
328 def UndefinedReinterpretCast : DiagGroup<"undefined-reinterpret-cast">;
329 def ReinterpretBaseClass : DiagGroup<"reinterpret-base-class">;
330 def Unicode : DiagGroup<"unicode">;
331 def UninitializedMaybe : DiagGroup<"conditional-uninitialized">;
332 def UninitializedSometimes : DiagGroup<"sometimes-uninitialized">;
333 def UninitializedStaticSelfInit : DiagGroup<"static-self-init">;
334 def Uninitialized : DiagGroup<"uninitialized", [UninitializedSometimes,
335 UninitializedStaticSelfInit]>;
336 def UnknownPragmas : DiagGroup<"unknown-pragmas">;
337 def UnknownWarningOption : DiagGroup<"unknown-warning-option">;
338 def NSobjectAttribute : DiagGroup<"NSObject-attribute">;
339 def UnknownAttributes : DiagGroup<"attributes">;
340 def IgnoredAttributes : DiagGroup<"ignored-attributes">;
341 def UnnamedTypeTemplateArgs : DiagGroup<"unnamed-type-template-args",
342 [CXX98CompatUnnamedTypeTemplateArgs]>;
343 def UnsupportedFriend : DiagGroup<"unsupported-friend">;
344 def UnusedArgument : DiagGroup<"unused-argument">;
345 def UnusedSanitizeArgument : DiagGroup<"unused-sanitize-argument">;
346 def UnusedCommandLineArgument : DiagGroup<"unused-command-line-argument",
347 [UnusedSanitizeArgument]>;
348 def InvalidCommandLineArgument : DiagGroup<"invalid-command-line-argument">;
349 def UnusedComparison : DiagGroup<"unused-comparison">;
350 def UnusedExceptionParameter : DiagGroup<"unused-exception-parameter">;
351 def UnneededInternalDecl : DiagGroup<"unneeded-internal-declaration">;
352 def UnneededMemberFunction : DiagGroup<"unneeded-member-function">;
353 def UnusedPrivateField : DiagGroup<"unused-private-field">;
354 def UnusedFunction : DiagGroup<"unused-function", [UnneededInternalDecl]>;
355 def UnusedMemberFunction : DiagGroup<"unused-member-function",
356 [UnneededMemberFunction]>;
357 def UnusedLabel : DiagGroup<"unused-label">;
358 def UnusedParameter : DiagGroup<"unused-parameter">;
359 def UnusedResult : DiagGroup<"unused-result">;
360 def UnusedValue : DiagGroup<"unused-value", [UnusedComparison, UnusedResult]>;
361 def UnusedConstVariable : DiagGroup<"unused-const-variable">;
362 def UnusedVariable : DiagGroup<"unused-variable",
363 [UnusedConstVariable]>;
364 def UnusedPropertyIvar : DiagGroup<"unused-property-ivar">;
365 def UsedButMarkedUnused : DiagGroup<"used-but-marked-unused">;
366 def UserDefinedLiterals : DiagGroup<"user-defined-literals">;
367 def ReadOnlySetterAttrs : DiagGroup<"readonly-setter-attrs">;
368 def Reorder : DiagGroup<"reorder">;
369 def UndeclaredSelector : DiagGroup<"undeclared-selector">;
370 def ImplicitAtomic : DiagGroup<"implicit-atomic-properties">;
371 def CustomAtomic : DiagGroup<"custom-atomic-properties">;
372 def AtomicProperties : DiagGroup<"atomic-properties",
373 [ImplicitAtomic, CustomAtomic]>;
374 // FIXME: Remove arc-abi once an Xcode is released that doesn't pass this flag.
375 def : DiagGroup<"arc-abi">;
376 def ARCUnsafeRetainedAssign : DiagGroup<"arc-unsafe-retained-assign">;
377 def ARCRetainCycles : DiagGroup<"arc-retain-cycles">;
378 def ARCNonPodMemAccess : DiagGroup<"arc-non-pod-memaccess">;
379 def AutomaticReferenceCounting : DiagGroup<"arc",
380 [ARCUnsafeRetainedAssign,
382 ARCNonPodMemAccess]>;
383 def ARCRepeatedUseOfWeakMaybe : DiagGroup<"arc-maybe-repeated-use-of-weak">;
384 def ARCRepeatedUseOfWeak : DiagGroup<"arc-repeated-use-of-weak",
385 [ARCRepeatedUseOfWeakMaybe]>;
386 def ObjCBridge : DiagGroup<"bridge-cast">;
388 def SelectorTypeMismatch : DiagGroup<"selector-type-mismatch">;
389 def Selector : DiagGroup<"selector", [SelectorTypeMismatch]>;
390 def Protocol : DiagGroup<"protocol">;
391 def SuperSubClassMismatch : DiagGroup<"super-class-method-mismatch">;
392 def OverridingMethodMismatch : DiagGroup<"overriding-method-mismatch">;
393 def VariadicMacros : DiagGroup<"variadic-macros">;
394 def VectorConversion : DiagGroup<"vector-conversion">; // clang specific
395 def VexingParse : DiagGroup<"vexing-parse">;
396 def VLA : DiagGroup<"vla">;
397 def VLAExtension : DiagGroup<"vla-extension">;
398 def VolatileRegisterVar : DiagGroup<"volatile-register-var">;
399 def Visibility : DiagGroup<"visibility">;
400 def ZeroLengthArray : DiagGroup<"zero-length-array">;
401 def GNUZeroLineDirective : DiagGroup<"gnu-zero-line-directive">;
402 def GNUZeroVariadicMacroArguments : DiagGroup<"gnu-zero-variadic-macro-arguments">;
404 // GCC calls -Wdeprecated-writable-strings -Wwrite-strings.
405 def GCCWriteStrings : DiagGroup<"write-strings" , [DeprecatedWritableStr]>;
407 def CharSubscript : DiagGroup<"char-subscripts">;
408 def LargeByValueCopy : DiagGroup<"large-by-value-copy">;
409 def DuplicateArgDecl : DiagGroup<"duplicate-method-arg">;
411 // Aggregation warning settings.
413 // -Widiomatic-parentheses contains warnings about 'idiomatic'
414 // missing parentheses; it is off by default. We do not include it
415 // in -Wparentheses because most users who use -Wparentheses explicitly
416 // do not want these warnings.
417 def ParenthesesOnEquality : DiagGroup<"parentheses-equality">;
418 def Parentheses : DiagGroup<"parentheses",
419 [LogicalOpParentheses,
420 LogicalNotParentheses,
421 BitwiseOpParentheses,
423 OverloadedShiftOpParentheses,
424 ParenthesesOnEquality,
427 // -Wconversion has its own warnings, but we split a few out for
429 // - some people want just 64-to-32 warnings
430 // - conversion warnings with constant sources are on by default
431 // - conversion warnings for literals are on by default
432 // - bool-to-pointer conversion warnings are on by default
433 // - __null-to-integer conversion warnings are on by default
434 def Conversion : DiagGroup<"conversion",
441 NonLiteralNullConversion, // (1-1)->pointer (etc)
442 NullConversion, // NULL->non-pointer
445 DiagCategory<"Value Conversion Issue">;
447 def Unused : DiagGroup<"unused",
448 [UnusedArgument, UnusedFunction, UnusedLabel,
449 // UnusedParameter, (matches GCC's behavior)
450 // UnusedMemberFunction, (clean-up llvm before enabling)
452 UnusedValue, UnusedVariable, UnusedPropertyIvar]>,
453 DiagCategory<"Unused Entity Issue">;
456 def FormatInvalidSpecifier : DiagGroup<"format-invalid-specifier">;
457 def FormatSecurity : DiagGroup<"format-security">;
458 def FormatNonStandard : DiagGroup<"format-non-iso">;
459 def FormatY2K : DiagGroup<"format-y2k">;
460 def Format : DiagGroup<"format",
461 [FormatExtraArgs, FormatZeroLength, NonNull,
462 FormatSecurity, FormatY2K, FormatInvalidSpecifier]>,
463 DiagCategory<"Format String Issue">;
464 def FormatNonLiteral : DiagGroup<"format-nonliteral", [FormatSecurity]>;
465 def Format2 : DiagGroup<"format=2",
466 [FormatNonLiteral, FormatSecurity, FormatY2K]>;
468 def TypeSafety : DiagGroup<"type-safety">;
470 def IntToVoidPointerCast : DiagGroup<"int-to-void-pointer-cast">;
471 def IntToPointerCast : DiagGroup<"int-to-pointer-cast",
472 [IntToVoidPointerCast]>;
474 def Extra : DiagGroup<"extra", [
475 MissingFieldInitializers,
477 InitializerOverrides,
478 SemiBeforeMethodBody,
479 MissingMethodReturnType,
484 def Most : DiagGroup<"most", [
487 DeleteNonVirtualDtor,
504 ObjCMissingSuperCalls,
511 // Thread Safety warnings
512 def ThreadSafetyAttributes : DiagGroup<"thread-safety-attributes">;
513 def ThreadSafetyAnalysis : DiagGroup<"thread-safety-analysis">;
514 def ThreadSafetyPrecise : DiagGroup<"thread-safety-precise">;
515 def ThreadSafety : DiagGroup<"thread-safety",
516 [ThreadSafetyAttributes,
517 ThreadSafetyAnalysis,
518 ThreadSafetyPrecise]>;
519 def ThreadSafetyBeta : DiagGroup<"thread-safety-beta">;
521 // Uniqueness Analysis warnings
522 def Consumed : DiagGroup<"consumed">;
524 // Note that putting warnings in -Wall will not disable them by default. If a
525 // warning should be active _only_ when -Wall is passed in, mark it as
526 // DefaultIgnore in addition to putting it here.
527 def : DiagGroup<"all", [Most, Parentheses, Switch]>;
529 // Warnings enabled by -pedantic. This is magically filled in by TableGen.
530 def Pedantic : DiagGroup<"pedantic">;
533 def : DiagGroup<"", [Extra]>; // -W = -Wextra
534 def : DiagGroup<"endif-labels", [ExtraTokens]>; // -Wendif-labels=-Wextra-tokens
535 def : DiagGroup<"comments", [Comment]>; // -Wcomments = -Wcomment
536 def : DiagGroup<"conversion-null",
537 [NullConversion]>; // -Wconversion-null = -Wnull-conversion
538 def : DiagGroup<"bool-conversions",
539 [BoolConversion]>; // -Wbool-conversions = -Wbool-conversion
540 def : DiagGroup<"int-conversions",
541 [IntConversion]>; // -Wint-conversions = -Wint-conversion
542 def : DiagGroup<"vector-conversions",
543 [VectorConversion]>; // -Wvector-conversions = -Wvector-conversion
545 // A warning group for warnings that we want to have on by default in clang,
546 // but which aren't on by default in GCC.
547 def NonGCC : DiagGroup<"non-gcc",
548 [SignCompare, Conversion, LiteralRange]>;
550 // A warning group for warnings about using C++11 features as extensions in
551 // earlier C++ versions.
552 def CXX11 : DiagGroup<"c++11-extensions", [CXX11ExtraSemi, CXX11LongLong]>;
554 // A warning group for warnings about using C++1y features as extensions in
555 // earlier C++ versions.
556 def CXX1y : DiagGroup<"c++1y-extensions">;
558 def : DiagGroup<"c++0x-extensions", [CXX11]>;
559 def DelegatingCtorCycles :
560 DiagGroup<"delegating-ctor-cycles">;
562 // A warning group for warnings about using C11 features as extensions.
563 def C11 : DiagGroup<"c11-extensions">;
565 // A warning group for warnings about using C99 features as extensions.
566 def C99 : DiagGroup<"c99-extensions">;
568 // A warning group for warnings about GCC extensions.
569 def GNU : DiagGroup<"gnu", [GNUAlignofExpression, GNUAnonymousStruct,
570 GNUBinaryLiteral, GNUCaseRange,
571 GNUComplexInteger, GNUCompoundLiteralInitializer,
572 GNUConditionalOmittedOperand, GNUDesignator,
573 GNUEmptyInitializer, GNUEmptyStruct,
574 VLAExtension, GNUFlexibleArrayInitializer,
575 GNUFlexibleArrayUnionMember, GNUFoldingConstant,
576 GNUImaginaryConstant, GNULabelsAsValue,
577 RedeclaredClassMember, GNURedeclaredEnum,
578 GNUStatementExpression, GNUStaticFloatInit,
579 GNUStringLiteralOperatorTemplate,
580 GNUUnionCast, GNUVariableSizedTypeNotAtEnd,
581 ZeroLengthArray, GNUZeroLineDirective,
582 GNUZeroVariadicMacroArguments]>;
583 // A warning group for warnings about code that clang accepts but gcc doesn't.
584 def GccCompat : DiagGroup<"gcc-compat">;
586 // A warning group for warnings about Microsoft extensions.
587 def Microsoft : DiagGroup<"microsoft">;
589 def ObjCNonUnifiedException : DiagGroup<"objc-nonunified-exceptions">;
591 def ObjCProtocolMethodImpl : DiagGroup<"objc-protocol-method-implementation">;
593 def ObjCNoPropertyAutoSynthesis : DiagGroup<"objc-property-synthesis">;
595 // ObjC API warning groups.
596 def ObjCRedundantLiteralUse : DiagGroup<"objc-redundant-literal-use">;
597 def ObjCRedundantAPIUse : DiagGroup<"objc-redundant-api-use", [
598 ObjCRedundantLiteralUse
601 def ObjCCocoaAPI : DiagGroup<"objc-cocoa-api", [
605 def ObjCStringComparison : DiagGroup<"objc-string-compare">;
606 def ObjCStringConcatenation : DiagGroup<"objc-string-concatenation">;
607 def ObjCLiteralComparison : DiagGroup<"objc-literal-compare", [
611 def ObjCLiteralMissingAtSign : DiagGroup<"objc-literal-missing-atsign">;
613 // Inline ASM warnings.
614 def ASMOperandWidths : DiagGroup<"asm-operand-widths">;
615 def ASM : DiagGroup<"asm", [
620 def SourceUsesOpenMP : DiagGroup<"source-uses-openmp">;