]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - include/clang/Basic/DiagnosticGroups.td
Vendor import of clang trunk r240225:
[FreeBSD/FreeBSD.git] / include / clang / Basic / DiagnosticGroups.td
1 //==--- DiagnosticGroups.td - Diagnostic Group Definitions ----------------===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9
10 def ImplicitFunctionDeclare : DiagGroup<"implicit-function-declaration">;
11 def ImplicitInt : DiagGroup<"implicit-int">;
12
13 // Aggregation warning settings.
14 def Implicit : DiagGroup<"implicit", [
15     ImplicitFunctionDeclare,
16     ImplicitInt
17 ]>;
18
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">;
74
75 def DeleteIncomplete : DiagGroup<"delete-incomplete">;
76 def DeleteNonVirtualDtor : DiagGroup<"delete-non-virtual-dtor">;
77 def AbstractFinalClass : DiagGroup<"abstract-final-class">;
78
79 def CXX11CompatDeprecatedWritableStr :
80   DiagGroup<"c++11-compat-deprecated-writable-strings">;
81
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,
93                                           DeprecatedRegister,
94                                           DeprecatedWritableStr]>,
95                  DiagCategory<"Deprecations">;
96
97 def : DiagGroup<"disabled-optimization">;
98 def : DiagGroup<"discard-qual">;
99 def : DiagGroup<"div-by-zero">;
100
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",
107                               [DocumentationHTML,
108                                DocumentationDeprecatedSync]>;
109
110 def EmptyBody : DiagGroup<"empty-body">;
111 def Exceptions : DiagGroup<"exceptions">;
112
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]>;
118
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">;
124
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",
128                                        [CXXPre14Compat]>;
129 def CXXPre1zCompat : DiagGroup<"c++98-c++11-c++14-compat">;
130 def CXXPre1zCompatPedantic : DiagGroup<"c++98-c++11-c++14-compat-pedantic",
131                                        [CXXPre1zCompat]>;
132
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">;
139
140 def CXX98Compat : DiagGroup<"c++98-compat",
141                             [CXX98CompatLocalTypeTemplateArgs,
142                              CXX98CompatUnnamedTypeTemplateArgs,
143                              CXXPre14Compat,
144                              CXXPre1zCompat]>;
145 // Warnings for C++11 features which are Extensions in C++98 mode.
146 def CXX98CompatPedantic : DiagGroup<"c++98-compat-pedantic",
147                                     [CXX98Compat,
148                                      CXX98CompatBindToTemporaryCopy,
149                                      CXXPre14CompatPedantic,
150                                      CXXPre1zCompatPedantic]>;
151
152 def CXX11Narrowing : DiagGroup<"c++11-narrowing">;
153
154 def CXX11WarnOverrideMethod : DiagGroup<"inconsistent-missing-override">;
155
156 // Original name of this warning in Clang
157 def : DiagGroup<"c++0x-narrowing", [CXX11Narrowing]>;
158
159 // Name of this warning in GCC
160 def : DiagGroup<"narrowing", [CXX11Narrowing]>;
161
162 def CXX11CompatReservedUserDefinedLiteral :
163   DiagGroup<"c++11-compat-reserved-user-defined-literal">;
164 def ReservedUserDefinedLiteral :
165   DiagGroup<"reserved-user-defined-literal",
166             [CXX11CompatReservedUserDefinedLiteral]>;
167
168 def CXX11Compat : DiagGroup<"c++11-compat",
169                             [CXX11Narrowing,
170                              CXX11CompatReservedUserDefinedLiteral,
171                              CXX11CompatDeprecatedWritableStr,
172                              CXXPre14Compat,
173                              CXXPre1zCompat]>;
174 def : DiagGroup<"c++0x-compat", [CXX11Compat]>;
175 def CXX11CompatPedantic : DiagGroup<"c++11-compat-pedantic",
176                                     [CXXPre14CompatPedantic,
177                                      CXXPre1zCompatPedantic]>;
178
179 def CXX14Compat : DiagGroup<"c++14-compat", [CXXPre1zCompat]>;
180 def CXX14CompatPedantic : DiagGroup<"c++14-compat-pedantic",
181                                     [CXXPre1zCompatPedantic]>;
182
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]>;
215
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,
229                                                RangeLoopAnalysis]>;
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 ImplicitlyUnsignedLiteral : DiagGroup<"implicitly-unsigned-literal">;
243 def MethodSignatures : DiagGroup<"method-signatures">;
244 def MismatchedParameterTypes : DiagGroup<"mismatched-parameter-types">;
245 def MismatchedReturnTypes : DiagGroup<"mismatched-return-types">;
246 def MismatchedTags : DiagGroup<"mismatched-tags">;
247 def MissingFieldInitializers : DiagGroup<"missing-field-initializers">;
248 def ModuleBuild : DiagGroup<"module-build">;
249 def ModuleConflict : DiagGroup<"module-conflict">;
250 def NewlineEOF : DiagGroup<"newline-eof">;
251 def Nullability : DiagGroup<"nullability">;
252 def NullabilityDeclSpec : DiagGroup<"nullability-declspec">;
253 def NullableToNonNullConversion : DiagGroup<"nullable-to-nonnull-conversion">;
254 def NullabilityCompleteness : DiagGroup<"nullability-completeness">;
255 def NullArithmetic : DiagGroup<"null-arithmetic">;
256 def NullCharacter : DiagGroup<"null-character">;
257 def NullDereference : DiagGroup<"null-dereference">;
258 def InitializerOverrides : DiagGroup<"initializer-overrides">;
259 def NonNull : DiagGroup<"nonnull">;
260 def NonPODVarargs : DiagGroup<"non-pod-varargs">;
261 def ClassVarargs : DiagGroup<"class-varargs", [NonPODVarargs]>;
262 def : DiagGroup<"nonportable-cfstrings">;
263 def NonVirtualDtor : DiagGroup<"non-virtual-dtor">;
264 def OveralignedType : DiagGroup<"over-aligned">;
265 def OldStyleCast : DiagGroup<"old-style-cast">;
266 def : DiagGroup<"old-style-definition">;
267 def OutOfLineDeclaration : DiagGroup<"out-of-line-declaration">;
268 def : DiagGroup<"overflow">;
269 def ForwardClassReceiver : DiagGroup<"receiver-forward-class">;
270 def MethodAccess : DiagGroup<"objc-method-access">;
271 def ObjCReceiver : DiagGroup<"receiver-expr">;
272 // FIXME: Remove this when Xcode removes the warning setting.
273 def : DiagGroup<"receiver-is-weak">;
274 def OperatorNewReturnsNull : DiagGroup<"new-returns-null">;
275 def OverlengthStrings : DiagGroup<"overlength-strings">;
276 def OverloadedVirtual : DiagGroup<"overloaded-virtual">;
277 def PrivateExtern : DiagGroup<"private-extern">;
278 def SelTypeCast : DiagGroup<"cast-of-sel-type">;
279 def FunctionDefInObjCContainer : DiagGroup<"function-def-in-objc-container">;
280 def BadFunctionCast : DiagGroup<"bad-function-cast">;
281 def ObjCPropertyImpl : DiagGroup<"objc-property-implementation">;
282 def ObjCPropertyNoAttribute : DiagGroup<"objc-property-no-attribute">;
283 def ObjCMissingSuperCalls : DiagGroup<"objc-missing-super-calls">;
284 def ObjCDesignatedInit : DiagGroup<"objc-designated-initializers">;
285 def ObjCRetainBlockProperty : DiagGroup<"objc-noncopy-retain-block-property">;
286 def ObjCReadonlyPropertyHasSetter : DiagGroup<"objc-readonly-with-setter-property">;
287 def ObjCInvalidIBOutletProperty : DiagGroup<"invalid-iboutlet">;
288 def ObjCRootClass : DiagGroup<"objc-root-class">;
289 def ObjCPointerIntrospectPerformSelector : DiagGroup<"deprecated-objc-pointer-introspection-performSelector">;
290 def ObjCPointerIntrospect : DiagGroup<"deprecated-objc-pointer-introspection", [ObjCPointerIntrospectPerformSelector]>;
291 def ObjCMultipleMethodNames : DiagGroup<"objc-multiple-method-names">;
292 def DeprecatedObjCIsaUsage : DiagGroup<"deprecated-objc-isa-usage">;
293 def ExplicitInitializeCall : DiagGroup<"explicit-initialize-call">;
294 def Packed : DiagGroup<"packed">;
295 def Padded : DiagGroup<"padded">;
296 def PessimizingMove : DiagGroup<"pessimizing-move">;
297 def PointerArith : DiagGroup<"pointer-arith">;
298 def PoundWarning : DiagGroup<"#warnings">;
299 def PoundPragmaMessage : DiagGroup<"#pragma-messages">,
300                          DiagCategory<"#pragma message Directive">;
301 def : DiagGroup<"pointer-to-int-cast">;
302 def : DiagGroup<"redundant-decls">;
303 def RedeclaredClassMember : DiagGroup<"redeclared-class-member">;
304 def GNURedeclaredEnum : DiagGroup<"gnu-redeclared-enum">;
305 def RedundantMove : DiagGroup<"redundant-move">;
306 def ReturnStackAddress : DiagGroup<"return-stack-address">;
307 def ReturnTypeCLinkage : DiagGroup<"return-type-c-linkage">;
308 def ReturnType : DiagGroup<"return-type", [ReturnTypeCLinkage]>;
309 def BindToTemporaryCopy : DiagGroup<"bind-to-temporary-copy",
310                                     [CXX98CompatBindToTemporaryCopy]>;
311 def SelfAssignmentField : DiagGroup<"self-assign-field">;
312 def SelfAssignment : DiagGroup<"self-assign", [SelfAssignmentField]>;
313 def SelfMove : DiagGroup<"self-move">;
314 def SemiBeforeMethodBody : DiagGroup<"semicolon-before-method-body">;
315 def Sentinel : DiagGroup<"sentinel">;
316 def MissingMethodReturnType : DiagGroup<"missing-method-return-type">;
317 def Shadow : DiagGroup<"shadow">;
318 def Shorten64To32 : DiagGroup<"shorten-64-to-32">;
319 def : DiagGroup<"sign-promo">;
320 def SignCompare : DiagGroup<"sign-compare">;
321 def : DiagGroup<"stack-protector">;
322 def : DiagGroup<"switch-default">;
323 def : DiagGroup<"synth">;
324 def SizeofArrayArgument : DiagGroup<"sizeof-array-argument">;
325 def SizeofArrayDecay : DiagGroup<"sizeof-array-decay">;
326 def SizeofPointerMemaccess : DiagGroup<"sizeof-pointer-memaccess">;
327 def StaticInInline : DiagGroup<"static-in-inline">;
328 def StaticLocalInInline : DiagGroup<"static-local-in-inline">;
329 def GNUStaticFloatInit : DiagGroup<"gnu-static-float-init">;
330 def StaticFloatInit : DiagGroup<"static-float-init", [GNUStaticFloatInit]>;
331 def GNUStatementExpression : DiagGroup<"gnu-statement-expression">;
332 def StringCompare : DiagGroup<"string-compare">;
333 def StringPlusInt : DiagGroup<"string-plus-int">;
334 def StringPlusChar : DiagGroup<"string-plus-char">;
335 def StrncatSize : DiagGroup<"strncat-size">;
336 def TautologicalOutOfRangeCompare : DiagGroup<"tautological-constant-out-of-range-compare">;
337 def TautologicalPointerCompare : DiagGroup<"tautological-pointer-compare">;
338 def TautologicalOverlapCompare : DiagGroup<"tautological-overlap-compare">;
339 def TautologicalUndefinedCompare : DiagGroup<"tautological-undefined-compare">;
340 def TautologicalCompare : DiagGroup<"tautological-compare",
341                                     [TautologicalOutOfRangeCompare,
342                                      TautologicalPointerCompare,
343                                      TautologicalOverlapCompare,
344                                      TautologicalUndefinedCompare]>;
345 def HeaderHygiene : DiagGroup<"header-hygiene">;
346 def DuplicateDeclSpecifier : DiagGroup<"duplicate-decl-specifier">;
347 def CompareDistinctPointerType : DiagGroup<"compare-distinct-pointer-types">;
348 def GNUUnionCast : DiagGroup<"gnu-union-cast">;
349 def GNUVariableSizedTypeNotAtEnd : DiagGroup<"gnu-variable-sized-type-not-at-end">;
350 def Varargs : DiagGroup<"varargs">;
351
352 def Unsequenced : DiagGroup<"unsequenced">;
353 // GCC name for -Wunsequenced
354 def : DiagGroup<"sequence-point", [Unsequenced]>;
355
356 // Preprocessor warnings.
357 def AmbiguousMacro : DiagGroup<"ambiguous-macro">;
358 def KeywordAsMacro : DiagGroup<"keyword-macro">;
359 def ReservedIdAsMacro : DiagGroup<"reserved-id-macro">;
360
361 // Just silence warnings about -Wstrict-aliasing for now.
362 def : DiagGroup<"strict-aliasing=0">;
363 def : DiagGroup<"strict-aliasing=1">;
364 def : DiagGroup<"strict-aliasing=2">;
365 def : DiagGroup<"strict-aliasing">;
366
367 // Just silence warnings about -Wstrict-overflow for now.
368 def : DiagGroup<"strict-overflow=0">;
369 def : DiagGroup<"strict-overflow=1">;
370 def : DiagGroup<"strict-overflow=2">;
371 def : DiagGroup<"strict-overflow=3">;
372 def : DiagGroup<"strict-overflow=4">;
373 def : DiagGroup<"strict-overflow=5">;
374 def : DiagGroup<"strict-overflow">;
375
376 def InvalidOffsetof : DiagGroup<"invalid-offsetof">;
377 def : DiagGroup<"strict-prototypes">;
378 def StrictSelector : DiagGroup<"strict-selector-match">;
379 def MethodDuplicate : DiagGroup<"duplicate-method-match">;
380 def ObjCCStringFormat : DiagGroup<"cstring-format-directive">;
381 def CoveredSwitchDefault : DiagGroup<"covered-switch-default">;
382 def SwitchBool     : DiagGroup<"switch-bool">;
383 def SwitchEnum     : DiagGroup<"switch-enum">;
384 def Switch         : DiagGroup<"switch">;
385 def ImplicitFallthroughPerFunction :
386   DiagGroup<"implicit-fallthrough-per-function">;
387 def ImplicitFallthrough  : DiagGroup<"implicit-fallthrough",
388                                      [ImplicitFallthroughPerFunction]>;
389 def InvalidPPToken : DiagGroup<"invalid-pp-token">;
390 def Trigraphs      : DiagGroup<"trigraphs">;
391
392 def : DiagGroup<"type-limits">;
393 def UndefinedReinterpretCast : DiagGroup<"undefined-reinterpret-cast">;
394 def ReinterpretBaseClass : DiagGroup<"reinterpret-base-class">;
395 def Unicode  : DiagGroup<"unicode">;
396 def UninitializedMaybe : DiagGroup<"conditional-uninitialized">;
397 def UninitializedSometimes : DiagGroup<"sometimes-uninitialized">;
398 def UninitializedStaticSelfInit : DiagGroup<"static-self-init">;
399 def Uninitialized  : DiagGroup<"uninitialized", [UninitializedSometimes,
400                                                  UninitializedStaticSelfInit]>;
401 def UnknownPragmas : DiagGroup<"unknown-pragmas">;
402 def IgnoredPragmas : DiagGroup<"ignored-pragmas">;
403 def Pragmas : DiagGroup<"pragmas", [UnknownPragmas, IgnoredPragmas]>;
404 def UnknownWarningOption : DiagGroup<"unknown-warning-option">;
405 def NSobjectAttribute : DiagGroup<"NSObject-attribute">;
406 def IndependentClassAttribute : DiagGroup<"IndependentClass-attribute">;
407 def UnknownAttributes : DiagGroup<"unknown-attributes">;
408 def IgnoredAttributes : DiagGroup<"ignored-attributes">;
409 def Attributes : DiagGroup<"attributes", [UnknownAttributes,
410                                           IgnoredAttributes]>;
411 def UnknownSanitizers : DiagGroup<"unknown-sanitizers">;
412 def UnnamedTypeTemplateArgs : DiagGroup<"unnamed-type-template-args",
413                                         [CXX98CompatUnnamedTypeTemplateArgs]>;
414 def UnsupportedFriend : DiagGroup<"unsupported-friend">;
415 def UnusedArgument : DiagGroup<"unused-argument">;
416 def UnusedCommandLineArgument : DiagGroup<"unused-command-line-argument">;
417 def IgnoredOptimizationArgument : DiagGroup<"ignored-optimization-argument">;
418 def InvalidCommandLineArgument : DiagGroup<"invalid-command-line-argument",
419                                            [IgnoredOptimizationArgument]>;
420 def UnusedComparison : DiagGroup<"unused-comparison">;
421 def UnusedExceptionParameter : DiagGroup<"unused-exception-parameter">;
422 def UnneededInternalDecl : DiagGroup<"unneeded-internal-declaration">;
423 def UnneededMemberFunction : DiagGroup<"unneeded-member-function">;
424 def UnusedPrivateField : DiagGroup<"unused-private-field">;
425 def UnusedFunction : DiagGroup<"unused-function", [UnneededInternalDecl]>;
426 def UnusedMemberFunction : DiagGroup<"unused-member-function",
427                                      [UnneededMemberFunction]>;
428 def UnusedLabel : DiagGroup<"unused-label">;
429 def UnusedParameter : DiagGroup<"unused-parameter">;
430 def UnusedResult : DiagGroup<"unused-result">;
431 def PotentiallyEvaluatedExpression : DiagGroup<"potentially-evaluated-expression">;
432 def UnevaluatedExpression : DiagGroup<"unevaluated-expression",
433                                       [PotentiallyEvaluatedExpression]>;
434 def UnusedValue : DiagGroup<"unused-value", [UnusedComparison, UnusedResult,
435                                              UnevaluatedExpression]>;
436 def UnusedConstVariable : DiagGroup<"unused-const-variable">;
437 def UnusedVariable : DiagGroup<"unused-variable",
438                                [UnusedConstVariable]>;
439 def UnusedLocalTypedef : DiagGroup<"unused-local-typedef">;
440 def UnusedPropertyIvar :  DiagGroup<"unused-property-ivar">;
441 def UnusedGetterReturnValue : DiagGroup<"unused-getter-return-value">;
442 def UsedButMarkedUnused : DiagGroup<"used-but-marked-unused">;
443 def UserDefinedLiterals : DiagGroup<"user-defined-literals">;
444 def Reorder : DiagGroup<"reorder">;
445 def UndeclaredSelector : DiagGroup<"undeclared-selector">;
446 def ImplicitAtomic : DiagGroup<"implicit-atomic-properties">;
447 def CustomAtomic : DiagGroup<"custom-atomic-properties">;
448 def AtomicProperties : DiagGroup<"atomic-properties",
449                                  [ImplicitAtomic, CustomAtomic]>;
450 def ARCUnsafeRetainedAssign : DiagGroup<"arc-unsafe-retained-assign">;
451 def ARCRetainCycles : DiagGroup<"arc-retain-cycles">;
452 def ARCNonPodMemAccess : DiagGroup<"arc-non-pod-memaccess">;
453 def AutomaticReferenceCounting : DiagGroup<"arc",
454                                            [ARCUnsafeRetainedAssign,
455                                             ARCRetainCycles,
456                                             ARCNonPodMemAccess]>;
457 def ARCRepeatedUseOfWeakMaybe : DiagGroup<"arc-maybe-repeated-use-of-weak">;
458 def ARCRepeatedUseOfWeak : DiagGroup<"arc-repeated-use-of-weak",
459                                      [ARCRepeatedUseOfWeakMaybe]>;
460 def ObjCBridge : DiagGroup<"bridge-cast">;
461
462 def DeallocInCategory:DiagGroup<"dealloc-in-category">;
463 def SelectorTypeMismatch : DiagGroup<"selector-type-mismatch">;
464 def Selector : DiagGroup<"selector", [SelectorTypeMismatch]>;
465 def Protocol : DiagGroup<"protocol">;
466 def AtProtocol : DiagGroup<"at-protocol">;
467 def PropertyAccessDotSyntax: DiagGroup<"property-access-dot-syntax">;
468 def PropertyAttr : DiagGroup<"property-attribute-mismatch">;
469 def SuperSubClassMismatch : DiagGroup<"super-class-method-mismatch">;
470 def OverridingMethodMismatch : DiagGroup<"overriding-method-mismatch">;
471 def VariadicMacros : DiagGroup<"variadic-macros">;
472 def VectorConversion : DiagGroup<"vector-conversion">;      // clang specific
473 def VexingParse : DiagGroup<"vexing-parse">;
474 def VLA : DiagGroup<"vla">;
475 def VLAExtension : DiagGroup<"vla-extension">;
476 def VolatileRegisterVar : DiagGroup<"volatile-register-var">;
477 def Visibility : DiagGroup<"visibility">;
478 def ZeroLengthArray : DiagGroup<"zero-length-array">;
479 def GNUZeroLineDirective : DiagGroup<"gnu-zero-line-directive">;
480 def GNUZeroVariadicMacroArguments : DiagGroup<"gnu-zero-variadic-macro-arguments">;
481 def Fallback : DiagGroup<"fallback">;
482
483 // This covers both the deprecated case (in C++98)
484 // and the extension case (in C++11 onwards).
485 def WritableStrings : DiagGroup<"writable-strings", [DeprecatedWritableStr]>;
486
487 // GCC calls -Wdeprecated-writable-strings -Wwrite-strings.
488 //
489 // Bizarrely, this warning flag enables -fconst-strings in C. This is
490 // GCC-compatible, but really weird.
491 //
492 // FIXME: Should this affect C++11 (where this is an error,
493 //        not just deprecated) or not?
494 def GCCWriteStrings : DiagGroup<"write-strings" , [WritableStrings]>;
495
496 def CharSubscript : DiagGroup<"char-subscripts">;
497 def LargeByValueCopy : DiagGroup<"large-by-value-copy">;
498 def DuplicateArgDecl : DiagGroup<"duplicate-method-arg">;
499
500 // Unreachable code warning groups.
501 //
502 //  The goal is make -Wunreachable-code on by default, in -Wall, or at
503 //  least actively used, with more noisy versions of the warning covered
504 //  under separate flags.
505 //
506 def UnreachableCodeLoopIncrement : DiagGroup<"unreachable-code-loop-increment">;
507 def UnreachableCode : DiagGroup<"unreachable-code",
508                                 [UnreachableCodeLoopIncrement]>;
509 def UnreachableCodeBreak : DiagGroup<"unreachable-code-break">;
510 def UnreachableCodeReturn : DiagGroup<"unreachable-code-return">;
511 def UnreachableCodeAggressive : DiagGroup<"unreachable-code-aggressive",
512                                     [UnreachableCode,
513                                      UnreachableCodeBreak,
514                                      UnreachableCodeReturn]>;
515
516 // Aggregation warning settings.
517
518 // Populate -Waddress with warnings from other groups.
519 def : DiagGroup<"address", [PointerBoolConversion,
520                             StringCompare,
521                             TautologicalPointerCompare]>;
522
523 // -Widiomatic-parentheses contains warnings about 'idiomatic'
524 // missing parentheses;  it is off by default.  We do not include it
525 // in -Wparentheses because most users who use -Wparentheses explicitly
526 // do not want these warnings.
527 def ParenthesesOnEquality : DiagGroup<"parentheses-equality">;
528 def Parentheses : DiagGroup<"parentheses",
529                             [LogicalOpParentheses,
530                              LogicalNotParentheses,
531                              BitwiseOpParentheses,
532                              ShiftOpParentheses,
533                              OverloadedShiftOpParentheses,
534                              ParenthesesOnEquality,
535                              DanglingElse]>;
536
537 // -Wconversion has its own warnings, but we split a few out for
538 // legacy reasons:
539 //   - some people want just 64-to-32 warnings
540 //   - conversion warnings with constant sources are on by default
541 //   - conversion warnings for literals are on by default
542 //   - bool-to-pointer conversion warnings are on by default
543 //   - __null-to-integer conversion warnings are on by default
544 def Conversion : DiagGroup<"conversion",
545                            [BoolConversion,
546                             ConstantConversion,
547                             EnumConversion,
548                             FloatConversion,
549                             Shorten64To32,
550                             IntConversion,
551                             LiteralConversion,
552                             NonLiteralNullConversion, // (1-1)->pointer (etc)
553                             NullConversion, // NULL->non-pointer
554                             ObjCLiteralConversion,
555                             SignConversion,
556                             StringConversion]>,
557                  DiagCategory<"Value Conversion Issue">;
558
559 def Unused : DiagGroup<"unused",
560                        [UnusedArgument, UnusedFunction, UnusedLabel,
561                         // UnusedParameter, (matches GCC's behavior)
562                         // UnusedMemberFunction, (clean-up llvm before enabling)
563                         UnusedPrivateField, UnusedLocalTypedef,
564                         UnusedValue, UnusedVariable, UnusedPropertyIvar]>,
565                         DiagCategory<"Unused Entity Issue">;
566
567 // Format settings.
568 def FormatInvalidSpecifier : DiagGroup<"format-invalid-specifier">;
569 def FormatSecurity : DiagGroup<"format-security">;
570 def FormatNonStandard : DiagGroup<"format-non-iso">;
571 def FormatY2K : DiagGroup<"format-y2k">;
572 def FormatPedantic : DiagGroup<"format-pedantic">;
573 def Format : DiagGroup<"format",
574                        [FormatExtraArgs, FormatZeroLength, NonNull,
575                         FormatSecurity, FormatY2K, FormatInvalidSpecifier]>,
576              DiagCategory<"Format String Issue">;
577 def FormatNonLiteral : DiagGroup<"format-nonliteral">;
578 def Format2 : DiagGroup<"format=2",
579                         [FormatNonLiteral, FormatSecurity, FormatY2K]>;
580
581 def TypeSafety : DiagGroup<"type-safety">;
582
583 def IntToVoidPointerCast : DiagGroup<"int-to-void-pointer-cast">;
584 def IntToPointerCast : DiagGroup<"int-to-pointer-cast",
585                                  [IntToVoidPointerCast]>;
586
587 def Move : DiagGroup<"move", [PessimizingMove, RedundantMove, SelfMove]>;
588
589 def Extra : DiagGroup<"extra", [
590     MissingFieldInitializers,
591     IgnoredQualifiers,
592     InitializerOverrides,
593     SemiBeforeMethodBody,
594     MissingMethodReturnType,
595     SignCompare,
596     UnusedParameter
597   ]>;
598
599 def Most : DiagGroup<"most", [
600     CharSubscript,
601     Comment,
602     DeleteNonVirtualDtor,
603     Format,
604     Implicit,
605     InfiniteRecursion,
606     MismatchedTags,
607     MissingBraces,
608     Move,
609     MultiChar,
610     Reorder,
611     ReturnType,
612     SelfAssignment,
613     SelfMove,
614     SizeofArrayArgument,
615     SizeofArrayDecay,
616     StringPlusInt,
617     Trigraphs,
618     Uninitialized,
619     UnknownPragmas,
620     Unused,
621     VolatileRegisterVar,
622     ObjCMissingSuperCalls,
623     ObjCDesignatedInit,
624     OverloadedVirtual,
625     PrivateExtern,
626     SelTypeCast,
627     ExternCCompat
628  ]>;
629
630 // Thread Safety warnings 
631 def ThreadSafetyAttributes : DiagGroup<"thread-safety-attributes">;
632 def ThreadSafetyAnalysis   : DiagGroup<"thread-safety-analysis">;
633 def ThreadSafetyPrecise    : DiagGroup<"thread-safety-precise">;
634 def ThreadSafetyReference  : DiagGroup<"thread-safety-reference">;
635 def ThreadSafetyNegative   : DiagGroup<"thread-safety-negative">;
636 def ThreadSafety : DiagGroup<"thread-safety",
637                              [ThreadSafetyAttributes, 
638                               ThreadSafetyAnalysis,
639                               ThreadSafetyPrecise,
640                               ThreadSafetyReference]>;
641 def ThreadSafetyVerbose : DiagGroup<"thread-safety-verbose">;
642 def ThreadSafetyBeta : DiagGroup<"thread-safety-beta">;
643
644 // Uniqueness Analysis warnings
645 def Consumed       : DiagGroup<"consumed">;
646
647 // Note that putting warnings in -Wall will not disable them by default. If a
648 // warning should be active _only_ when -Wall is passed in, mark it as
649 // DefaultIgnore in addition to putting it here.
650 def : DiagGroup<"all", [Most, Parentheses, Switch, SwitchBool]>;
651
652 // Warnings enabled by -pedantic.  This is magically filled in by TableGen.
653 def Pedantic : DiagGroup<"pedantic">;
654
655 // Aliases.
656 def : DiagGroup<"", [Extra]>;                   // -W = -Wextra
657 def : DiagGroup<"endif-labels", [ExtraTokens]>; // -Wendif-labels=-Wextra-tokens
658 def : DiagGroup<"comments", [Comment]>;         // -Wcomments = -Wcomment
659 def : DiagGroup<"conversion-null",
660                 [NullConversion]>; // -Wconversion-null = -Wnull-conversion
661 def : DiagGroup<"bool-conversions",
662                 [BoolConversion]>; // -Wbool-conversions  = -Wbool-conversion
663 def : DiagGroup<"int-conversions",
664                 [IntConversion]>; // -Wint-conversions = -Wint-conversion
665 def : DiagGroup<"vector-conversions",
666                 [VectorConversion]>; // -Wvector-conversions = -Wvector-conversion
667 def : DiagGroup<"unused-local-typedefs", [UnusedLocalTypedef]>;
668                 // -Wunused-local-typedefs = -Wunused-local-typedef
669
670 // A warning group for warnings that we want to have on by default in clang,
671 // but which aren't on by default in GCC.
672 def NonGCC : DiagGroup<"non-gcc",
673     [SignCompare, Conversion, LiteralRange]>;
674
675 // A warning group for warnings about using C++11 features as extensions in
676 // earlier C++ versions.
677 def CXX11 : DiagGroup<"c++11-extensions", [CXX11ExtraSemi, CXX11LongLong]>;
678
679 // A warning group for warnings about using C++14 features as extensions in
680 // earlier C++ versions.
681 def CXX14 : DiagGroup<"c++14-extensions">;
682
683 // A warning group for warnings about using C++1z features as extensions in
684 // earlier C++ versions.
685 def CXX1z : DiagGroup<"c++1z-extensions">;
686
687 def : DiagGroup<"c++0x-extensions", [CXX11]>;
688 def : DiagGroup<"c++1y-extensions", [CXX14]>;
689
690 def DelegatingCtorCycles :
691   DiagGroup<"delegating-ctor-cycles">;
692
693 // A warning group for warnings about using C11 features as extensions.
694 def C11 : DiagGroup<"c11-extensions">;
695
696 // A warning group for warnings about using C99 features as extensions.
697 def C99 : DiagGroup<"c99-extensions">;
698
699 // A warning group for warnings about GCC extensions.
700 def GNU : DiagGroup<"gnu", [GNUAlignofExpression, GNUAnonymousStruct,
701                             GNUBinaryLiteral, GNUCaseRange,
702                             GNUComplexInteger, GNUCompoundLiteralInitializer,
703                             GNUConditionalOmittedOperand, GNUDesignator,
704                             GNUEmptyInitializer, GNUEmptyStruct,
705                             VLAExtension, GNUFlexibleArrayInitializer,
706                             GNUFlexibleArrayUnionMember, GNUFoldingConstant,
707                             GNUImaginaryConstant, GNULabelsAsValue,
708                             RedeclaredClassMember, GNURedeclaredEnum,
709                             GNUStatementExpression, GNUStaticFloatInit,
710                             GNUStringLiteralOperatorTemplate,
711                             GNUUnionCast, GNUVariableSizedTypeNotAtEnd,
712                             ZeroLengthArray, GNUZeroLineDirective,
713                             GNUZeroVariadicMacroArguments]>;
714 // A warning group for warnings about code that clang accepts but gcc doesn't.
715 def GccCompat : DiagGroup<"gcc-compat">;
716
717 // A warning group for warnings about Microsoft extensions.
718 def Microsoft : DiagGroup<"microsoft">;
719
720 def ObjCNonUnifiedException : DiagGroup<"objc-nonunified-exceptions">;
721
722 def ObjCProtocolMethodImpl : DiagGroup<"objc-protocol-method-implementation">;
723
724 def ObjCNoPropertyAutoSynthesis : DiagGroup<"objc-property-synthesis">;
725
726 // ObjC API warning groups.
727 def ObjCRedundantLiteralUse : DiagGroup<"objc-redundant-literal-use">;
728 def ObjCRedundantAPIUse : DiagGroup<"objc-redundant-api-use", [
729     ObjCRedundantLiteralUse
730   ]>;
731
732 def ObjCCocoaAPI : DiagGroup<"objc-cocoa-api", [
733     ObjCRedundantAPIUse
734   ]>;
735
736 def ObjCStringComparison : DiagGroup<"objc-string-compare">;
737 def ObjCStringConcatenation : DiagGroup<"objc-string-concatenation">;
738 def ObjCLiteralComparison : DiagGroup<"objc-literal-compare", [
739     ObjCStringComparison
740   ]>;
741
742 // Inline ASM warnings.
743 def ASMOperandWidths : DiagGroup<"asm-operand-widths">;
744 def ASM : DiagGroup<"asm", [
745     ASMOperandWidths
746   ]>;
747
748 // OpenMP warnings.
749 def SourceUsesOpenMP : DiagGroup<"source-uses-openmp">;
750 def OpenMPClauses : DiagGroup<"openmp-clauses">;
751 def OpenMPLoopForm : DiagGroup<"openmp-loop-form">;
752
753 // Backend warnings.
754 def BackendInlineAsm : DiagGroup<"inline-asm">;
755 def BackendFrameLargerThanEQ : DiagGroup<"frame-larger-than=">;
756 def BackendPlugin : DiagGroup<"backend-plugin">;
757 def RemarkBackendPlugin : DiagGroup<"remark-backend-plugin">;
758 def BackendOptimizationRemark : DiagGroup<"pass">;
759 def BackendOptimizationRemarkMissed : DiagGroup<"pass-missed">;
760 def BackendOptimizationRemarkAnalysis : DiagGroup<"pass-analysis">;
761 def BackendOptimizationFailure : DiagGroup<"pass-failed">;
762
763 // Instrumentation based profiling warnings.
764 def ProfileInstrOutOfDate : DiagGroup<"profile-instr-out-of-date">;
765 def ProfileInstrUnprofiled : DiagGroup<"profile-instr-unprofiled">;
766
767 // AddressSanitizer frontent instrumentation remarks.
768 def SanitizeAddressRemarks : DiagGroup<"sanitize-address">;
769
770 // Issues with serialized diagnostics.
771 def SerializedDiagnostics : DiagGroup<"serialized-diagnostics">;
772
773 // A warning group for warnings about code that clang accepts when
774 // compiling CUDA C/C++ but which is not compatible with the CUDA spec.
775 def CudaCompat : DiagGroup<"cuda-compat">;
776
777 // A warning group for things that will change semantics in the future.
778 def FutureCompat : DiagGroup<"future-compat">;