DiagnosticGroups.td 66 KB

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