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