1 //==--- DiagnosticGroups.td - Diagnostic Group Definitions ----------------===//
3 // The LLVM Compiler Infrastructure
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
8 //===----------------------------------------------------------------------===//
10 def ImplicitFunctionDeclare : DiagGroup<"implicit-function-declaration">;
11 def ImplicitInt : DiagGroup<"implicit-int">;
13 // Aggregation warning settings.
14 def Implicit : DiagGroup<"implicit", [
15 ImplicitFunctionDeclare,
19 // Empty DiagGroups are recognized by clang but ignored.
20 def : DiagGroup<"abi">;
21 def : DiagGroup<"address">;
22 def AddressOfTemporary : DiagGroup<"address-of-temporary">;
23 def : DiagGroup<"aggregate-return">;
24 def AmbigMemberTemplate : DiagGroup<"ambiguous-member-template">;
25 def : DiagGroup<"attributes">;
26 def : DiagGroup<"bad-function-cast">;
27 def Availability : DiagGroup<"availability">;
28 def BoolConversions : DiagGroup<"bool-conversions">;
29 def CXXCompat: DiagGroup<"c++-compat">;
30 def CastAlign : DiagGroup<"cast-align">;
31 def : DiagGroup<"cast-qual">;
32 def : DiagGroup<"char-align">;
33 def Comment : DiagGroup<"comment">;
34 def : DiagGroup<"ctor-dtor-privacy">;
35 def : DiagGroup<"declaration-after-statement">;
36 def DefaultArgSpecialMember : DiagGroup<"default-arg-special-member">;
37 def GNUDesignator : DiagGroup<"gnu-designator">;
39 def DeleteNonVirtualDtor : DiagGroup<"delete-non-virtual-dtor">;
41 def DeprecatedDeclarations : DiagGroup<"deprecated-declarations">;
42 def DeprecatedWritableStr : DiagGroup<"deprecated-writable-strings">;
43 def Deprecated : DiagGroup<"deprecated", [ DeprecatedDeclarations] >,
44 DiagCategory<"Deprecations">;
46 def DeprecatedImplementations :DiagGroup<"deprecated-implementations">;
48 def : DiagGroup<"disabled-optimization">;
49 def : DiagGroup<"discard-qual">;
50 def : DiagGroup<"div-by-zero">;
51 def EmptyBody : DiagGroup<"empty-body">;
52 def ExtraTokens : DiagGroup<"extra-tokens">;
54 def FormatExtraArgs : DiagGroup<"format-extra-args">;
55 def FormatZeroLength : DiagGroup<"format-zero-length">;
57 def CXX98Compat : DiagGroup<"c++98-compat">;
58 // Warnings for C++11 features which are Extensions in C++98 mode.
59 def CXX98CompatPedantic : DiagGroup<"c++98-compat-pedantic", [CXX98Compat]>;
61 def CXX11Narrowing : DiagGroup<"c++11-narrowing">;
62 def : DiagGroup<"c++0x-narrowing", [CXX11Narrowing]>;
64 def CXX11Compat : DiagGroup<"c++11-compat", [CXX11Narrowing]>;
65 def : DiagGroup<"c++0x-compat", [CXX11Compat]>;
67 def : DiagGroup<"effc++">;
68 def ExitTimeDestructors : DiagGroup<"exit-time-destructors">;
69 def FourByteMultiChar : DiagGroup<"four-char-constants">;
70 def GlobalConstructors : DiagGroup<"global-constructors">;
71 def : DiagGroup<"idiomatic-parentheses">;
72 def BitwiseOpParentheses: DiagGroup<"bitwise-op-parentheses">;
73 def LogicalOpParentheses: DiagGroup<"logical-op-parentheses">;
74 def IgnoredQualifiers : DiagGroup<"ignored-qualifiers">;
75 def : DiagGroup<"import">;
76 def IncompatiblePointerTypes : DiagGroup<"incompatible-pointer-types">;
77 def : DiagGroup<"init-self">;
78 def : DiagGroup<"inline">;
79 def : DiagGroup<"int-to-pointer-cast">;
80 def : DiagGroup<"invalid-pch">;
81 def LiteralRange : DiagGroup<"literal-range">;
82 def LocalTypeTemplateArgs : DiagGroup<"local-type-template-args">;
83 def MalformedWarningCheck : DiagGroup<"malformed-warning-check">;
84 def Main : DiagGroup<"main">;
85 def MissingBraces : DiagGroup<"missing-braces">;
86 def MissingDeclarations: DiagGroup<"missing-declarations">;
87 def : DiagGroup<"missing-format-attribute">;
88 def : DiagGroup<"missing-include-dirs">;
89 def : DiagGroup<"missing-noreturn">;
90 def MultiChar : DiagGroup<"multichar">;
91 def : DiagGroup<"nested-externs">;
92 def : DiagGroup<"newline-eof">;
93 def LongLong : DiagGroup<"long-long">;
94 def MismatchedTags : DiagGroup<"mismatched-tags">;
95 def MissingFieldInitializers : DiagGroup<"missing-field-initializers">;
96 def ModuleBuild : DiagGroup<"module-build">;
97 def NullDereference : DiagGroup<"null-dereference">;
98 def InitializerOverrides : DiagGroup<"initializer-overrides">;
99 def NonNull : DiagGroup<"nonnull">;
100 def : DiagGroup<"nonportable-cfstrings">;
101 def NonVirtualDtor : DiagGroup<"non-virtual-dtor">;
102 def : DiagGroup<"old-style-cast">;
103 def : DiagGroup<"old-style-definition">;
104 def OutOfLineDeclaration : DiagGroup<"out-of-line-declaration">;
105 def : DiagGroup<"overflow">;
106 def OverlengthStrings : DiagGroup<"overlength-strings">;
107 def OverloadedVirtual : DiagGroup<"overloaded-virtual">;
108 def ObjCMissingSuperCalls : DiagGroup<"objc-missing-super-calls">;
109 def ObjCRetainBlockProperty : DiagGroup<"objc-noncopy-retain-block-property">;
110 def ObjCContinuationPropertyType :DiagGroup<"objc-continuation-property-type">;
111 def Packed : DiagGroup<"packed">;
112 def Padded : DiagGroup<"padded">;
113 def PointerArith : DiagGroup<"pointer-arith">;
114 def PoundWarning : DiagGroup<"#warnings">,
115 DiagCategory<"#warning Directive">;
116 def PoundPragmaMessage : DiagGroup<"#pragma messages">,
117 DiagCategory<"#pragma message Directive">;
118 def : DiagGroup<"pointer-to-int-cast">;
119 def : DiagGroup<"redundant-decls">;
120 def ReturnType : DiagGroup<"return-type">;
121 def BindToTemporaryCopy : DiagGroup<"bind-to-temporary-copy">;
122 def SelfAssignment : DiagGroup<"self-assign">;
123 def SemiBeforeMethodBody : DiagGroup<"semicolon-before-method-body">;
124 def Sentinel : DiagGroup<"sentinel">;
125 def MissingMethodReturnType : DiagGroup<"missing-method-return-type">;
126 def : DiagGroup<"sequence-point">;
127 def Shadow : DiagGroup<"shadow">;
128 def : DiagGroup<"shorten-64-to-32">;
129 def : DiagGroup<"sign-promo">;
130 def SignCompare : DiagGroup<"sign-compare">;
131 def : DiagGroup<"stack-protector">;
132 def : DiagGroup<"switch-default">;
133 def : DiagGroup<"synth">;
134 def SizeofArrayArgument : DiagGroup<"sizeof-array-argument">;
135 def TautologicalCompare : DiagGroup<"tautological-compare">;
136 def HeaderHygiene : DiagGroup<"header-hygiene">;
138 // Preprocessor warnings.
139 def : DiagGroup<"builtin-macro-redefined">;
141 // Just silence warnings about -Wstrict-aliasing for now.
142 def : DiagGroup<"strict-aliasing=0">;
143 def : DiagGroup<"strict-aliasing=1">;
144 def : DiagGroup<"strict-aliasing=2">;
145 def : DiagGroup<"strict-aliasing">;
147 // Just silence warnings about -Wstrict-overflow for now.
148 def : DiagGroup<"strict-overflow=0">;
149 def : DiagGroup<"strict-overflow=1">;
150 def : DiagGroup<"strict-overflow=2">;
151 def : DiagGroup<"strict-overflow=3">;
152 def : DiagGroup<"strict-overflow=4">;
153 def : DiagGroup<"strict-overflow=5">;
154 def : DiagGroup<"strict-overflow">;
156 def InvalidOffsetof : DiagGroup<"invalid-offsetof">;
157 def : DiagGroup<"strict-prototypes">;
158 def StrictSelector : DiagGroup<"strict-selector-match">;
159 def SwitchEnum : DiagGroup<"switch-enum">;
160 def Switch : DiagGroup<"switch", [SwitchEnum]>;
161 def Trigraphs : DiagGroup<"trigraphs">;
163 def : DiagGroup<"type-limits">;
164 def Uninitialized : DiagGroup<"uninitialized">;
165 def UninitializedMaybe : DiagGroup<"conditional-uninitialized">;
166 def UnknownPragmas : DiagGroup<"unknown-pragmas">;
167 def UnknownAttributes : DiagGroup<"attributes">;
168 def UnnamedTypeTemplateArgs : DiagGroup<"unnamed-type-template-args">;
169 def UnusedArgument : DiagGroup<"unused-argument">;
170 def UnusedComparison : DiagGroup<"unused-comparison">;
171 def UnusedExceptionParameter : DiagGroup<"unused-exception-parameter">;
172 def UnneededInternalDecl : DiagGroup<"unneeded-internal-declaration">;
173 def UnneededMemberFunction : DiagGroup<"unneeded-member-function">;
174 def UnusedFunction : DiagGroup<"unused-function", [UnneededInternalDecl]>;
175 def UnusedMemberFunction : DiagGroup<"unused-member-function",
176 [UnneededMemberFunction]>;
177 def UnusedLabel : DiagGroup<"unused-label">;
178 def UnusedParameter : DiagGroup<"unused-parameter">;
179 def UnusedResult : DiagGroup<"unused-result">;
180 def UnusedValue : DiagGroup<"unused-value", [UnusedComparison, UnusedResult]>;
181 def UnusedVariable : DiagGroup<"unused-variable">;
182 def UsedButMarkedUnused : DiagGroup<"used-but-marked-unused">;
183 def UserDefinedLiterals : DiagGroup<"user-defined-literals">;
184 def ReadOnlySetterAttrs : DiagGroup<"readonly-setter-attrs">;
185 def Reorder : DiagGroup<"reorder">;
186 def UndeclaredSelector : DiagGroup<"undeclared-selector">;
187 def ImplicitAtomic : DiagGroup<"implicit-atomic-properties">;
188 def CustomAtomic : DiagGroup<"custom-atomic-properties">;
189 def AtomicProperties : DiagGroup<"atomic-properties",
190 [ImplicitAtomic, CustomAtomic]>;
191 def AutomaticReferenceCountingABI : DiagGroup<"arc-abi">;
192 def ARCUnsafeRetainedAssign : DiagGroup<"arc-unsafe-retained-assign">;
193 def ARCRetainCycles : DiagGroup<"arc-retain-cycles">;
194 def ARCNonPodMemAccess : DiagGroup<"arc-non-pod-memaccess">;
195 def AutomaticReferenceCounting : DiagGroup<"arc",
196 [AutomaticReferenceCountingABI,
197 ARCUnsafeRetainedAssign,
199 ARCNonPodMemAccess]>;
200 def Selector : DiagGroup<"selector">;
201 def NonfragileAbi2 : DiagGroup<"nonfragile-abi2">;
202 def Protocol : DiagGroup<"protocol">;
203 def SuperSubClassMismatch : DiagGroup<"super-class-method-mismatch">;
204 def OverridingMethodMismatch : DiagGroup<"overriding-method-mismatch">;
205 def : DiagGroup<"variadic-macros">;
206 def VariadicMacros : DiagGroup<"variadic-macros">;
207 def VectorConversions : DiagGroup<"vector-conversions">; // clang specific
208 def VLA : DiagGroup<"vla">;
209 def VolatileRegisterVar : DiagGroup<"volatile-register-var">;
211 // GCC calls -Wdeprecated-writable-strings -Wwrite-strings.
212 def GCCWriteStrings : DiagGroup<"write-strings" , [DeprecatedWritableStr]>;
214 def CharSubscript : DiagGroup<"char-subscripts">;
215 def LargeByValueCopy : DiagGroup<"large-by-value-copy">;
216 def DuplicateArgDecl : DiagGroup<"duplicate-method-arg">;
218 // Aggregation warning settings.
220 // -Widiomatic-parentheses contains warnings about 'idiomatic'
221 // missing parentheses; it is off by default. We do not include it
222 // in -Wparentheses because most users who use -Wparentheses explicitly
223 // do not want these warnings.
224 def ParenthesesOnEquality : DiagGroup<"parentheses-equality">;
225 def Parentheses : DiagGroup<"parentheses",
226 [LogicalOpParentheses,
227 BitwiseOpParentheses,
228 ParenthesesOnEquality]>;
230 // -Wconversion has its own warnings, but we split a few out for
232 // - some people want just 64-to-32 warnings
233 // - conversion warnings with constant sources are on by default
234 // - conversion warnings for literals are on by default
235 // - bool-to-pointer conversion warnings are on by default
236 def Conversion : DiagGroup<"conversion",
237 [DiagGroup<"shorten-64-to-32">,
238 DiagGroup<"constant-conversion">,
239 DiagGroup<"literal-conversion">,
240 DiagGroup<"string-conversion">,
241 DiagGroup<"sign-conversion">,
243 DiagCategory<"Value Conversion Issue">;
245 def Unused : DiagGroup<"unused",
246 [UnusedArgument, UnusedFunction, UnusedLabel,
247 // UnusedParameter, (matches GCC's behavior)
248 // UnusedMemberFunction, (clean-up llvm before enabling)
249 UnusedValue, UnusedVariable]>,
250 DiagCategory<"Unused Entity Issue">;
253 def FormatInvalidSpecifier : DiagGroup<"format-invalid-specifier">;
254 def FormatSecurity : DiagGroup<"format-security">;
255 def FormatY2K : DiagGroup<"format-y2k">;
256 def Format : DiagGroup<"format",
257 [FormatExtraArgs, FormatZeroLength, NonNull,
258 FormatSecurity, FormatY2K, FormatInvalidSpecifier]>,
259 DiagCategory<"Format String Issue">;
260 def FormatNonLiteral : DiagGroup<"format-nonliteral", [FormatSecurity]>;
261 def Format2 : DiagGroup<"format=2",
262 [FormatNonLiteral, FormatSecurity, FormatY2K]>;
264 def Extra : DiagGroup<"extra", [
265 MissingFieldInitializers,
267 InitializerOverrides,
268 SemiBeforeMethodBody,
269 MissingMethodReturnType,
274 def Most : DiagGroup<"most", [
277 DeleteNonVirtualDtor,
293 ObjCMissingSuperCalls,
297 // Thread Safety warnings
298 def ThreadSafety : DiagGroup<"thread-safety">;
300 // -Wall is -Wmost -Wparentheses -Wtop-level-comparison
301 def : DiagGroup<"all", [Most, Parentheses]>;
304 def : DiagGroup<"", [Extra]>; // -W = -Wextra
305 def : DiagGroup<"endif-labels", [ExtraTokens]>; // -Wendif-labels=-Wendif-tokens
306 def : DiagGroup<"comments", [Comment]>; // -Wcomments = -Wcomment
308 // A warning group for warnings that we want to have on by default in clang,
309 // but which aren't on by default in GCC.
310 def NonGCC : DiagGroup<"non-gcc",
311 [SignCompare, Conversion, LiteralRange]>;
313 // A warning group for warnings about using C++11 features as extensions in
314 // earlier C++ versions.
315 def CXX11 : DiagGroup<"c++11-extensions">;
316 def : DiagGroup<"c++0x-extensions", [CXX11]>;
317 def DelegatingCtorCycles :
318 DiagGroup<"delegating-ctor-cycles">;
320 // A warning group for warnings about using C1X features as extensions.
321 def C1X : DiagGroup<"c1x-extensions">;
323 // A warning group for warnings about GCC extensions.
324 def GNU : DiagGroup<"gnu", [GNUDesignator, VLA]>;
326 // A warning group for warnings about Microsoft extensions.
327 def Microsoft : DiagGroup<"microsoft">;
329 def ObjCNonUnifiedException : DiagGroup<"objc-nonunified-exceptions">;
331 def ObjCProtocolMethodImpl : DiagGroup<"objc-protocol-method-implementation">;