]> CyberLeo.Net >> Repos - FreeBSD/stable/9.git/blob - contrib/llvm/tools/clang/include/clang/Basic/DiagnosticGroups.td
Copy head to stable/9 as part of 9.0-RELEASE release cycle.
[FreeBSD/stable/9.git] / contrib / llvm / tools / clang / include / clang / Basic / DiagnosticGroups.td
1 //==--- DiagnosticGroups.td - Diagnostic Group Definitions ----------------===//
2 //
3 //                     The LLVM Compiler Infrastructure
4 //
5 // This file is distributed under the University of Illinois Open Source
6 // License. See LICENSE.TXT for details.
7 //
8 //===----------------------------------------------------------------------===//
9
10 def ImplicitFunctionDeclare : DiagGroup<"implicit-function-declaration">;
11 def ImplicitInt : DiagGroup<"implicit-int">;
12
13 // Aggregation warning settings.
14 def Implicit : DiagGroup<"implicit", [
15     ImplicitFunctionDeclare,
16     ImplicitInt
17 ]>;
18
19 // Empty DiagGroups are recognized by clang but ignored.
20 def : DiagGroup<"abi">;
21 def : 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">;
38
39 def DeleteNonVirtualDtor : DiagGroup<"delete-non-virtual-dtor">;
40
41 def DeprecatedDeclarations : DiagGroup<"deprecated-declarations">;
42 def DeprecatedWritableStr : DiagGroup<"deprecated-writable-strings">;
43 def Deprecated : DiagGroup<"deprecated", [ DeprecatedDeclarations] >,
44                  DiagCategory<"Deprecations">;
45
46 def DeprecatedImplementations :DiagGroup<"deprecated-implementations">;
47
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">;
53
54 def FormatExtraArgs : DiagGroup<"format-extra-args">;
55 def FormatZeroLength : DiagGroup<"format-zero-length">;
56
57 def CXXHexFloats : DiagGroup<"c++-hex-floats">;
58
59 def : DiagGroup<"c++0x-compat", [CXXHexFloats]>;
60 def : DiagGroup<"effc++">;
61 def ExitTimeDestructors : DiagGroup<"exit-time-destructors">;
62 def FourByteMultiChar : DiagGroup<"four-char-constants">;
63 def GlobalConstructors : DiagGroup<"global-constructors">;
64 def : DiagGroup<"idiomatic-parentheses">;
65 def BitwiseOpParentheses: DiagGroup<"bitwise-op-parentheses">;
66 def LogicalOpParentheses: DiagGroup<"logical-op-parentheses">;
67 def IgnoredQualifiers : DiagGroup<"ignored-qualifiers">;
68 def : DiagGroup<"import">;
69 def : DiagGroup<"init-self">;
70 def : DiagGroup<"inline">;
71 def : DiagGroup<"int-to-pointer-cast">;
72 def : DiagGroup<"invalid-pch">;
73 def LiteralRange : DiagGroup<"literal-range">;
74 def LocalTypeTemplateArgs : DiagGroup<"local-type-template-args">;
75 def : DiagGroup<"main">;
76 def MissingBraces : DiagGroup<"missing-braces">;
77 def MissingDeclarations: DiagGroup<"missing-declarations">;
78 def : DiagGroup<"missing-format-attribute">;
79 def : DiagGroup<"missing-include-dirs">;
80 def : DiagGroup<"missing-noreturn">;
81 def MultiChar : DiagGroup<"multichar">;
82 def : DiagGroup<"nested-externs">;
83 def : DiagGroup<"newline-eof">;
84 def LongLong : DiagGroup<"long-long">;
85 def MismatchedTags : DiagGroup<"mismatched-tags">;
86 def MissingFieldInitializers : DiagGroup<"missing-field-initializers">;
87 def NullDereference : DiagGroup<"null-dereference">;
88 def InitializerOverrides : DiagGroup<"initializer-overrides">;
89 def NonNull : DiagGroup<"nonnull">;
90 def : DiagGroup<"nonportable-cfstrings">;
91 def NonVirtualDtor : DiagGroup<"non-virtual-dtor">;
92 def : DiagGroup<"old-style-cast">;
93 def : DiagGroup<"old-style-definition">;
94 def OutOfLineDeclaration : DiagGroup<"out-of-line-declaration">;
95 def : DiagGroup<"overflow">;
96 def OverlengthStrings : DiagGroup<"overlength-strings">;
97 def OverloadedVirtual : DiagGroup<"overloaded-virtual">;
98 def Packed : DiagGroup<"packed">;
99 def Padded : DiagGroup<"padded">;
100 def PointerArith : DiagGroup<"pointer-arith">;
101 def PoundWarning : DiagGroup<"#warnings">,
102                    DiagCategory<"#warning Directive">;
103 def PoundPragmaMessage : DiagGroup<"#pragma messages">,
104                          DiagCategory<"#pragma message Directive">;
105 def : DiagGroup<"pointer-to-int-cast">;
106 def : DiagGroup<"redundant-decls">;
107 def ReturnType : DiagGroup<"return-type">;
108 def BindToTemporaryCopy : DiagGroup<"bind-to-temporary-copy">;
109 def SelfAssignment : DiagGroup<"self-assign">;
110 def SemiBeforeMethodBody : DiagGroup<"semicolon-before-method-body">;
111 def : DiagGroup<"sequence-point">;
112 def Shadow : DiagGroup<"shadow">;
113 def : DiagGroup<"shorten-64-to-32">;
114 def : DiagGroup<"sign-promo">;
115 def SignCompare : DiagGroup<"sign-compare">;
116 def : DiagGroup<"stack-protector">;
117 def : DiagGroup<"switch-default">;
118 def : DiagGroup<"synth">;
119 def SizeofArrayArgument : DiagGroup<"sizeof-array-argument">;
120 def TautologicalCompare : DiagGroup<"tautological-compare">;
121 def HeaderHygiene : DiagGroup<"header-hygiene">;
122
123 // Preprocessor warnings.
124 def : DiagGroup<"builtin-macro-redefined">;
125
126 // Just silence warnings about -Wstrict-aliasing for now.
127 def : DiagGroup<"strict-aliasing=0">;
128 def : DiagGroup<"strict-aliasing=1">;
129 def : DiagGroup<"strict-aliasing=2">;
130 def : DiagGroup<"strict-aliasing">;
131
132 // Just silence warnings about -Wstrict-overflow for now.
133 def : DiagGroup<"strict-overflow=0">;
134 def : DiagGroup<"strict-overflow=1">;
135 def : DiagGroup<"strict-overflow=2">;
136 def : DiagGroup<"strict-overflow=3">;
137 def : DiagGroup<"strict-overflow=4">;
138 def : DiagGroup<"strict-overflow=5">;
139 def : DiagGroup<"strict-overflow">;
140
141 def InvalidOffsetof : DiagGroup<"invalid-offsetof">;
142 def : DiagGroup<"strict-prototypes">;
143 def StrictSelector : DiagGroup<"strict-selector-match">;
144 def SwitchEnum     : DiagGroup<"switch-enum">;
145 def Switch         : DiagGroup<"switch", [SwitchEnum]>;
146 def Trigraphs      : DiagGroup<"trigraphs">;
147
148 def : DiagGroup<"type-limits">;
149 def Uninitialized  : DiagGroup<"uninitialized">;
150 def UninitializedMaybe : DiagGroup<"conditional-uninitialized">;
151 def UnknownPragmas : DiagGroup<"unknown-pragmas">;
152 def UnknownAttributes : DiagGroup<"attributes">;
153 def UnnamedTypeTemplateArgs : DiagGroup<"unnamed-type-template-args">;
154 def UnusedArgument : DiagGroup<"unused-argument">;
155 def UnusedExceptionParameter : DiagGroup<"unused-exception-parameter">;
156 def UnneededInternalDecl : DiagGroup<"unneeded-internal-declaration">;
157 def UnneededMemberFunction : DiagGroup<"unneeded-member-function">;
158 def UnusedFunction : DiagGroup<"unused-function", [UnneededInternalDecl]>;
159 def UnusedMemberFunction : DiagGroup<"unused-member-function",
160                                      [UnneededMemberFunction]>;
161 def UnusedLabel : DiagGroup<"unused-label">;
162 def UnusedParameter : DiagGroup<"unused-parameter">;
163 def UnusedValue    : DiagGroup<"unused-value">;
164 def UnusedVariable : DiagGroup<"unused-variable">;
165 def UsedButMarkedUnused : DiagGroup<"used-but-marked-unused">;
166 def ReadOnlySetterAttrs : DiagGroup<"readonly-setter-attrs">;
167 def Reorder : DiagGroup<"reorder">;
168 def UndeclaredSelector : DiagGroup<"undeclared-selector">;
169 def ImplicitAtomic : DiagGroup<"implicit-atomic-properties">;
170 def CustomAtomic : DiagGroup<"custom-atomic-properties">;
171 def AtomicProperties : DiagGroup<"atomic-properties",
172                                  [ImplicitAtomic, CustomAtomic]>;
173 def AutomaticReferenceCountingABI : DiagGroup<"arc-abi">;
174 def ARCUnsafeRetainedAssign : DiagGroup<"arc-unsafe-retained-assign">;
175 def ARCRetainCycles : DiagGroup<"arc-retain-cycles">;
176 def ARCNonPodMemAccess : DiagGroup<"arc-non-pod-memaccess">;
177 def AutomaticReferenceCounting : DiagGroup<"arc",
178                                            [AutomaticReferenceCountingABI,
179                                             ARCUnsafeRetainedAssign,
180                                             ARCRetainCycles,
181                                             ARCNonPodMemAccess]>;
182 def Selector : DiagGroup<"selector">;
183 def NonfragileAbi2 : DiagGroup<"nonfragile-abi2">;
184 def Protocol : DiagGroup<"protocol">;
185 def SuperSubClassMismatch : DiagGroup<"super-class-method-mismatch">;
186 def : DiagGroup<"variadic-macros">;
187 def VariadicMacros : DiagGroup<"variadic-macros">;
188 def VectorConversions : DiagGroup<"vector-conversions">;      // clang specific
189 def VLA : DiagGroup<"vla">;
190 def VolatileRegisterVar : DiagGroup<"volatile-register-var">;
191
192 // GCC calls -Wdeprecated-writable-strings -Wwrite-strings.
193 def GCCWriteStrings : DiagGroup<"write-strings" , [DeprecatedWritableStr]>;
194
195 def CharSubscript : DiagGroup<"char-subscripts">;
196 def LargeByValueCopy : DiagGroup<"large-by-value-copy">;
197 def DuplicateArgDecl : DiagGroup<"duplicate-method-arg">;
198
199 // Aggregation warning settings.
200
201 // -Widiomatic-parentheses contains warnings about 'idiomatic'
202 // missing parentheses;  it is off by default.  We do not include it
203 // in -Wparentheses because most users who use -Wparentheses explicitly
204 // do not want these warnings.
205 def Parentheses : DiagGroup<"parentheses",
206                             [LogicalOpParentheses,
207                              BitwiseOpParentheses]>;
208
209 // -Wconversion has its own warnings, but we split a few out for
210 // legacy reasons:
211 //   - some people want just 64-to-32 warnings
212 //   - conversion warnings with constant sources are on by default
213 //   - conversion warnings for literals are on by default
214 //   - bool-to-pointer conversion warnings are on by default
215 def Conversion : DiagGroup<"conversion",
216                            [DiagGroup<"shorten-64-to-32">,
217                             DiagGroup<"constant-conversion">,
218                             DiagGroup<"literal-conversion">,
219                             DiagGroup<"sign-conversion">,
220                             BoolConversions]>,
221                  DiagCategory<"Value Conversion Issue">;
222
223 def Unused : DiagGroup<"unused",
224                        [UnusedArgument, UnusedFunction, UnusedLabel,
225                         // UnusedParameter, (matches GCC's behavior)
226                         // UnusedMemberFunction, (clean-up llvm before enabling)
227                         UnusedValue, UnusedVariable]>,
228                         DiagCategory<"Unused Entity Issue">;
229
230 // Format settings.
231 def FormatSecurity : DiagGroup<"format-security">;
232 def FormatY2K : DiagGroup<"format-y2k">;
233 def Format : DiagGroup<"format",
234                        [FormatExtraArgs, FormatZeroLength, NonNull,
235                         FormatSecurity, FormatY2K]>,
236              DiagCategory<"Format String Issue">;
237 def FormatNonLiteral : DiagGroup<"format-nonliteral", [FormatSecurity]>;
238 def Format2 : DiagGroup<"format=2",
239                         [FormatNonLiteral, FormatSecurity, FormatY2K]>;
240
241 def Extra : DiagGroup<"extra", [
242     MissingFieldInitializers,
243     IgnoredQualifiers,
244     InitializerOverrides,
245     SemiBeforeMethodBody,
246     SignCompare,
247     UnusedParameter
248   ]>;
249
250 def Most : DiagGroup<"most", [
251     CharSubscript,
252     Comment,
253     DeleteNonVirtualDtor,
254     Format,
255     Implicit,
256     MismatchedTags,
257     MissingBraces,
258     MultiChar,
259     Reorder,
260     ReturnType,
261     SelfAssignment,
262     Switch,
263     SizeofArrayArgument,
264     Trigraphs,
265     Uninitialized,
266     UnknownPragmas,
267     Unused,
268     VectorConversions,
269     VolatileRegisterVar,
270     OverloadedVirtual
271  ]>;
272
273 // -Wall is -Wmost -Wparentheses
274 def : DiagGroup<"all", [Most, Parentheses]>;
275
276 // Aliases.
277 def : DiagGroup<"", [Extra]>;                   // -W = -Wextra
278 def : DiagGroup<"endif-labels", [ExtraTokens]>; // -Wendif-labels=-Wendif-tokens
279 def : DiagGroup<"comments", [Comment]>;         // -Wcomments = -Wcomment
280
281 // A warning group for warnings that we want to have on by default in clang,
282 // but which aren't on by default in GCC.
283 def NonGCC : DiagGroup<"non-gcc",
284     [SignCompare, Conversion, LiteralRange]>;
285
286 // A warning group for warnings about using C++0x features as extensions in
287 // earlier C++ versions.
288 def CXX0xStaticNonIntegralInitializer :
289   DiagGroup<"c++0x-static-nonintegral-init">;
290 def CXX0x : DiagGroup<"c++0x-extensions", [CXX0xStaticNonIntegralInitializer]>;
291 def DelegatingCtorCycles :
292   DiagGroup<"delegating-ctor-cycles">;
293
294 // A warning group for warnings about GCC extensions.
295 def GNU : DiagGroup<"gnu", [GNUDesignator, VLA]>;
296
297 // A warning group for warnings about Microsoft extensions.
298 def Microsoft : DiagGroup<"microsoft">;
299
300 def ObjCNonUnifiedException : DiagGroup<"objc-nonunified-exceptions">;
301