Clang Project

clang_source_code/include/clang/Basic/DiagnosticGroups.td
1//==--- DiagnosticGroups.td - Diagnostic Group Definitions ----------------===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8
9def ImplicitFunctionDeclare : DiagGroup<"implicit-function-declaration">;
10def ImplicitInt : DiagGroup<"implicit-int">;
11
12// Aggregation warning settings.
13def Implicit : DiagGroup<"implicit", [
14    ImplicitFunctionDeclare,
15    ImplicitInt
16]>;
17
18// Empty DiagGroups are recognized by clang but ignored.
19def : DiagGroup<"abi">;
20def AbsoluteValue : DiagGroup<"absolute-value">;
21def AddressOfTemporary : DiagGroup<"address-of-temporary">;
22def : DiagGroup<"aggregate-return">;
23def GNUAlignofExpression : DiagGroup<"gnu-alignof-expression">;
24def AmbigMemberTemplate : DiagGroup<"ambiguous-member-template">;
25def GNUAnonymousStruct : DiagGroup<"gnu-anonymous-struct">;
26def GNUAutoType : DiagGroup<"gnu-auto-type">;
27def ArrayBounds : DiagGroup<"array-bounds">;
28def ArrayBoundsPointerArithmetic : DiagGroup<"array-bounds-pointer-arithmetic">;
29def AutoDisableVptrSanitizer : DiagGroup<"auto-disable-vptr-sanitizer">;
30def Availability : DiagGroup<"availability">;
31def Section : DiagGroup<"section">;
32def AutoImport : DiagGroup<"auto-import">;
33def FrameworkHdrQuotedInclude : DiagGroup<"quoted-include-in-framework-header">;
34def FrameworkIncludePrivateFromPublic :
35  DiagGroup<"framework-include-private-from-public">;
36def FrameworkHdrAtImport : DiagGroup<"atimport-in-framework-header">;
37def CXX14BinaryLiteral : DiagGroup<"c++14-binary-literal">;
38def CXXPre14CompatBinaryLiteral : DiagGroup<"c++98-c++11-compat-binary-literal">;
39def GNUBinaryLiteral : DiagGroup<"gnu-binary-literal">;
40def BinaryLiteral : DiagGroup<"binary-literal", [CXX14BinaryLiteral,
41                                                 CXXPre14CompatBinaryLiteral,
42                                                 GNUBinaryLiteral]>;
43def GNUCompoundLiteralInitializer : DiagGroup<"gnu-compound-literal-initializer">;
44def BitFieldConstantConversion : DiagGroup<"bitfield-constant-conversion">;
45def BitFieldEnumConversion : DiagGroup<"bitfield-enum-conversion">;
46def BitFieldWidth : DiagGroup<"bitfield-width">;
47def CoroutineMissingUnhandledException :
48  DiagGroup<"coroutine-missing-unhandled-exception">;
49def Coroutine : DiagGroup<"coroutine", [CoroutineMissingUnhandledException]>;
50def ConstantConversion :
51  DiagGroup<"constant-conversion", [ BitFieldConstantConversion ] >;
52def LiteralConversion : DiagGroup<"literal-conversion">;
53def StringConversion : DiagGroup<"string-conversion">;
54def SignConversion : DiagGroup<"sign-conversion">;
55def PointerBoolConversion : DiagGroup<"pointer-bool-conversion">;
56def UndefinedBoolConversion : DiagGroup<"undefined-bool-conversion">;
57def BoolConversion : DiagGroup<"bool-conversion", [PointerBoolConversion,
58                                                   UndefinedBoolConversion]>;
59def IntConversion : DiagGroup<"int-conversion">;
60def EnumConversion : DiagGroup<"enum-conversion">;
61def ImplicitIntConversion : DiagGroup<"implicit-int-conversion">;
62def ImplicitFloatConversion : DiagGroup<"implicit-float-conversion">;
63def ImplicitFixedPointConversion : DiagGroup<"implicit-fixed-point-conversion">;
64
65def FloatOverflowConversion : DiagGroup<"float-overflow-conversion">;
66def FloatZeroConversion : DiagGroup<"float-zero-conversion">;
67def FloatConversion :
68  DiagGroup<"float-conversion", [FloatOverflowConversion,
69                                 FloatZeroConversion]>;
70
71def DoublePromotion : DiagGroup<"double-promotion">;
72def EnumTooLarge : DiagGroup<"enum-too-large">;
73def UnsupportedNan : DiagGroup<"unsupported-nan">;
74def UnsupportedAbs : DiagGroup<"unsupported-abs">;
75def UnsupportedCB : DiagGroup<"unsupported-cb">;
76def UnsupportedGPOpt : DiagGroup<"unsupported-gpopt">;
77def UnsupportedTargetOpt : DiagGroup<"unsupported-target-opt">;
78def NonLiteralNullConversion : DiagGroup<"non-literal-null-conversion">;
79def NullConversion : DiagGroup<"null-conversion">;
80def ImplicitConversionFloatingPointToBool :
81  DiagGroup<"implicit-conversion-floating-point-to-bool">;
82def ObjCLiteralConversion : DiagGroup<"objc-literal-conversion">;
83def MacroRedefined : DiagGroup<"macro-redefined">;
84def BuiltinMacroRedefined : DiagGroup<"builtin-macro-redefined">;
85def BuiltinRequiresHeader : DiagGroup<"builtin-requires-header">;
86def C99Compat : DiagGroup<"c99-compat">;
87def CXXCompat: DiagGroup<"c++-compat">;
88def ExternCCompat : DiagGroup<"extern-c-compat">;
89def KeywordCompat : DiagGroup<"keyword-compat">;
90def GNUCaseRange : DiagGroup<"gnu-case-range">;
91def CastAlign : DiagGroup<"cast-align">;
92def CastQual : DiagGroup<"cast-qual">;
93def : DiagGroup<"char-align">;
94def Comment : DiagGroup<"comment">;
95def GNUComplexInteger : DiagGroup<"gnu-complex-integer">;
96def GNUConditionalOmittedOperand : DiagGroup<"gnu-conditional-omitted-operand">;
97def ConfigMacros : DiagGroup<"config-macros">;
98def : DiagGroup<"ctor-dtor-privacy">;
99def GNUDesignator : DiagGroup<"gnu-designator">;
100def GNUStringLiteralOperatorTemplate :
101  DiagGroup<"gnu-string-literal-operator-template">;
102def UndefinedVarTemplate : DiagGroup<"undefined-var-template">;
103def UndefinedFuncTemplate : DiagGroup<"undefined-func-template">;
104def MissingNoEscape : DiagGroup<"missing-noescape">;
105
106def DeleteIncomplete : DiagGroup<"delete-incomplete">;
107def DeleteNonAbstractNonVirtualDtor : DiagGroup<"delete-non-abstract-non-virtual-dtor">;
108def DeleteAbstractNonVirtualDtor : DiagGroup<"delete-abstract-non-virtual-dtor">;
109def DeleteNonVirtualDtor : DiagGroup<"delete-non-virtual-dtor",
110                                     [DeleteNonAbstractNonVirtualDtor,
111                                      DeleteAbstractNonVirtualDtor]>;
112def AbstractFinalClass : DiagGroup<"abstract-final-class">;
113
114def CXX11CompatDeprecatedWritableStr :
115  DiagGroup<"c++11-compat-deprecated-writable-strings">;
116
117def DeprecatedAttributes : DiagGroup<"deprecated-attributes">;
118def DeprecatedDeclarations : DiagGroup<"deprecated-declarations">;
119def UnavailableDeclarations : DiagGroup<"unavailable-declarations">;
120def UnguardedAvailabilityNew : DiagGroup<"unguarded-availability-new">;
121def UnguardedAvailability : DiagGroup<"unguarded-availability",
122                                      [UnguardedAvailabilityNew]>;
123// partial-availability is an alias of unguarded-availability.
124def : DiagGroup<"partial-availability", [UnguardedAvailability]>;
125def DeprecatedDynamicExceptionSpec
126    : DiagGroup<"deprecated-dynamic-exception-spec">;
127def DeprecatedImplementations :DiagGroup<"deprecated-implementations">;
128def DeprecatedIncrementBool : DiagGroup<"deprecated-increment-bool">;
129def DeprecatedRegister : DiagGroup<"deprecated-register">;
130def DeprecatedThisCapture : DiagGroup<"deprecated-this-capture">;
131def DeprecatedWritableStr : DiagGroup<"deprecated-writable-strings",
132                                      [CXX11CompatDeprecatedWritableStr]>;
133// FIXME: Why is DeprecatedImplementations not in this group?
134def Deprecated : DiagGroup<"deprecated", [DeprecatedAttributes,
135                                          DeprecatedDeclarations,
136                                          DeprecatedDynamicExceptionSpec,
137                                          DeprecatedIncrementBool,
138                                          DeprecatedRegister,
139                                          DeprecatedThisCapture,
140                                          DeprecatedWritableStr]>,
141                 DiagCategory<"Deprecations">;
142
143def DynamicExceptionSpec
144    : DiagGroup<"dynamic-exception-spec", [DeprecatedDynamicExceptionSpec]>;
145
146def LibLTO : DiagGroup<"liblto">;
147def : DiagGroup<"disabled-optimization">;
148def : DiagGroup<"discard-qual">;
149def DivZero : DiagGroup<"division-by-zero">;
150def : DiagGroup<"div-by-zero", [DivZero]>;
151
152def DocumentationHTML : DiagGroup<"documentation-html">;
153def DocumentationUnknownCommand : DiagGroup<"documentation-unknown-command">;
154def DocumentationPedantic : DiagGroup<"documentation-pedantic",
155                                      [DocumentationUnknownCommand]>;
156def DocumentationDeprecatedSync : DiagGroup<"documentation-deprecated-sync">;
157def Documentation : DiagGroup<"documentation",
158                              [DocumentationHTML,
159                               DocumentationDeprecatedSync]>;
160
161def EmptyBody : DiagGroup<"empty-body">;
162def Exceptions : DiagGroup<"exceptions">;
163
164def GNUEmptyInitializer : DiagGroup<"gnu-empty-initializer">;
165def GNUEmptyStruct : DiagGroup<"gnu-empty-struct">;
166def ExtraTokens : DiagGroup<"extra-tokens">;
167def CXX98CompatExtraSemi : DiagGroup<"c++98-compat-extra-semi">;
168def CXX11ExtraSemi : DiagGroup<"c++11-extra-semi">;
169def EmptyInitStatement : DiagGroup<"empty-init-stmt">;
170def ExtraSemiStmt : DiagGroup<"extra-semi-stmt", [EmptyInitStatement]>;
171def ExtraSemi : DiagGroup<"extra-semi", [CXX98CompatExtraSemi,
172                                         CXX11ExtraSemi]>;
173
174def GNUFlexibleArrayInitializer : DiagGroup<"gnu-flexible-array-initializer">;
175def GNUFlexibleArrayUnionMember : DiagGroup<"gnu-flexible-array-union-member">;
176def GNUFoldingConstant : DiagGroup<"gnu-folding-constant">;
177def FormatExtraArgs : DiagGroup<"format-extra-args">;
178def FormatZeroLength : DiagGroup<"format-zero-length">;
179
180def InvalidIOSDeploymentTarget : DiagGroup<"invalid-ios-deployment-target">;
181
182def CXX17CompatMangling : DiagGroup<"c++17-compat-mangling">;
183def : DiagGroup<"c++1z-compat-mangling", [CXX17CompatMangling]>;
184// Name of this warning in GCC.
185def NoexceptType : DiagGroup<"noexcept-type", [CXX17CompatMangling]>;
186
187// Warnings for C++1y code which is not compatible with prior C++ standards.
188def CXXPre14Compat : DiagGroup<"c++98-c++11-compat">;
189def CXXPre14CompatPedantic : DiagGroup<"c++98-c++11-compat-pedantic",
190                                       [CXXPre14Compat,
191                                        CXXPre14CompatBinaryLiteral]>;
192def CXXPre17Compat : DiagGroup<"c++98-c++11-c++14-compat">;
193def CXXPre17CompatPedantic : DiagGroup<"c++98-c++11-c++14-compat-pedantic",
194                                       [CXXPre17Compat]>;
195def CXXPre2aCompat : DiagGroup<"c++98-c++11-c++14-c++17-compat">;
196def CXXPre2aCompatPedantic : DiagGroup<"c++98-c++11-c++14-c++17-compat-pedantic",
197                                       [CXXPre2aCompat]>;
198
199def CXX98CompatBindToTemporaryCopy :
200  DiagGroup<"c++98-compat-bind-to-temporary-copy">;
201def CXX98CompatLocalTypeTemplateArgs :
202  DiagGroup<"c++98-compat-local-type-template-args">;
203def CXX98CompatUnnamedTypeTemplateArgs :
204  DiagGroup<"c++98-compat-unnamed-type-template-args">;
205
206def CXX98Compat : DiagGroup<"c++98-compat",
207                            [CXX98CompatLocalTypeTemplateArgs,
208                             CXX98CompatUnnamedTypeTemplateArgs,
209                             CXXPre14Compat,
210                             CXXPre17Compat,
211                             CXXPre2aCompat]>;
212// Warnings for C++11 features which are Extensions in C++98 mode.
213def CXX98CompatPedantic : DiagGroup<"c++98-compat-pedantic",
214                                    [CXX98Compat,
215                                     CXX98CompatBindToTemporaryCopy,
216                                     CXX98CompatExtraSemi,
217                                     CXXPre14CompatPedantic,
218                                     CXXPre17CompatPedantic,
219                                     CXXPre2aCompatPedantic]>;
220
221def CXX11Narrowing : DiagGroup<"c++11-narrowing">;
222
223def CXX11WarnOverrideDestructor :
224  DiagGroup<"inconsistent-missing-destructor-override">;
225def CXX11WarnOverrideMethod : DiagGroup<"inconsistent-missing-override">;
226
227// Original name of this warning in Clang
228def : DiagGroup<"c++0x-narrowing", [CXX11Narrowing]>;
229
230// Name of this warning in GCC
231def : DiagGroup<"narrowing", [CXX11Narrowing]>;
232
233def CXX11CompatReservedUserDefinedLiteral :
234  DiagGroup<"c++11-compat-reserved-user-defined-literal">;
235def ReservedUserDefinedLiteral :
236  DiagGroup<"reserved-user-defined-literal",
237            [CXX11CompatReservedUserDefinedLiteral]>;
238
239def CXX11Compat : DiagGroup<"c++11-compat",
240                            [CXX11Narrowing,
241                             CXX11CompatReservedUserDefinedLiteral,
242                             CXX11CompatDeprecatedWritableStr,
243                             CXXPre14Compat,
244                             CXXPre17Compat,
245                             CXXPre2aCompat]>;
246def : DiagGroup<"c++0x-compat", [CXX11Compat]>;
247def CXX11CompatPedantic : DiagGroup<"c++11-compat-pedantic",
248                                    [CXX11Compat,
249                                     CXXPre14CompatPedantic,
250                                     CXXPre17CompatPedantic,
251                                     CXXPre2aCompatPedantic]>;
252
253def CXX14Compat : DiagGroup<"c++14-compat", [CXXPre17Compat,
254                                             CXXPre2aCompat]>;
255def CXX14CompatPedantic : DiagGroup<"c++14-compat-pedantic",
256                                    [CXX14Compat,
257                                     CXXPre17CompatPedantic,
258                                     CXXPre2aCompatPedantic]>;
259
260def CXX17Compat : DiagGroup<"c++17-compat", [DeprecatedRegister,
261                                             DeprecatedIncrementBool,
262                                             CXX17CompatMangling,
263                                             CXXPre2aCompat]>;
264def CXX17CompatPedantic : DiagGroup<"c++17-compat-pedantic",
265                                    [CXX17Compat,
266                                     CXXPre2aCompatPedantic]>;
267def : DiagGroup<"c++1z-compat", [CXX17Compat]>;
268
269def CXX2aCompat : DiagGroup<"c++2a-compat">;
270def CXX2aCompatPedantic : DiagGroup<"c++2a-compat-pedantic",
271                                    [CXX2aCompat]>;
272
273def ExitTimeDestructors : DiagGroup<"exit-time-destructors">;
274def FlexibleArrayExtensions : DiagGroup<"flexible-array-extensions">;
275def FourByteMultiChar : DiagGroup<"four-char-constants">;
276def GlobalConstructors : DiagGroup<"global-constructors">;
277def BitwiseOpParentheses: DiagGroup<"bitwise-op-parentheses">;
278def LogicalOpParentheses: DiagGroup<"logical-op-parentheses">;
279def LogicalNotParentheses: DiagGroup<"logical-not-parentheses">;
280def ShiftOpParentheses: DiagGroup<"shift-op-parentheses">;
281def OverloadedShiftOpParentheses: DiagGroup<"overloaded-shift-op-parentheses">;
282def DanglingElse: DiagGroup<"dangling-else">;
283def DanglingField : DiagGroup<"dangling-field">;
284def DanglingInitializerList : DiagGroup<"dangling-initializer-list">;
285def ReturnStackAddress : DiagGroup<"return-stack-address">;
286def Dangling : DiagGroup<"dangling", [DanglingField,
287                                      DanglingInitializerList,
288                                      ReturnStackAddress]>;
289def DistributedObjectModifiers : DiagGroup<"distributed-object-modifiers">;
290def ExpansionToDefined : DiagGroup<"expansion-to-defined">;
291def FlagEnum : DiagGroup<"flag-enum">;
292def IncrementBool : DiagGroup<"increment-bool", [DeprecatedIncrementBool]>;
293def InfiniteRecursion : DiagGroup<"infinite-recursion">;
294def PureVirtualCallFromCtorDtor: DiagGroup<"call-to-pure-virtual-from-ctor-dtor">;
295def GNUImaginaryConstant : DiagGroup<"gnu-imaginary-constant">;
296def IgnoredQualifiers : DiagGroup<"ignored-qualifiers">;
297def : DiagGroup<"import">;
298def GNUIncludeNext : DiagGroup<"gnu-include-next">;
299def IncompatibleMSStruct : DiagGroup<"incompatible-ms-struct">;
300def IncompatiblePointerTypesDiscardsQualifiers
301  : DiagGroup<"incompatible-pointer-types-discards-qualifiers">;
302def IncompatibleFunctionPointerTypes
303  : DiagGroup<"incompatible-function-pointer-types">;
304def IncompatiblePointerTypes
305  : DiagGroup<"incompatible-pointer-types",
306    [IncompatiblePointerTypesDiscardsQualifiers,
307     IncompatibleFunctionPointerTypes]>;
308def IncompleteUmbrella : DiagGroup<"incomplete-umbrella">;
309def IncompleteFrameworkModuleDeclaration
310  : DiagGroup<"incomplete-framework-module-declaration">;
311def NonModularIncludeInFrameworkModule
312  : DiagGroup<"non-modular-include-in-framework-module">;
313def NonModularIncludeInModule : DiagGroup<"non-modular-include-in-module",
314                                          [NonModularIncludeInFrameworkModule]>;
315def IncompleteModule : DiagGroup<"incomplete-module",
316    [IncompleteUmbrella, NonModularIncludeInModule]>;
317def PrivateModule : DiagGroup<"private-module">;
318
319def CXX11InlineNamespace : DiagGroup<"c++11-inline-namespace">;
320def InvalidNoreturn : DiagGroup<"invalid-noreturn">;
321def InvalidSourceEncoding : DiagGroup<"invalid-source-encoding">;
322def KNRPromotedParameter : DiagGroup<"knr-promoted-parameter">;
323def : DiagGroup<"init-self">;
324def : DiagGroup<"inline">;
325def : DiagGroup<"invalid-pch">;
326def GNULabelsAsValue : DiagGroup<"gnu-label-as-value">;
327def LiteralRange : DiagGroup<"literal-range">;
328def LocalTypeTemplateArgs : DiagGroup<"local-type-template-args",
329                                      [CXX98CompatLocalTypeTemplateArgs]>;
330def RangeLoopAnalysis : DiagGroup<"range-loop-analysis">;
331def ForLoopAnalysis : DiagGroup<"for-loop-analysis">;
332def LoopAnalysis : DiagGroup<"loop-analysis", [ForLoopAnalysis,
333                                               RangeLoopAnalysis]>;
334def MalformedWarningCheck : DiagGroup<"malformed-warning-check">;
335def Main : DiagGroup<"main">;
336def MainReturnType : DiagGroup<"main-return-type">;
337def MaxUnsignedZero : DiagGroup<"max-unsigned-zero">;
338def MissingBraces : DiagGroup<"missing-braces">;
339def MissingDeclarations: DiagGroup<"missing-declarations">;
340def : DiagGroup<"missing-format-attribute">;
341def : DiagGroup<"missing-include-dirs">;
342def MissingNoreturn : DiagGroup<"missing-noreturn">;
343def MultiChar : DiagGroup<"multichar">;
344def : DiagGroup<"nested-externs">;
345def CXX11LongLong : DiagGroup<"c++11-long-long">;
346def LongLong : DiagGroup<"long-long", [CXX11LongLong]>;
347def ImplicitlyUnsignedLiteral : DiagGroup<"implicitly-unsigned-literal">;
348def MethodSignatures : DiagGroup<"method-signatures">;
349def MismatchedParameterTypes : DiagGroup<"mismatched-parameter-types">;
350def MismatchedReturnTypes : DiagGroup<"mismatched-return-types">;
351def MismatchedTags : DiagGroup<"mismatched-tags">;
352def MissingFieldInitializers : DiagGroup<"missing-field-initializers">;
353def ModuleBuild : DiagGroup<"module-build">;
354def ModuleImport : DiagGroup<"module-import">;
355def ModuleConflict : DiagGroup<"module-conflict">;
356def ModuleFileExtension : DiagGroup<"module-file-extension">;
357def NewlineEOF : DiagGroup<"newline-eof">;
358def Nullability : DiagGroup<"nullability">;
359def NullabilityDeclSpec : DiagGroup<"nullability-declspec">;
360def NullabilityInferredOnNestedType : DiagGroup<"nullability-inferred-on-nested-type">;
361def NullableToNonNullConversion : DiagGroup<"nullable-to-nonnull-conversion">;
362def NullabilityCompletenessOnArrays : DiagGroup<"nullability-completeness-on-arrays">;
363def NullabilityCompleteness : DiagGroup<"nullability-completeness",
364                                        [NullabilityCompletenessOnArrays]>;
365def NullArithmetic : DiagGroup<"null-arithmetic">;
366def NullCharacter : DiagGroup<"null-character">;
367def NullDereference : DiagGroup<"null-dereference">;
368def InitializerOverrides : DiagGroup<"initializer-overrides">;
369// For compatibility with GCC; -Woverride-init = -Winitializer-overrides
370def : DiagGroup<"override-init", [InitializerOverrides]>;
371def NonNull : DiagGroup<"nonnull">;
372def NonPODVarargs : DiagGroup<"non-pod-varargs">;
373def ClassVarargs : DiagGroup<"class-varargs", [NonPODVarargs]>;
374def : DiagGroup<"nonportable-cfstrings">;
375def NonVirtualDtor : DiagGroup<"non-virtual-dtor">;
376def NullPointerArithmetic : DiagGroup<"null-pointer-arithmetic">;
377def : DiagGroup<"effc++", [NonVirtualDtor]>;
378def OveralignedType : DiagGroup<"over-aligned">;
379def OldStyleCast : DiagGroup<"old-style-cast">;
380def : DiagGroup<"old-style-definition">;
381def OutOfLineDeclaration : DiagGroup<"out-of-line-declaration">;
382def : DiagGroup<"overflow">;
383def ForwardClassReceiver : DiagGroup<"receiver-forward-class">;
384def MethodAccess : DiagGroup<"objc-method-access">;
385def ObjCReceiver : DiagGroup<"receiver-expr">;
386def OperatorNewReturnsNull : DiagGroup<"new-returns-null">;
387def OverlengthStrings : DiagGroup<"overlength-strings">;
388def OverloadedVirtual : DiagGroup<"overloaded-virtual">;
389def PrivateExtern : DiagGroup<"private-extern">;
390def SelTypeCast : DiagGroup<"cast-of-sel-type">;
391def FunctionDefInObjCContainer : DiagGroup<"function-def-in-objc-container">;
392def BadFunctionCast : DiagGroup<"bad-function-cast">;
393def ObjCPropertyImpl : DiagGroup<"objc-property-implementation">;
394def ObjCPropertyNoAttribute : DiagGroup<"objc-property-no-attribute">;
395def ObjCPropertyAssignOnObjectType : DiagGroup<"objc-property-assign-on-object-type">;
396def ObjCProtocolQualifiers : DiagGroup<"objc-protocol-qualifiers">;
397def ObjCMissingSuperCalls : DiagGroup<"objc-missing-super-calls">;
398def ObjCDesignatedInit : DiagGroup<"objc-designated-initializers">;
399def ObjCRetainBlockProperty : DiagGroup<"objc-noncopy-retain-block-property">;
400def ObjCReadonlyPropertyHasSetter : DiagGroup<"objc-readonly-with-setter-property">;
401def ObjCInvalidIBOutletProperty : DiagGroup<"invalid-iboutlet">;
402def ObjCRootClass : DiagGroup<"objc-root-class">;
403def ObjCPointerIntrospectPerformSelector : DiagGroup<"deprecated-objc-pointer-introspection-performSelector">;
404def ObjCPointerIntrospect : DiagGroup<"deprecated-objc-pointer-introspection", [ObjCPointerIntrospectPerformSelector]>;
405def ObjCMultipleMethodNames : DiagGroup<"objc-multiple-method-names">;
406def ObjCFlexibleArray : DiagGroup<"objc-flexible-array">;
407def ObjCBoxing : DiagGroup<"objc-boxing">;
408def OpenCLUnsupportedRGBA: DiagGroup<"opencl-unsupported-rgba">;
409def DeprecatedObjCIsaUsage : DiagGroup<"deprecated-objc-isa-usage">;
410def ExplicitInitializeCall : DiagGroup<"explicit-initialize-call">;
411def Packed : DiagGroup<"packed">;
412def Padded : DiagGroup<"padded">;
413
414def PessimizingMove : DiagGroup<"pessimizing-move">;
415def ReturnStdMoveInCXX11 : DiagGroup<"return-std-move-in-c++11">;
416def ReturnStdMove : DiagGroup<"return-std-move">;
417
418def PointerArith : DiagGroup<"pointer-arith">;
419def PoundWarning : DiagGroup<"#warnings">;
420def PoundPragmaMessage : DiagGroup<"#pragma-messages">,
421                         DiagCategory<"#pragma message Directive">;
422def : DiagGroup<"pointer-to-int-cast">;
423def : DiagGroup<"redundant-decls">;
424def RedeclaredClassMember : DiagGroup<"redeclared-class-member">;
425def GNURedeclaredEnum : DiagGroup<"gnu-redeclared-enum">;
426def RedundantMove : DiagGroup<"redundant-move">;
427def Register : DiagGroup<"register", [DeprecatedRegister]>;
428def ReturnTypeCLinkage : DiagGroup<"return-type-c-linkage">;
429def ReturnType : DiagGroup<"return-type", [ReturnTypeCLinkage]>;
430def BindToTemporaryCopy : DiagGroup<"bind-to-temporary-copy",
431                                    [CXX98CompatBindToTemporaryCopy]>;
432def SelfAssignmentField : DiagGroup<"self-assign-field">;
433def SelfAssignmentOverloaded : DiagGroup<"self-assign-overloaded">;
434def SelfAssignment : DiagGroup<"self-assign", [SelfAssignmentOverloaded, SelfAssignmentField]>;
435def SelfMove : DiagGroup<"self-move">;
436def SemiBeforeMethodBody : DiagGroup<"semicolon-before-method-body">;
437def Sentinel : DiagGroup<"sentinel">;
438def MissingMethodReturnType : DiagGroup<"missing-method-return-type">;
439
440def ShadowField : DiagGroup<"shadow-field">;
441def ShadowFieldInConstructorModified : DiagGroup<"shadow-field-in-constructor-modified">;
442def ShadowFieldInConstructor : DiagGroup<"shadow-field-in-constructor",
443                                         [ShadowFieldInConstructorModified]>;
444def ShadowIvar : DiagGroup<"shadow-ivar">;
445def ShadowUncapturedLocal : DiagGroup<"shadow-uncaptured-local">;
446
447// -Wshadow-all is a catch-all for all shadowing. -Wshadow is just the
448// shadowing that we think is unsafe.
449def Shadow : DiagGroup<"shadow", [ShadowFieldInConstructorModified,
450                                  ShadowIvar]>;
451def ShadowAll : DiagGroup<"shadow-all", [Shadow, ShadowFieldInConstructor,
452                                         ShadowUncapturedLocal, ShadowField]>;
453
454def Shorten64To32 : DiagGroup<"shorten-64-to-32">;
455def : DiagGroup<"sign-promo">;
456def SignCompare : DiagGroup<"sign-compare">;
457def : DiagGroup<"stack-protector">;
458def : DiagGroup<"switch-default">;
459def : DiagGroup<"synth">;
460def SizeofArrayArgument : DiagGroup<"sizeof-array-argument">;
461def SizeofArrayDecay : DiagGroup<"sizeof-array-decay">;
462def SizeofPointerMemaccess : DiagGroup<"sizeof-pointer-memaccess">;
463def MemsetTransposedArgs : DiagGroup<"memset-transposed-args">;
464def DynamicClassMemaccess : DiagGroup<"dynamic-class-memaccess">;
465def NonTrivialMemaccess : DiagGroup<"nontrivial-memaccess">;
466def SuspiciousBzero : DiagGroup<"suspicious-bzero">;
467def SuspiciousMemaccess : DiagGroup<"suspicious-memaccess",
468  [SizeofPointerMemaccess, DynamicClassMemaccess,
469   NonTrivialMemaccess, MemsetTransposedArgs, SuspiciousBzero]>;
470def StaticInInline : DiagGroup<"static-in-inline">;
471def StaticLocalInInline : DiagGroup<"static-local-in-inline">;
472def GNUStaticFloatInit : DiagGroup<"gnu-static-float-init">;
473def StaticFloatInit : DiagGroup<"static-float-init", [GNUStaticFloatInit]>;
474def GNUStatementExpression : DiagGroup<"gnu-statement-expression">;
475def StringCompare : DiagGroup<"string-compare">;
476def StringPlusInt : DiagGroup<"string-plus-int">;
477def StringPlusChar : DiagGroup<"string-plus-char">;
478def StrncatSize : DiagGroup<"strncat-size">;
479def TautologicalTypeLimitCompare : DiagGroup<"tautological-type-limit-compare">;
480def TautologicalUnsignedZeroCompare : DiagGroup<"tautological-unsigned-zero-compare">;
481def TautologicalUnsignedEnumZeroCompare : DiagGroup<"tautological-unsigned-enum-zero-compare">;
482def TautologicalInRangeCompare : DiagGroup<"tautological-constant-in-range-compare",
483                                           [TautologicalTypeLimitCompare,
484                                            TautologicalUnsignedZeroCompare,
485                                            TautologicalUnsignedEnumZeroCompare]>;
486def TautologicalOutOfRangeCompare : DiagGroup<"tautological-constant-out-of-range-compare">;
487def TautologicalConstantCompare : DiagGroup<"tautological-constant-compare",
488                                            [TautologicalOutOfRangeCompare]>;
489def TautologicalPointerCompare : DiagGroup<"tautological-pointer-compare">;
490def TautologicalOverlapCompare : DiagGroup<"tautological-overlap-compare">;
491def TautologicalUndefinedCompare : DiagGroup<"tautological-undefined-compare">;
492def TautologicalCompare : DiagGroup<"tautological-compare",
493                                    [TautologicalConstantCompare,
494                                     TautologicalPointerCompare,
495                                     TautologicalOverlapCompare,
496                                     TautologicalUndefinedCompare]>;
497def HeaderHygiene : DiagGroup<"header-hygiene">;
498def DuplicateDeclSpecifier : DiagGroup<"duplicate-decl-specifier">;
499def CompareDistinctPointerType : DiagGroup<"compare-distinct-pointer-types">;
500def GNUUnionCast : DiagGroup<"gnu-union-cast">;
501def GNUVariableSizedTypeNotAtEnd : DiagGroup<"gnu-variable-sized-type-not-at-end">;
502def Varargs : DiagGroup<"varargs">;
503
504def Unsequenced : DiagGroup<"unsequenced">;
505// GCC name for -Wunsequenced
506def : DiagGroup<"sequence-point", [Unsequenced]>;
507
508// Preprocessor warnings.
509def AmbiguousMacro : DiagGroup<"ambiguous-macro">;
510def KeywordAsMacro : DiagGroup<"keyword-macro">;
511def ReservedIdAsMacro : DiagGroup<"reserved-id-macro">;
512
513// Just silence warnings about -Wstrict-aliasing for now.
514def : DiagGroup<"strict-aliasing=0">;
515def : DiagGroup<"strict-aliasing=1">;
516def : DiagGroup<"strict-aliasing=2">;
517def : DiagGroup<"strict-aliasing">;
518
519// Just silence warnings about -Wstrict-overflow for now.
520def : DiagGroup<"strict-overflow=0">;
521def : DiagGroup<"strict-overflow=1">;
522def : DiagGroup<"strict-overflow=2">;
523def : DiagGroup<"strict-overflow=3">;
524def : DiagGroup<"strict-overflow=4">;
525def : DiagGroup<"strict-overflow=5">;
526def : DiagGroup<"strict-overflow">;
527
528def InvalidOffsetof : DiagGroup<"invalid-offsetof">;
529def : DiagGroup<"strict-prototypes">;
530def StrictSelector : DiagGroup<"strict-selector-match">;
531def MethodDuplicate : DiagGroup<"duplicate-method-match">;
532def ObjCCStringFormat : DiagGroup<"cstring-format-directive">;
533def CoveredSwitchDefault : DiagGroup<"covered-switch-default">;
534def SwitchBool     : DiagGroup<"switch-bool">;
535def SwitchEnum     : DiagGroup<"switch-enum">;
536def Switch         : DiagGroup<"switch">;
537def EnumCompareSwitch : DiagGroup<"enum-compare-switch">;
538def EnumCompare       : DiagGroup<"enum-compare", [EnumCompareSwitch]>;
539def ImplicitFallthroughPerFunction :
540  DiagGroup<"implicit-fallthrough-per-function">;
541def ImplicitFallthrough  : DiagGroup<"implicit-fallthrough",
542                                     [ImplicitFallthroughPerFunction]>;
543def InvalidPPToken : DiagGroup<"invalid-pp-token">;
544def Trigraphs      : DiagGroup<"trigraphs">;
545
546def : DiagGroup<"type-limits">;
547def UndefinedReinterpretCast : DiagGroup<"undefined-reinterpret-cast">;
548def ReinterpretBaseClass : DiagGroup<"reinterpret-base-class">;
549def Unicode  : DiagGroup<"unicode">;
550def UninitializedMaybe : DiagGroup<"conditional-uninitialized">;
551def UninitializedSometimes : DiagGroup<"sometimes-uninitialized">;
552def UninitializedStaticSelfInit : DiagGroup<"static-self-init">;
553def Uninitialized  : DiagGroup<"uninitialized", [UninitializedSometimes,
554                                                 UninitializedStaticSelfInit]>;
555def IgnoredPragmaIntrinsic : DiagGroup<"ignored-pragma-intrinsic">;
556// #pragma optimize is often used to avoid to work around MSVC codegen bugs or
557// to disable inlining. It's not completely clear what alternative to suggest
558// (#pragma clang optimize, noinline) so suggest nothing for now.
559def IgnoredPragmaOptimize : DiagGroup<"ignored-pragma-optimize">;
560def UnknownPragmas : DiagGroup<"unknown-pragmas">;
561def IgnoredPragmas : DiagGroup<"ignored-pragmas",
562    [IgnoredPragmaIntrinsic, IgnoredPragmaOptimize]>;
563def PragmaClangAttribute : DiagGroup<"pragma-clang-attribute">;
564def PragmaPackSuspiciousInclude : DiagGroup<"pragma-pack-suspicious-include">;
565def PragmaPack : DiagGroup<"pragma-pack", [PragmaPackSuspiciousInclude]>;
566def Pragmas : DiagGroup<"pragmas", [UnknownPragmas, IgnoredPragmas,
567                                    PragmaClangAttribute, PragmaPack]>;
568def UnknownWarningOption : DiagGroup<"unknown-warning-option">;
569def NSobjectAttribute : DiagGroup<"NSObject-attribute">;
570def NSConsumedMismatch : DiagGroup<"nsconsumed-mismatch">;
571def NSReturnsMismatch : DiagGroup<"nsreturns-mismatch">;
572
573def IndependentClassAttribute : DiagGroup<"IndependentClass-attribute">;
574def UnknownAttributes : DiagGroup<"unknown-attributes">;
575def IgnoredAttributes : DiagGroup<"ignored-attributes">;
576def Attributes : DiagGroup<"attributes", [UnknownAttributes,
577                                          IgnoredAttributes]>;
578def UnknownSanitizers : DiagGroup<"unknown-sanitizers">;
579def UnnamedTypeTemplateArgs : DiagGroup<"unnamed-type-template-args",
580                                        [CXX98CompatUnnamedTypeTemplateArgs]>;
581def UnsupportedFriend : DiagGroup<"unsupported-friend">;
582def UnusedArgument : DiagGroup<"unused-argument">;
583def UnusedCommandLineArgument : DiagGroup<"unused-command-line-argument">;
584def IgnoredOptimizationArgument : DiagGroup<"ignored-optimization-argument">;
585def InvalidCommandLineArgument : DiagGroup<"invalid-command-line-argument",
586                                           [IgnoredOptimizationArgument]>;
587def UnusedComparison : DiagGroup<"unused-comparison">;
588def UnusedExceptionParameter : DiagGroup<"unused-exception-parameter">;
589def UnneededInternalDecl : DiagGroup<"unneeded-internal-declaration">;
590def UnneededMemberFunction : DiagGroup<"unneeded-member-function">;
591def UnusedPrivateField : DiagGroup<"unused-private-field">;
592def UnusedFunction : DiagGroup<"unused-function", [UnneededInternalDecl]>;
593def UnusedTemplate : DiagGroup<"unused-template", [UnneededInternalDecl]>;
594def UnusedMemberFunction : DiagGroup<"unused-member-function",
595                                     [UnneededMemberFunction]>;
596def UnusedLabel : DiagGroup<"unused-label">;
597def UnusedLambdaCapture : DiagGroup<"unused-lambda-capture">;
598def UnusedParameter : DiagGroup<"unused-parameter">;
599def UnusedResult : DiagGroup<"unused-result">;
600def PotentiallyEvaluatedExpression : DiagGroup<"potentially-evaluated-expression">;
601def UnevaluatedExpression : DiagGroup<"unevaluated-expression",
602                                      [PotentiallyEvaluatedExpression]>;
603def UnusedValue : DiagGroup<"unused-value", [UnusedComparison, UnusedResult,
604                                             UnevaluatedExpression]>;
605def UnusedConstVariable : DiagGroup<"unused-const-variable">;
606def UnusedVariable : DiagGroup<"unused-variable",
607                               [UnusedConstVariable]>;
608def UnusedLocalTypedef : DiagGroup<"unused-local-typedef">;
609def UnusedPropertyIvar :  DiagGroup<"unused-property-ivar">;
610def UnusedGetterReturnValue : DiagGroup<"unused-getter-return-value">;
611def UsedButMarkedUnused : DiagGroup<"used-but-marked-unused">;
612def UserDefinedLiterals : DiagGroup<"user-defined-literals">;
613def UserDefinedWarnings : DiagGroup<"user-defined-warnings">;
614def Reorder : DiagGroup<"reorder">;
615def UndeclaredSelector : DiagGroup<"undeclared-selector">;
616def ImplicitAtomic : DiagGroup<"implicit-atomic-properties">;
617def CustomAtomic : DiagGroup<"custom-atomic-properties">;
618def AtomicProperties : DiagGroup<"atomic-properties",
619                                 [ImplicitAtomic, CustomAtomic]>;
620def ARCUnsafeRetainedAssign : DiagGroup<"arc-unsafe-retained-assign">;
621def ARCRetainCycles : DiagGroup<"arc-retain-cycles">;
622def ARCNonPodMemAccess : DiagGroup<"arc-non-pod-memaccess">;
623def AutomaticReferenceCounting : DiagGroup<"arc",
624                                           [ARCUnsafeRetainedAssign,
625                                            ARCRetainCycles,
626                                            ARCNonPodMemAccess]>;
627def ARCRepeatedUseOfWeakMaybe : DiagGroup<"arc-maybe-repeated-use-of-weak">;
628def ARCRepeatedUseOfWeak : DiagGroup<"arc-repeated-use-of-weak",
629                                     [ARCRepeatedUseOfWeakMaybe]>;
630def BlockCaptureAutoReleasing : DiagGroup<"block-capture-autoreleasing">;
631def ObjCBridge : DiagGroup<"bridge-cast">;
632
633def DeallocInCategory:DiagGroup<"dealloc-in-category">;
634def SelectorTypeMismatch : DiagGroup<"selector-type-mismatch">;
635def Selector : DiagGroup<"selector", [SelectorTypeMismatch]>;
636def Protocol : DiagGroup<"protocol">;
637// No longer in use, preserve for backwards compatibility.
638def : DiagGroup<"at-protocol">;
639def PropertyAccessDotSyntax: DiagGroup<"property-access-dot-syntax">;
640def PropertyAttr : DiagGroup<"property-attribute-mismatch">;
641def SuperSubClassMismatch : DiagGroup<"super-class-method-mismatch">;
642def OverridingMethodMismatch : DiagGroup<"overriding-method-mismatch">;
643def VariadicMacros : DiagGroup<"variadic-macros">;
644def VectorConversion : DiagGroup<"vector-conversion">;      // clang specific
645def VexingParse : DiagGroup<"vexing-parse">;
646def VLA : DiagGroup<"vla">;
647def VLAExtension : DiagGroup<"vla-extension">;
648def VolatileRegisterVar : DiagGroup<"volatile-register-var">;
649def Visibility : DiagGroup<"visibility">;
650def ZeroLengthArray : DiagGroup<"zero-length-array">;
651def GNUZeroLineDirective : DiagGroup<"gnu-zero-line-directive">;
652def GNUZeroVariadicMacroArguments : DiagGroup<"gnu-zero-variadic-macro-arguments">;
653def Fallback : DiagGroup<"fallback">;
654
655// This covers both the deprecated case (in C++98)
656// and the extension case (in C++11 onwards).
657def WritableStrings : DiagGroup<"writable-strings", [DeprecatedWritableStr]>;
658
659// GCC calls -Wdeprecated-writable-strings -Wwrite-strings.
660//
661// Bizarrely, this warning flag enables -fconst-strings in C. This is
662// GCC-compatible, but really weird.
663//
664// FIXME: Should this affect C++11 (where this is an error,
665//        not just deprecated) or not?
666def GCCWriteStrings : DiagGroup<"write-strings" , [WritableStrings]>;
667
668def CharSubscript : DiagGroup<"char-subscripts">;
669def LargeByValueCopy : DiagGroup<"large-by-value-copy">;
670def DuplicateArgDecl : DiagGroup<"duplicate-method-arg">;
671def SignedEnumBitfield : DiagGroup<"signed-enum-bitfield">;
672
673// Unreachable code warning groups.
674//
675//  The goal is make -Wunreachable-code on by default, in -Wall, or at
676//  least actively used, with more noisy versions of the warning covered
677//  under separate flags.
678//
679def UnreachableCodeLoopIncrement : DiagGroup<"unreachable-code-loop-increment">;
680def UnreachableCode : DiagGroup<"unreachable-code",
681                                [UnreachableCodeLoopIncrement]>;
682def UnreachableCodeBreak : DiagGroup<"unreachable-code-break">;
683def UnreachableCodeReturn : DiagGroup<"unreachable-code-return">;
684def UnreachableCodeAggressive : DiagGroup<"unreachable-code-aggressive",
685                                    [UnreachableCode,
686                                     UnreachableCodeBreak,
687                                     UnreachableCodeReturn]>;
688
689// Aggregation warning settings.
690
691// Populate -Waddress with warnings from other groups.
692def : DiagGroup<"address", [PointerBoolConversion,
693                            StringCompare,
694                            TautologicalPointerCompare]>;
695
696// -Widiomatic-parentheses contains warnings about 'idiomatic'
697// missing parentheses;  it is off by default.  We do not include it
698// in -Wparentheses because most users who use -Wparentheses explicitly
699// do not want these warnings.
700def ParenthesesOnEquality : DiagGroup<"parentheses-equality">;
701def Parentheses : DiagGroup<"parentheses",
702                            [LogicalOpParentheses,
703                             LogicalNotParentheses,
704                             BitwiseOpParentheses,
705                             ShiftOpParentheses,
706                             OverloadedShiftOpParentheses,
707                             ParenthesesOnEquality,
708                             DanglingElse]>;
709
710// -Wconversion has its own warnings, but we split a few out for
711// legacy reasons:
712//   - some people want just 64-to-32 warnings
713//   - conversion warnings with constant sources are on by default
714//   - conversion warnings for literals are on by default
715//   - bool-to-pointer conversion warnings are on by default
716//   - __null-to-integer conversion warnings are on by default
717def Conversion : DiagGroup<"conversion",
718                           [BoolConversion,
719                            ConstantConversion,
720                            EnumConversion,
721                            BitFieldEnumConversion,
722                            FloatConversion,
723                            Shorten64To32,
724                            IntConversion,
725                            ImplicitIntConversion,
726                            ImplicitFloatConversion,
727                            LiteralConversion,
728                            NonLiteralNullConversion, // (1-1)->pointer (etc)
729                            NullConversion, // NULL->non-pointer
730                            ObjCLiteralConversion,
731                            SignConversion,
732                            StringConversion]>,
733                 DiagCategory<"Value Conversion Issue">;
734
735def Unused : DiagGroup<"unused",
736                       [UnusedArgument, UnusedFunction, UnusedLabel,
737                        // UnusedParameter, (matches GCC's behavior)
738                        // UnusedTemplate, (clean-up libc++ before enabling)
739                        // UnusedMemberFunction, (clean-up llvm before enabling)
740                        UnusedPrivateField, UnusedLambdaCapture,
741                        UnusedLocalTypedef, UnusedValue, UnusedVariable,
742                        UnusedPropertyIvar]>,
743                        DiagCategory<"Unused Entity Issue">;
744
745// Format settings.
746def FormatInvalidSpecifier : DiagGroup<"format-invalid-specifier">;
747def FormatSecurity : DiagGroup<"format-security">;
748def FormatNonStandard : DiagGroup<"format-non-iso">;
749def FormatY2K : DiagGroup<"format-y2k">;
750def FormatPedantic : DiagGroup<"format-pedantic">;
751def Format : DiagGroup<"format",
752                       [FormatExtraArgs, FormatZeroLength, NonNull,
753                        FormatSecurity, FormatY2K, FormatInvalidSpecifier]>,
754             DiagCategory<"Format String Issue">;
755def FormatNonLiteral : DiagGroup<"format-nonliteral">;
756def Format2 : DiagGroup<"format=2",
757                        [FormatNonLiteral, FormatSecurity, FormatY2K]>;
758
759def TypeSafety : DiagGroup<"type-safety">;
760
761def IncompatibleExceptionSpec : DiagGroup<"incompatible-exception-spec">;
762
763def IntToVoidPointerCast : DiagGroup<"int-to-void-pointer-cast">;
764def IntToPointerCast : DiagGroup<"int-to-pointer-cast",
765                                 [IntToVoidPointerCast]>;
766
767def Move : DiagGroup<"move", [
768    PessimizingMove,
769    RedundantMove,
770    ReturnStdMove,
771    SelfMove
772  ]>;
773
774def Extra : DiagGroup<"extra", [
775    MissingFieldInitializers,
776    IgnoredQualifiers,
777    InitializerOverrides,
778    SemiBeforeMethodBody,
779    MissingMethodReturnType,
780    SignCompare,
781    UnusedParameter,
782    NullPointerArithmetic,
783    EmptyInitStatement
784  ]>;
785
786def Most : DiagGroup<"most", [
787    CharSubscript,
788    Comment,
789    DeleteNonVirtualDtor,
790    ForLoopAnalysis,
791    Format,
792    Implicit,
793    InfiniteRecursion,
794    MismatchedTags,
795    MissingBraces,
796    Move,
797    MultiChar,
798    Reorder,
799    ReturnType,
800    SelfAssignment,
801    SelfMove,
802    SizeofArrayArgument,
803    SizeofArrayDecay,
804    StringPlusInt,
805    Trigraphs,
806    Uninitialized,
807    UnknownPragmas,
808    Unused,
809    VolatileRegisterVar,
810    ObjCMissingSuperCalls,
811    ObjCDesignatedInit,
812    ObjCFlexibleArray,
813    OverloadedVirtual,
814    PrivateExtern,
815    SelTypeCast,
816    ExternCCompat,
817    UserDefinedWarnings
818 ]>;
819
820// Thread Safety warnings
821def ThreadSafetyAttributes : DiagGroup<"thread-safety-attributes">;
822def ThreadSafetyAnalysis   : DiagGroup<"thread-safety-analysis">;
823def ThreadSafetyPrecise    : DiagGroup<"thread-safety-precise">;
824def ThreadSafetyReference  : DiagGroup<"thread-safety-reference">;
825def ThreadSafetyNegative   : DiagGroup<"thread-safety-negative">;
826def ThreadSafety : DiagGroup<"thread-safety",
827                             [ThreadSafetyAttributes,
828                              ThreadSafetyAnalysis,
829                              ThreadSafetyPrecise,
830                              ThreadSafetyReference]>;
831def ThreadSafetyVerbose : DiagGroup<"thread-safety-verbose">;
832def ThreadSafetyBeta : DiagGroup<"thread-safety-beta">;
833
834// Uniqueness Analysis warnings
835def Consumed       : DiagGroup<"consumed">;
836
837// Note that putting warnings in -Wall will not disable them by default. If a
838// warning should be active _only_ when -Wall is passed in, mark it as
839// DefaultIgnore in addition to putting it here.
840def All : DiagGroup<"all", [Most, Parentheses, Switch, SwitchBool]>;
841
842// Warnings that should be in clang-cl /w4.
843def : DiagGroup<"CL4", [All, Extra]>;
844
845// Warnings enabled by -pedantic.  This is magically filled in by TableGen.
846def Pedantic : DiagGroup<"pedantic">;
847
848// Aliases.
849def : DiagGroup<"", [Extra]>;                   // -W = -Wextra
850def : DiagGroup<"endif-labels", [ExtraTokens]>; // -Wendif-labels=-Wextra-tokens
851def : DiagGroup<"cpp", [PoundWarning]>;         // -Wcpp = -W#warnings
852def : DiagGroup<"comments", [Comment]>;         // -Wcomments = -Wcomment
853def : DiagGroup<"conversion-null",
854                [NullConversion]>; // -Wconversion-null = -Wnull-conversion
855def : DiagGroup<"bool-conversions",
856                [BoolConversion]>; // -Wbool-conversions  = -Wbool-conversion
857def : DiagGroup<"int-conversions",
858                [IntConversion]>; // -Wint-conversions = -Wint-conversion
859def : DiagGroup<"vector-conversions",
860                [VectorConversion]>; // -Wvector-conversions = -Wvector-conversion
861def : DiagGroup<"unused-local-typedefs", [UnusedLocalTypedef]>;
862                // -Wunused-local-typedefs = -Wunused-local-typedef
863
864// A warning group for warnings that we want to have on by default in clang,
865// but which aren't on by default in GCC.
866def NonGCC : DiagGroup<"non-gcc",
867    [SignCompare, Conversion, LiteralRange]>;
868
869// A warning group for warnings about using C++11 features as extensions in
870// earlier C++ versions.
871def CXX11 : DiagGroup<"c++11-extensions", [CXX11ExtraSemi, CXX11InlineNamespace,
872                                           CXX11LongLong]>;
873
874// A warning group for warnings about using C++14 features as extensions in
875// earlier C++ versions.
876def CXX14 : DiagGroup<"c++14-extensions", [CXX14BinaryLiteral]>;
877
878// A warning group for warnings about using C++17 features as extensions in
879// earlier C++ versions.
880def CXX17 : DiagGroup<"c++17-extensions">;
881
882// A warning group for warnings about using C++2a features as extensions in
883// earlier C++ versions.
884def CXX2a : DiagGroup<"c++2a-extensions">;
885
886def : DiagGroup<"c++0x-extensions", [CXX11]>;
887def : DiagGroup<"c++1y-extensions", [CXX14]>;
888def : DiagGroup<"c++1z-extensions", [CXX17]>;
889
890def DelegatingCtorCycles :
891  DiagGroup<"delegating-ctor-cycles">;
892
893// A warning group for warnings about using C11 features as extensions.
894def C11 : DiagGroup<"c11-extensions">;
895
896// A warning group for warnings about using C99 features as extensions.
897def C99 : DiagGroup<"c99-extensions">;
898
899// A warning group for warnings about GCC extensions.
900def GNU : DiagGroup<"gnu", [GNUAlignofExpression, GNUAnonymousStruct,
901                            GNUAutoType,
902                            GNUBinaryLiteral, GNUCaseRange,
903                            GNUComplexInteger, GNUCompoundLiteralInitializer,
904                            GNUConditionalOmittedOperand, GNUDesignator,
905                            GNUEmptyInitializer, GNUEmptyStruct,
906                            VLAExtension, GNUFlexibleArrayInitializer,
907                            GNUFlexibleArrayUnionMember, GNUFoldingConstant,
908                            GNUImaginaryConstant, GNUIncludeNext,
909                            GNULabelsAsValue,
910                            RedeclaredClassMember, GNURedeclaredEnum,
911                            GNUStatementExpression, GNUStaticFloatInit,
912                            GNUStringLiteralOperatorTemplate,
913                            GNUUnionCast, GNUVariableSizedTypeNotAtEnd,
914                            ZeroLengthArray, GNUZeroLineDirective,
915                            GNUZeroVariadicMacroArguments]>;
916// A warning group for warnings about code that clang accepts but gcc doesn't.
917def GccCompat : DiagGroup<"gcc-compat">;
918
919// Warnings for Microsoft extensions.
920def MicrosoftCharize : DiagGroup<"microsoft-charize">;
921def MicrosoftInclude : DiagGroup<"microsoft-include">;
922def MicrosoftCppMacro : DiagGroup<"microsoft-cpp-macro">;
923def MicrosoftFixedEnum : DiagGroup<"microsoft-fixed-enum">;
924def MicrosoftSealed : DiagGroup<"microsoft-sealed">;
925def MicrosoftUnqualifiedFriend : DiagGroup<"microsoft-unqualified-friend">;
926def MicrosoftExceptionSpec : DiagGroup<"microsoft-exception-spec">;
927def MicrosoftUsingDecl : DiagGroup<"microsoft-using-decl">;
928def MicrosoftMutableReference : DiagGroup<"microsoft-mutable-reference">;
929def MicrosoftPureDefinition : DiagGroup<"microsoft-pure-definition">;
930def MicrosoftUnionMemberReference : DiagGroup<
931    "microsoft-union-member-reference">;
932def MicrosoftExplicitConstructorCall : DiagGroup<
933    "microsoft-explicit-constructor-call">;
934def MicrosoftEnumValue : DiagGroup<"microsoft-enum-value">;
935def MicrosoftDefaultArgRedefinition :
936    DiagGroup<"microsoft-default-arg-redefinition">;
937def MicrosoftTemplate : DiagGroup<"microsoft-template">;
938def MicrosoftInconsistentDllImport : DiagGroup<"inconsistent-dllimport">;
939def MicrosoftRedeclareStatic : DiagGroup<"microsoft-redeclare-static">;
940def MicrosoftEnumForwardReference :
941    DiagGroup<"microsoft-enum-forward-reference">;
942def MicrosoftGoto : DiagGroup<"microsoft-goto">;
943def MicrosoftFlexibleArray : DiagGroup<"microsoft-flexible-array">;
944def MicrosoftExtraQualification : DiagGroup<"microsoft-extra-qualification">;
945def MicrosoftCast : DiagGroup<"microsoft-cast">;
946def MicrosoftConstInit : DiagGroup<"microsoft-const-init">;
947def MicrosoftVoidPseudoDtor : DiagGroup<"microsoft-void-pseudo-dtor">;
948def MicrosoftAnonTag : DiagGroup<"microsoft-anon-tag">;
949def MicrosoftCommentPaste : DiagGroup<"microsoft-comment-paste">;
950def MicrosoftEndOfFile : DiagGroup<"microsoft-end-of-file">;
951def MicrosoftInaccessibleBase : DiagGroup<"microsoft-inaccessible-base">;
952// Aliases.
953def : DiagGroup<"msvc-include", [MicrosoftInclude]>;
954                // -Wmsvc-include = -Wmicrosoft-include
955
956// Warnings group for warnings about Microsoft extensions.
957def Microsoft : DiagGroup<"microsoft",
958    [MicrosoftCharize, MicrosoftInclude, MicrosoftCppMacro, MicrosoftFixedEnum,
959     MicrosoftSealed, MicrosoftUnqualifiedFriend, MicrosoftExceptionSpec,
960     MicrosoftUsingDecl, MicrosoftMutableReference, MicrosoftPureDefinition,
961     MicrosoftUnionMemberReference, MicrosoftExplicitConstructorCall,
962     MicrosoftEnumValue, MicrosoftDefaultArgRedefinition, MicrosoftTemplate,
963     MicrosoftRedeclareStatic, MicrosoftEnumForwardReference, MicrosoftGoto,
964     MicrosoftFlexibleArray, MicrosoftExtraQualification, MicrosoftCast,
965     MicrosoftConstInit, MicrosoftVoidPseudoDtor, MicrosoftAnonTag,
966     MicrosoftCommentPaste, MicrosoftEndOfFile,
967     MicrosoftInconsistentDllImport]>;
968
969def ClangClPch : DiagGroup<"clang-cl-pch">;
970
971def ObjCNonUnifiedException : DiagGroup<"objc-nonunified-exceptions">;
972
973def ObjCProtocolMethodImpl : DiagGroup<"objc-protocol-method-implementation">;
974
975def ObjCNoPropertyAutoSynthesis : DiagGroup<"objc-property-synthesis">;
976
977// ObjC API warning groups.
978def ObjCRedundantLiteralUse : DiagGroup<"objc-redundant-literal-use">;
979def ObjCRedundantAPIUse : DiagGroup<"objc-redundant-api-use", [
980    ObjCRedundantLiteralUse
981  ]>;
982
983def ObjCCocoaAPI : DiagGroup<"objc-cocoa-api", [
984    ObjCRedundantAPIUse
985  ]>;
986
987def ObjCStringComparison : DiagGroup<"objc-string-compare">;
988def ObjCStringConcatenation : DiagGroup<"objc-string-concatenation">;
989def ObjCLiteralComparison : DiagGroup<"objc-literal-compare", [
990    ObjCStringComparison
991  ]>;
992
993// Inline ASM warnings.
994def ASMOperandWidths : DiagGroup<"asm-operand-widths">;
995def ASMIgnoredQualifier : DiagGroup<"asm-ignored-qualifier">;
996def ASM : DiagGroup<"asm", [
997    ASMOperandWidths, ASMIgnoredQualifier
998  ]>;
999
1000// OpenMP warnings.
1001def SourceUsesOpenMP : DiagGroup<"source-uses-openmp">;
1002def OpenMPClauses : DiagGroup<"openmp-clauses">;
1003def OpenMPLoopForm : DiagGroup<"openmp-loop-form">;
1004def OpenMPTarget : DiagGroup<"openmp-target">;
1005
1006// Backend warnings.
1007def BackendInlineAsm : DiagGroup<"inline-asm">;
1008def BackendFrameLargerThanEQ : DiagGroup<"frame-larger-than=">;
1009def BackendPlugin : DiagGroup<"backend-plugin">;
1010def RemarkBackendPlugin : DiagGroup<"remark-backend-plugin">;
1011def BackendOptimizationRemark : DiagGroup<"pass">;
1012def BackendOptimizationRemarkMissed : DiagGroup<"pass-missed">;
1013def BackendOptimizationRemarkAnalysis : DiagGroup<"pass-analysis">;
1014def BackendOptimizationFailure : DiagGroup<"pass-failed">;
1015
1016// Instrumentation based profiling warnings.
1017def ProfileInstrMissing : DiagGroup<"profile-instr-missing">;
1018def ProfileInstrOutOfDate : DiagGroup<"profile-instr-out-of-date">;
1019def ProfileInstrUnprofiled : DiagGroup<"profile-instr-unprofiled">;
1020
1021// AddressSanitizer frontend instrumentation remarks.
1022def SanitizeAddressRemarks : DiagGroup<"sanitize-address">;
1023
1024// Issues with serialized diagnostics.
1025def SerializedDiagnostics : DiagGroup<"serialized-diagnostics">;
1026
1027// A warning group for warnings about code that clang accepts when
1028// compiling CUDA C/C++ but which is not compatible with the CUDA spec.
1029def CudaCompat : DiagGroup<"cuda-compat">;
1030
1031// A warning group for things that will change semantics in the future.
1032def FutureCompat : DiagGroup<"future-compat">;
1033
1034def InvalidOrNonExistentDirectory : DiagGroup<"invalid-or-nonexistent-directory">;
1035
1036def OptionIgnored : DiagGroup<"option-ignored">;
1037
1038def UnknownArgument : DiagGroup<"unknown-argument">;
1039
1040// A warning group for warnings about code that clang accepts when
1041// compiling OpenCL C/C++ but which is not compatible with the SPIR spec.
1042def SpirCompat : DiagGroup<"spir-compat">;
1043
1044// Warning for the experimental-isel options.
1045def ExperimentalISel : DiagGroup<"experimental-isel">;
1046
1047// A warning group specifically for warnings related to function
1048// multiversioning.
1049def FunctionMultiVersioning : DiagGroup<"function-multiversion">;
1050
1051def NoDeref : DiagGroup<"noderef">;
1052
1053// A group for cross translation unit static analysis related warnings.
1054def CrossTU : DiagGroup<"ctu">;
1055
1056def CTADMaybeUnsupported : DiagGroup<"ctad-maybe-unsupported">;
1057
1058def FortifySource : DiagGroup<"fortify-source">;
1059