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