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