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