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