Home | History | Annotate | Download | only in Basic
      1 //==--- DiagnosticGroups.td - Diagnostic Group Definitions ----------------===//
      2 //
      3 //                     The LLVM Compiler Infrastructure
      4 //
      5 // This file is distributed under the University of Illinois Open Source
      6 // License. See LICENSE.TXT for details.
      7 //
      8 //===----------------------------------------------------------------------===//
      9 
     10 def ImplicitFunctionDeclare : DiagGroup<"implicit-function-declaration">;
     11 def ImplicitInt : DiagGroup<"implicit-int">;
     12 
     13 // Aggregation warning settings.
     14 def Implicit : DiagGroup<"implicit", [
     15     ImplicitFunctionDeclare,
     16     ImplicitInt
     17 ]>;
     18 
     19 // Empty DiagGroups are recognized by clang but ignored.
     20 def : DiagGroup<"abi">;
     21 def AbsoluteValue : DiagGroup<"absolute-value">;
     22 def AddressOfTemporary : DiagGroup<"address-of-temporary">;
     23 def : DiagGroup<"aggregate-return">;
     24 def GNUAlignofExpression : DiagGroup<"gnu-alignof-expression">;
     25 def AmbigMemberTemplate : DiagGroup<"ambiguous-member-template">;
     26 def GNUAnonymousStruct : DiagGroup<"gnu-anonymous-struct">;
     27 def ArrayBounds : DiagGroup<"array-bounds">;
     28 def ArrayBoundsPointerArithmetic : DiagGroup<"array-bounds-pointer-arithmetic">;
     29 def Availability : DiagGroup<"availability">;
     30 def Section : DiagGroup<"section">;
     31 def AutoImport : DiagGroup<"auto-import">;
     32 def GNUBinaryLiteral : DiagGroup<"gnu-binary-literal">;
     33 def GNUCompoundLiteralInitializer : DiagGroup<"gnu-compound-literal-initializer">;
     34 def BitFieldConstantConversion : DiagGroup<"bitfield-constant-conversion">;
     35 def ConstantConversion :
     36   DiagGroup<"constant-conversion", [ BitFieldConstantConversion ] >;
     37 def LiteralConversion : DiagGroup<"literal-conversion">;
     38 def StringConversion : DiagGroup<"string-conversion">;
     39 def SignConversion : DiagGroup<"sign-conversion">;
     40 def PointerBoolConversion : DiagGroup<"pointer-bool-conversion">;
     41 def UndefinedBoolConversion : DiagGroup<"undefined-bool-conversion">;
     42 def BoolConversion : DiagGroup<"bool-conversion", [PointerBoolConversion,
     43                                                    UndefinedBoolConversion]>;
     44 def IntConversion : DiagGroup<"int-conversion">;
     45 def EnumConversion : DiagGroup<"enum-conversion">;
     46 def FloatConversion : DiagGroup<"float-conversion">;
     47 def EnumTooLarge : DiagGroup<"enum-too-large">;
     48 def UnsupportedNan : DiagGroup<"unsupported-nan">;
     49 def NonLiteralNullConversion : DiagGroup<"non-literal-null-conversion">;
     50 def NullConversion : DiagGroup<"null-conversion">;
     51 def ImplicitConversionFloatingPointToBool :
     52   DiagGroup<"implicit-conversion-floating-point-to-bool">;
     53 def ObjCLiteralConversion : DiagGroup<"objc-literal-conversion">;
     54 def BadArrayNewLength : DiagGroup<"bad-array-new-length">;
     55 def MacroRedefined : DiagGroup<"macro-redefined">;
     56 def BuiltinMacroRedefined : DiagGroup<"builtin-macro-redefined">;
     57 def BuiltinRequiresHeader : DiagGroup<"builtin-requires-header">;
     58 def C99Compat : DiagGroup<"c99-compat">;
     59 def CXXCompat: DiagGroup<"c++-compat">;
     60 def ExternCCompat : DiagGroup<"extern-c-compat">;
     61 def KeywordCompat : DiagGroup<"keyword-compat">;
     62 def GNUCaseRange : DiagGroup<"gnu-case-range">;
     63 def CastAlign : DiagGroup<"cast-align">;
     64 def CastQual : DiagGroup<"cast-qual">;
     65 def : DiagGroup<"char-align">;
     66 def Comment : DiagGroup<"comment">;
     67 def GNUComplexInteger : DiagGroup<"gnu-complex-integer">;
     68 def GNUConditionalOmittedOperand : DiagGroup<"gnu-conditional-omitted-operand">;
     69 def ConfigMacros : DiagGroup<"config-macros">;
     70 def : DiagGroup<"ctor-dtor-privacy">;
     71 def GNUDesignator : DiagGroup<"gnu-designator">;
     72 def GNUStringLiteralOperatorTemplate :
     73   DiagGroup<"gnu-string-literal-operator-template">;
     74 
     75 def DeleteIncomplete : DiagGroup<"delete-incomplete">;
     76 def DeleteNonVirtualDtor : DiagGroup<"delete-non-virtual-dtor">;
     77 def AbstractFinalClass : DiagGroup<"abstract-final-class">;
     78 
     79 def CXX11CompatDeprecatedWritableStr :
     80   DiagGroup<"c++11-compat-deprecated-writable-strings">;
     81 
     82 def DeprecatedDeclarations : DiagGroup<"deprecated-declarations">;
     83 def UnavailableDeclarations : DiagGroup<"unavailable-declarations">;
     84 def PartialAvailability : DiagGroup<"partial-availability">;
     85 def DeprecatedImplementations :DiagGroup<"deprecated-implementations">;
     86 def DeprecatedIncrementBool : DiagGroup<"deprecated-increment-bool">;
     87 def DeprecatedRegister : DiagGroup<"deprecated-register">;
     88 def DeprecatedWritableStr : DiagGroup<"deprecated-writable-strings",
     89                                       [CXX11CompatDeprecatedWritableStr]>;
     90 // FIXME: Why is DeprecatedImplementations not in this group?
     91 def Deprecated : DiagGroup<"deprecated", [DeprecatedDeclarations,
     92                                           DeprecatedIncrementBool,
     93                                           DeprecatedRegister,
     94                                           DeprecatedWritableStr]>,
     95                  DiagCategory<"Deprecations">;
     96 
     97 def : DiagGroup<"disabled-optimization">;
     98 def : DiagGroup<"discard-qual">;
     99 def : DiagGroup<"div-by-zero">;
    100 
    101 def DocumentationHTML : DiagGroup<"documentation-html">;
    102 def DocumentationUnknownCommand : DiagGroup<"documentation-unknown-command">;
    103 def DocumentationPedantic : DiagGroup<"documentation-pedantic",
    104                                       [DocumentationUnknownCommand]>;
    105 def DocumentationDeprecatedSync : DiagGroup<"documentation-deprecated-sync">;
    106 def Documentation : DiagGroup<"documentation",
    107                               [DocumentationHTML,
    108                                DocumentationDeprecatedSync]>;
    109 
    110 def EmptyBody : DiagGroup<"empty-body">;
    111 def Exceptions : DiagGroup<"exceptions">;
    112 
    113 def GNUEmptyInitializer : DiagGroup<"gnu-empty-initializer">;
    114 def GNUEmptyStruct : DiagGroup<"gnu-empty-struct">;
    115 def ExtraTokens : DiagGroup<"extra-tokens">;
    116 def CXX11ExtraSemi : DiagGroup<"c++11-extra-semi">;
    117 def ExtraSemi : DiagGroup<"extra-semi", [CXX11ExtraSemi]>;
    118 
    119 def GNUFlexibleArrayInitializer : DiagGroup<"gnu-flexible-array-initializer">;
    120 def GNUFlexibleArrayUnionMember : DiagGroup<"gnu-flexible-array-union-member">;
    121 def GNUFoldingConstant : DiagGroup<"gnu-folding-constant">;
    122 def FormatExtraArgs : DiagGroup<"format-extra-args">;
    123 def FormatZeroLength : DiagGroup<"format-zero-length">;
    124 
    125 // Warnings for C++1y code which is not compatible with prior C++ standards.
    126 def CXXPre14Compat : DiagGroup<"c++98-c++11-compat">;
    127 def CXXPre14CompatPedantic : DiagGroup<"c++98-c++11-compat-pedantic",
    128                                        [CXXPre14Compat]>;
    129 def CXXPre1zCompat : DiagGroup<"c++98-c++11-c++14-compat">;
    130 def CXXPre1zCompatPedantic : DiagGroup<"c++98-c++11-c++14-compat-pedantic",
    131                                        [CXXPre1zCompat]>;
    132 
    133 def CXX98CompatBindToTemporaryCopy :
    134   DiagGroup<"c++98-compat-bind-to-temporary-copy">;
    135 def CXX98CompatLocalTypeTemplateArgs :
    136   DiagGroup<"c++98-compat-local-type-template-args">;
    137 def CXX98CompatUnnamedTypeTemplateArgs :
    138   DiagGroup<"c++98-compat-unnamed-type-template-args">;
    139 
    140 def CXX98Compat : DiagGroup<"c++98-compat",
    141                             [CXX98CompatLocalTypeTemplateArgs,
    142                              CXX98CompatUnnamedTypeTemplateArgs,
    143                              CXXPre14Compat,
    144                              CXXPre1zCompat]>;
    145 // Warnings for C++11 features which are Extensions in C++98 mode.
    146 def CXX98CompatPedantic : DiagGroup<"c++98-compat-pedantic",
    147                                     [CXX98Compat,
    148                                      CXX98CompatBindToTemporaryCopy,
    149                                      CXXPre14CompatPedantic,
    150                                      CXXPre1zCompatPedantic]>;
    151 
    152 def CXX11Narrowing : DiagGroup<"c++11-narrowing">;
    153 
    154 def CXX11WarnOverrideMethod : DiagGroup<"inconsistent-missing-override">;
    155 
    156 // Original name of this warning in Clang
    157 def : DiagGroup<"c++0x-narrowing", [CXX11Narrowing]>;
    158 
    159 // Name of this warning in GCC
    160 def : DiagGroup<"narrowing", [CXX11Narrowing]>;
    161 
    162 def CXX11CompatReservedUserDefinedLiteral :
    163   DiagGroup<"c++11-compat-reserved-user-defined-literal">;
    164 def ReservedUserDefinedLiteral :
    165   DiagGroup<"reserved-user-defined-literal",
    166             [CXX11CompatReservedUserDefinedLiteral]>;
    167 
    168 def CXX11Compat : DiagGroup<"c++11-compat",
    169                             [CXX11Narrowing,
    170                              CXX11CompatReservedUserDefinedLiteral,
    171                              CXX11CompatDeprecatedWritableStr,
    172                              CXXPre14Compat,
    173                              CXXPre1zCompat]>;
    174 def : DiagGroup<"c++0x-compat", [CXX11Compat]>;
    175 def CXX11CompatPedantic : DiagGroup<"c++11-compat-pedantic",
    176                                     [CXXPre14CompatPedantic,
    177                                      CXXPre1zCompatPedantic]>;
    178 
    179 def CXX14Compat : DiagGroup<"c++14-compat", [CXXPre1zCompat]>;
    180 def CXX14CompatPedantic : DiagGroup<"c++14-compat-pedantic",
    181                                     [CXXPre1zCompatPedantic]>;
    182 
    183 def : DiagGroup<"effc++">;
    184 def DivZero : DiagGroup<"division-by-zero">;
    185 def ExitTimeDestructors : DiagGroup<"exit-time-destructors">;
    186 def FlexibleArrayExtensions : DiagGroup<"flexible-array-extensions">;
    187 def FourByteMultiChar : DiagGroup<"four-char-constants">;
    188 def GlobalConstructors : DiagGroup<"global-constructors">;
    189 def BitwiseOpParentheses: DiagGroup<"bitwise-op-parentheses">;
    190 def LogicalOpParentheses: DiagGroup<"logical-op-parentheses">;
    191 def LogicalNotParentheses: DiagGroup<"logical-not-parentheses">;
    192 def ShiftOpParentheses: DiagGroup<"shift-op-parentheses">;
    193 def OverloadedShiftOpParentheses: DiagGroup<"overloaded-shift-op-parentheses">;
    194 def DanglingElse: DiagGroup<"dangling-else">;
    195 def DanglingField : DiagGroup<"dangling-field">;
    196 def DistributedObjectModifiers : DiagGroup<"distributed-object-modifiers">;
    197 def FlagEnum : DiagGroup<"flag-enum">;
    198 def InfiniteRecursion : DiagGroup<"infinite-recursion">;
    199 def GNUImaginaryConstant : DiagGroup<"gnu-imaginary-constant">;
    200 def IgnoredQualifiers : DiagGroup<"ignored-qualifiers">;
    201 def : DiagGroup<"import">;
    202 def IncompatibleMSStruct : DiagGroup<"incompatible-ms-struct">;
    203 def IncompatiblePointerTypesDiscardsQualifiers 
    204   : DiagGroup<"incompatible-pointer-types-discards-qualifiers">;
    205 def IncompatiblePointerTypes
    206   : DiagGroup<"incompatible-pointer-types",
    207     [IncompatiblePointerTypesDiscardsQualifiers]>;
    208 def IncompleteUmbrella : DiagGroup<"incomplete-umbrella">;
    209 def NonModularIncludeInFrameworkModule
    210   : DiagGroup<"non-modular-include-in-framework-module">;
    211 def NonModularIncludeInModule : DiagGroup<"non-modular-include-in-module",
    212                                           [NonModularIncludeInFrameworkModule]>;
    213 def IncompleteModule : DiagGroup<"incomplete-module",
    214     [IncompleteUmbrella, NonModularIncludeInModule]>;
    215 
    216 def InvalidNoreturn : DiagGroup<"invalid-noreturn">;
    217 def InvalidSourceEncoding : DiagGroup<"invalid-source-encoding">;
    218 def KNRPromotedParameter : DiagGroup<"knr-promoted-parameter">;
    219 def : DiagGroup<"init-self">;
    220 def : DiagGroup<"inline">;
    221 def : DiagGroup<"invalid-pch">;
    222 def GNULabelsAsValue : DiagGroup<"gnu-label-as-value">;
    223 def LiteralRange : DiagGroup<"literal-range">;
    224 def LocalTypeTemplateArgs : DiagGroup<"local-type-template-args",
    225                                       [CXX98CompatLocalTypeTemplateArgs]>;
    226 def RangeLoopAnalysis : DiagGroup<"range-loop-analysis">;
    227 def ForLoopAnalysis : DiagGroup<"for-loop-analysis">;
    228 def LoopAnalysis : DiagGroup<"loop-analysis", [ForLoopAnalysis,
    229                                                RangeLoopAnalysis]>;
    230 def MalformedWarningCheck : DiagGroup<"malformed-warning-check">;
    231 def Main : DiagGroup<"main">;
    232 def MainReturnType : DiagGroup<"main-return-type">;
    233 def MissingBraces : DiagGroup<"missing-braces">;
    234 def MissingDeclarations: DiagGroup<"missing-declarations">;
    235 def : DiagGroup<"missing-format-attribute">;
    236 def : DiagGroup<"missing-include-dirs">;
    237 def MissingNoreturn : DiagGroup<"missing-noreturn">;
    238 def MultiChar : DiagGroup<"multichar">;
    239 def : DiagGroup<"nested-externs">;
    240 def CXX11LongLong : DiagGroup<"c++11-long-long">;
    241 def LongLong : DiagGroup<"long-long", [CXX11LongLong]>;
    242 def MethodSignatures : DiagGroup<"method-signatures">;
    243 def MismatchedParameterTypes : DiagGroup<"mismatched-parameter-types">;
    244 def MismatchedReturnTypes : DiagGroup<"mismatched-return-types">;
    245 def MismatchedTags : DiagGroup<"mismatched-tags">;
    246 def MissingFieldInitializers : DiagGroup<"missing-field-initializers">;
    247 def ModuleBuild : DiagGroup<"module-build">;
    248 def ModuleConflict : DiagGroup<"module-conflict">;
    249 def NewlineEOF : DiagGroup<"newline-eof">;
    250 def NullArithmetic : DiagGroup<"null-arithmetic">;
    251 def NullCharacter : DiagGroup<"null-character">;
    252 def NullDereference : DiagGroup<"null-dereference">;
    253 def InitializerOverrides : DiagGroup<"initializer-overrides">;
    254 def NonNull : DiagGroup<"nonnull">;
    255 def NonPODVarargs : DiagGroup<"non-pod-varargs">;
    256 def ClassVarargs : DiagGroup<"class-varargs", [NonPODVarargs]>;
    257 def : DiagGroup<"nonportable-cfstrings">;
    258 def NonVirtualDtor : DiagGroup<"non-virtual-dtor">;
    259 def OveralignedType : DiagGroup<"over-aligned">;
    260 def OldStyleCast : DiagGroup<"old-style-cast">;
    261 def : DiagGroup<"old-style-definition">;
    262 def OutOfLineDeclaration : DiagGroup<"out-of-line-declaration">;
    263 def : DiagGroup<"overflow">;
    264 def ForwardClassReceiver : DiagGroup<"receiver-forward-class">;
    265 def MethodAccess : DiagGroup<"objc-method-access">;
    266 def ObjCReceiver : DiagGroup<"receiver-expr">;
    267 def OperatorNewReturnsNull : DiagGroup<"new-returns-null">;
    268 def OverlengthStrings : DiagGroup<"overlength-strings">;
    269 def OverloadedVirtual : DiagGroup<"overloaded-virtual">;
    270 def PrivateExtern : DiagGroup<"private-extern">;
    271 def SelTypeCast : DiagGroup<"cast-of-sel-type">;
    272 def FunctionDefInObjCContainer : DiagGroup<"function-def-in-objc-container">;
    273 def BadFunctionCast : DiagGroup<"bad-function-cast">;
    274 def ObjCPropertyImpl : DiagGroup<"objc-property-implementation">;
    275 def ObjCPropertyNoAttribute : DiagGroup<"objc-property-no-attribute">;
    276 def ObjCMissingSuperCalls : DiagGroup<"objc-missing-super-calls">;
    277 def ObjCDesignatedInit : DiagGroup<"objc-designated-initializers">;
    278 def ObjCRetainBlockProperty : DiagGroup<"objc-noncopy-retain-block-property">;
    279 def ObjCReadonlyPropertyHasSetter : DiagGroup<"objc-readonly-with-setter-property">;
    280 def ObjCInvalidIBOutletProperty : DiagGroup<"invalid-iboutlet">;
    281 def ObjCRootClass : DiagGroup<"objc-root-class">;
    282 def ObjCPointerIntrospectPerformSelector : DiagGroup<"deprecated-objc-pointer-introspection-performSelector">;
    283 def ObjCPointerIntrospect : DiagGroup<"deprecated-objc-pointer-introspection", [ObjCPointerIntrospectPerformSelector]>;
    284 def ObjCMultipleMethodNames : DiagGroup<"objc-multiple-method-names">;
    285 def DeprecatedObjCIsaUsage : DiagGroup<"deprecated-objc-isa-usage">;
    286 def ExplicitInitializeCall : DiagGroup<"explicit-initialize-call">;
    287 def Packed : DiagGroup<"packed">;
    288 def Padded : DiagGroup<"padded">;
    289 def PointerArith : DiagGroup<"pointer-arith">;
    290 def PoundWarning : DiagGroup<"#warnings">;
    291 def PoundPragmaMessage : DiagGroup<"#pragma-messages">,
    292                          DiagCategory<"#pragma message Directive">;
    293 def : DiagGroup<"pointer-to-int-cast">;
    294 def : DiagGroup<"redundant-decls">;
    295 def RedeclaredClassMember : DiagGroup<"redeclared-class-member">;
    296 def GNURedeclaredEnum : DiagGroup<"gnu-redeclared-enum">;
    297 def ReturnStackAddress : DiagGroup<"return-stack-address">;
    298 def ReturnTypeCLinkage : DiagGroup<"return-type-c-linkage">;
    299 def ReturnType : DiagGroup<"return-type", [ReturnTypeCLinkage]>;
    300 def BindToTemporaryCopy : DiagGroup<"bind-to-temporary-copy",
    301                                     [CXX98CompatBindToTemporaryCopy]>;
    302 def SelfAssignmentField : DiagGroup<"self-assign-field">;
    303 def SelfAssignment : DiagGroup<"self-assign", [SelfAssignmentField]>;
    304 def SelfMove : DiagGroup<"self-move">;
    305 def SemiBeforeMethodBody : DiagGroup<"semicolon-before-method-body">;
    306 def Sentinel : DiagGroup<"sentinel">;
    307 def MissingMethodReturnType : DiagGroup<"missing-method-return-type">;
    308 def Shadow : DiagGroup<"shadow">;
    309 def Shorten64To32 : DiagGroup<"shorten-64-to-32">;
    310 def : DiagGroup<"sign-promo">;
    311 def SignCompare : DiagGroup<"sign-compare">;
    312 def : DiagGroup<"stack-protector">;
    313 def : DiagGroup<"switch-default">;
    314 def : DiagGroup<"synth">;
    315 def SizeofArrayArgument : DiagGroup<"sizeof-array-argument">;
    316 def SizeofArrayDecay : DiagGroup<"sizeof-array-decay">;
    317 def SizeofPointerMemaccess : DiagGroup<"sizeof-pointer-memaccess">;
    318 def StaticInInline : DiagGroup<"static-in-inline">;
    319 def StaticLocalInInline : DiagGroup<"static-local-in-inline">;
    320 def GNUStaticFloatInit : DiagGroup<"gnu-static-float-init">;
    321 def StaticFloatInit : DiagGroup<"static-float-init", [GNUStaticFloatInit]>;
    322 def GNUStatementExpression : DiagGroup<"gnu-statement-expression">;
    323 def StringCompare : DiagGroup<"string-compare">;
    324 def StringPlusInt : DiagGroup<"string-plus-int">;
    325 def StringPlusChar : DiagGroup<"string-plus-char">;
    326 def StrncatSize : DiagGroup<"strncat-size">;
    327 def TautologicalOutOfRangeCompare : DiagGroup<"tautological-constant-out-of-range-compare">;
    328 def TautologicalPointerCompare : DiagGroup<"tautological-pointer-compare">;
    329 def TautologicalOverlapCompare : DiagGroup<"tautological-overlap-compare">;
    330 def TautologicalUndefinedCompare : DiagGroup<"tautological-undefined-compare">;
    331 def TautologicalCompare : DiagGroup<"tautological-compare",
    332                                     [TautologicalOutOfRangeCompare,
    333                                      TautologicalPointerCompare,
    334                                      TautologicalOverlapCompare,
    335                                      TautologicalUndefinedCompare]>;
    336 def HeaderHygiene : DiagGroup<"header-hygiene">;
    337 def DuplicateDeclSpecifier : DiagGroup<"duplicate-decl-specifier">;
    338 def CompareDistinctPointerType : DiagGroup<"compare-distinct-pointer-types">;
    339 def GNUUnionCast : DiagGroup<"gnu-union-cast">;
    340 def GNUVariableSizedTypeNotAtEnd : DiagGroup<"gnu-variable-sized-type-not-at-end">;
    341 def Varargs : DiagGroup<"varargs">;
    342 
    343 def Unsequenced : DiagGroup<"unsequenced">;
    344 // GCC name for -Wunsequenced
    345 def : DiagGroup<"sequence-point", [Unsequenced]>;
    346 
    347 // Preprocessor warnings.
    348 def AmbiguousMacro : DiagGroup<"ambiguous-macro">;
    349 def KeywordAsMacro : DiagGroup<"keyword-macro">;
    350 def ReservedIdAsMacro : DiagGroup<"reserved-id-macro">;
    351 
    352 // Just silence warnings about -Wstrict-aliasing for now.
    353 def : DiagGroup<"strict-aliasing=0">;
    354 def : DiagGroup<"strict-aliasing=1">;
    355 def : DiagGroup<"strict-aliasing=2">;
    356 def : DiagGroup<"strict-aliasing">;
    357 
    358 // Just silence warnings about -Wstrict-overflow for now.
    359 def : DiagGroup<"strict-overflow=0">;
    360 def : DiagGroup<"strict-overflow=1">;
    361 def : DiagGroup<"strict-overflow=2">;
    362 def : DiagGroup<"strict-overflow=3">;
    363 def : DiagGroup<"strict-overflow=4">;
    364 def : DiagGroup<"strict-overflow=5">;
    365 def : DiagGroup<"strict-overflow">;
    366 
    367 def InvalidOffsetof : DiagGroup<"invalid-offsetof">;
    368 def : DiagGroup<"strict-prototypes">;
    369 def StrictSelector : DiagGroup<"strict-selector-match">;
    370 def MethodDuplicate : DiagGroup<"duplicate-method-match">;
    371 def ObjCCStringFormat : DiagGroup<"cstring-format-directive">;
    372 def CoveredSwitchDefault : DiagGroup<"covered-switch-default">;
    373 def SwitchBool     : DiagGroup<"switch-bool">;
    374 def SwitchEnum     : DiagGroup<"switch-enum">;
    375 def Switch         : DiagGroup<"switch">;
    376 def ImplicitFallthroughPerFunction :
    377   DiagGroup<"implicit-fallthrough-per-function">;
    378 def ImplicitFallthrough  : DiagGroup<"implicit-fallthrough",
    379                                      [ImplicitFallthroughPerFunction]>;
    380 def InvalidPPToken : DiagGroup<"invalid-pp-token">;
    381 def Trigraphs      : DiagGroup<"trigraphs">;
    382 
    383 def : DiagGroup<"type-limits">;
    384 def UndefinedReinterpretCast : DiagGroup<"undefined-reinterpret-cast">;
    385 def ReinterpretBaseClass : DiagGroup<"reinterpret-base-class">;
    386 def Unicode  : DiagGroup<"unicode">;
    387 def UninitializedMaybe : DiagGroup<"conditional-uninitialized">;
    388 def UninitializedSometimes : DiagGroup<"sometimes-uninitialized">;
    389 def UninitializedStaticSelfInit : DiagGroup<"static-self-init">;
    390 def Uninitialized  : DiagGroup<"uninitialized", [UninitializedSometimes,
    391                                                  UninitializedStaticSelfInit]>;
    392 def UnknownPragmas : DiagGroup<"unknown-pragmas">;
    393 def IgnoredPragmas : DiagGroup<"ignored-pragmas">;
    394 def Pragmas : DiagGroup<"pragmas", [UnknownPragmas, IgnoredPragmas]>;
    395 def UnknownWarningOption : DiagGroup<"unknown-warning-option">;
    396 def NSobjectAttribute : DiagGroup<"NSObject-attribute">;
    397 def IndependentClassAttribute : DiagGroup<"IndependentClass-attribute">;
    398 def UnknownAttributes : DiagGroup<"unknown-attributes">;
    399 def IgnoredAttributes : DiagGroup<"ignored-attributes">;
    400 def Attributes : DiagGroup<"attributes", [UnknownAttributes,
    401                                           IgnoredAttributes]>;
    402 def UnnamedTypeTemplateArgs : DiagGroup<"unnamed-type-template-args",
    403                                         [CXX98CompatUnnamedTypeTemplateArgs]>;
    404 def UnsupportedFriend : DiagGroup<"unsupported-friend">;
    405 def UnusedArgument : DiagGroup<"unused-argument">;
    406 def UnusedCommandLineArgument : DiagGroup<"unused-command-line-argument">;
    407 def IgnoredOptimizationArgument : DiagGroup<"ignored-optimization-argument">;
    408 def InvalidCommandLineArgument : DiagGroup<"invalid-command-line-argument",
    409                                            [IgnoredOptimizationArgument]>;
    410 def UnusedComparison : DiagGroup<"unused-comparison">;
    411 def UnusedExceptionParameter : DiagGroup<"unused-exception-parameter">;
    412 def UnneededInternalDecl : DiagGroup<"unneeded-internal-declaration">;
    413 def UnneededMemberFunction : DiagGroup<"unneeded-member-function">;
    414 def UnusedPrivateField : DiagGroup<"unused-private-field">;
    415 def UnusedFunction : DiagGroup<"unused-function", [UnneededInternalDecl]>;
    416 def UnusedMemberFunction : DiagGroup<"unused-member-function",
    417                                      [UnneededMemberFunction]>;
    418 def UnusedLabel : DiagGroup<"unused-label">;
    419 def UnusedParameter : DiagGroup<"unused-parameter">;
    420 def UnusedResult : DiagGroup<"unused-result">;
    421 def PotentiallyEvaluatedExpression : DiagGroup<"potentially-evaluated-expression">;
    422 def UnevaluatedExpression : DiagGroup<"unevaluated-expression",
    423                                       [PotentiallyEvaluatedExpression]>;
    424 def UnusedValue : DiagGroup<"unused-value", [UnusedComparison, UnusedResult,
    425                                              UnevaluatedExpression]>;
    426 def UnusedConstVariable : DiagGroup<"unused-const-variable">;
    427 def UnusedVariable : DiagGroup<"unused-variable",
    428                                [UnusedConstVariable]>;
    429 def UnusedLocalTypedef : DiagGroup<"unused-local-typedef">;
    430 def UnusedPropertyIvar :  DiagGroup<"unused-property-ivar">;
    431 def UnusedGetterReturnValue : DiagGroup<"unused-getter-return-value">;
    432 def UsedButMarkedUnused : DiagGroup<"used-but-marked-unused">;
    433 def UserDefinedLiterals : DiagGroup<"user-defined-literals">;
    434 def Reorder : DiagGroup<"reorder">;
    435 def UndeclaredSelector : DiagGroup<"undeclared-selector">;
    436 def ImplicitAtomic : DiagGroup<"implicit-atomic-properties">;
    437 def CustomAtomic : DiagGroup<"custom-atomic-properties">;
    438 def AtomicProperties : DiagGroup<"atomic-properties",
    439                                  [ImplicitAtomic, CustomAtomic]>;
    440 def ARCUnsafeRetainedAssign : DiagGroup<"arc-unsafe-retained-assign">;
    441 def ARCRetainCycles : DiagGroup<"arc-retain-cycles">;
    442 def ARCNonPodMemAccess : DiagGroup<"arc-non-pod-memaccess">;
    443 def AutomaticReferenceCounting : DiagGroup<"arc",
    444                                            [ARCUnsafeRetainedAssign,
    445                                             ARCRetainCycles,
    446                                             ARCNonPodMemAccess]>;
    447 def ARCRepeatedUseOfWeakMaybe : DiagGroup<"arc-maybe-repeated-use-of-weak">;
    448 def ARCRepeatedUseOfWeak : DiagGroup<"arc-repeated-use-of-weak",
    449                                      [ARCRepeatedUseOfWeakMaybe]>;
    450 def ObjCBridge : DiagGroup<"bridge-cast">;
    451 
    452 def DeallocInCategory:DiagGroup<"dealloc-in-category">;
    453 def SelectorTypeMismatch : DiagGroup<"selector-type-mismatch">;
    454 def Selector : DiagGroup<"selector", [SelectorTypeMismatch]>;
    455 def Protocol : DiagGroup<"protocol">;
    456 def AtProtocol : DiagGroup<"at-protocol">;
    457 def PropertyAccessDotSyntax: DiagGroup<"property-access-dot-syntax">;
    458 def PropertyAttr : DiagGroup<"property-attribute-mismatch">;
    459 def SuperSubClassMismatch : DiagGroup<"super-class-method-mismatch">;
    460 def OverridingMethodMismatch : DiagGroup<"overriding-method-mismatch">;
    461 def VariadicMacros : DiagGroup<"variadic-macros">;
    462 def VectorConversion : DiagGroup<"vector-conversion">;      // clang specific
    463 def VexingParse : DiagGroup<"vexing-parse">;
    464 def VLA : DiagGroup<"vla">;
    465 def VLAExtension : DiagGroup<"vla-extension">;
    466 def VolatileRegisterVar : DiagGroup<"volatile-register-var">;
    467 def Visibility : DiagGroup<"visibility">;
    468 def ZeroLengthArray : DiagGroup<"zero-length-array">;
    469 def GNUZeroLineDirective : DiagGroup<"gnu-zero-line-directive">;
    470 def GNUZeroVariadicMacroArguments : DiagGroup<"gnu-zero-variadic-macro-arguments">;
    471 def Fallback : DiagGroup<"fallback">;
    472 
    473 // This covers both the deprecated case (in C++98)
    474 // and the extension case (in C++11 onwards).
    475 def WritableStrings : DiagGroup<"writable-strings", [DeprecatedWritableStr]>;
    476 
    477 // GCC calls -Wdeprecated-writable-strings -Wwrite-strings.
    478 //
    479 // Bizarrely, this warning flag enables -fconst-strings in C. This is
    480 // GCC-compatible, but really weird.
    481 //
    482 // FIXME: Should this affect C++11 (where this is an error,
    483 //        not just deprecated) or not?
    484 def GCCWriteStrings : DiagGroup<"write-strings" , [WritableStrings]>;
    485 
    486 def CharSubscript : DiagGroup<"char-subscripts">;
    487 def LargeByValueCopy : DiagGroup<"large-by-value-copy">;
    488 def DuplicateArgDecl : DiagGroup<"duplicate-method-arg">;
    489 
    490 // Unreachable code warning groups.
    491 //
    492 //  The goal is make -Wunreachable-code on by default, in -Wall, or at
    493 //  least actively used, with more noisy versions of the warning covered
    494 //  under separate flags.
    495 //
    496 def UnreachableCodeLoopIncrement : DiagGroup<"unreachable-code-loop-increment">;
    497 def UnreachableCode : DiagGroup<"unreachable-code",
    498                                 [UnreachableCodeLoopIncrement]>;
    499 def UnreachableCodeBreak : DiagGroup<"unreachable-code-break">;
    500 def UnreachableCodeReturn : DiagGroup<"unreachable-code-return">;
    501 def UnreachableCodeAggressive : DiagGroup<"unreachable-code-aggressive",
    502                                     [UnreachableCode,
    503                                      UnreachableCodeBreak,
    504                                      UnreachableCodeReturn]>;
    505 
    506 // Aggregation warning settings.
    507 
    508 // Populate -Waddress with warnings from other groups.
    509 def : DiagGroup<"address", [PointerBoolConversion,
    510                             StringCompare,
    511                             TautologicalPointerCompare]>;
    512 
    513 // -Widiomatic-parentheses contains warnings about 'idiomatic'
    514 // missing parentheses;  it is off by default.  We do not include it
    515 // in -Wparentheses because most users who use -Wparentheses explicitly
    516 // do not want these warnings.
    517 def ParenthesesOnEquality : DiagGroup<"parentheses-equality">;
    518 def Parentheses : DiagGroup<"parentheses",
    519                             [LogicalOpParentheses,
    520                              LogicalNotParentheses,
    521                              BitwiseOpParentheses,
    522                              ShiftOpParentheses,
    523                              OverloadedShiftOpParentheses,
    524                              ParenthesesOnEquality,
    525                              DanglingElse]>;
    526 
    527 // -Wconversion has its own warnings, but we split a few out for
    528 // legacy reasons:
    529 //   - some people want just 64-to-32 warnings
    530 //   - conversion warnings with constant sources are on by default
    531 //   - conversion warnings for literals are on by default
    532 //   - bool-to-pointer conversion warnings are on by default
    533 //   - __null-to-integer conversion warnings are on by default
    534 def Conversion : DiagGroup<"conversion",
    535                            [BoolConversion,
    536                             ConstantConversion,
    537                             EnumConversion,
    538                             FloatConversion,
    539                             Shorten64To32,
    540                             IntConversion,
    541                             LiteralConversion,
    542                             NonLiteralNullConversion, // (1-1)->pointer (etc)
    543                             NullConversion, // NULL->non-pointer
    544                             ObjCLiteralConversion,
    545                             SignConversion,
    546                             StringConversion]>,
    547                  DiagCategory<"Value Conversion Issue">;
    548 
    549 def Unused : DiagGroup<"unused",
    550                        [UnusedArgument, UnusedFunction, UnusedLabel,
    551                         // UnusedParameter, (matches GCC's behavior)
    552                         // UnusedMemberFunction, (clean-up llvm before enabling)
    553                         UnusedPrivateField, UnusedLocalTypedef,
    554                         UnusedValue, UnusedVariable, UnusedPropertyIvar]>,
    555                         DiagCategory<"Unused Entity Issue">;
    556 
    557 // Format settings.
    558 def FormatInvalidSpecifier : DiagGroup<"format-invalid-specifier">;
    559 def FormatSecurity : DiagGroup<"format-security">;
    560 def FormatNonStandard : DiagGroup<"format-non-iso">;
    561 def FormatY2K : DiagGroup<"format-y2k">;
    562 def FormatPedantic : DiagGroup<"format-pedantic">;
    563 def Format : DiagGroup<"format",
    564                        [FormatExtraArgs, FormatZeroLength, NonNull,
    565                         FormatSecurity, FormatY2K, FormatInvalidSpecifier]>,
    566              DiagCategory<"Format String Issue">;
    567 def FormatNonLiteral : DiagGroup<"format-nonliteral">;
    568 def Format2 : DiagGroup<"format=2",
    569                         [FormatNonLiteral, FormatSecurity, FormatY2K]>;
    570 
    571 def TypeSafety : DiagGroup<"type-safety">;
    572 
    573 def IntToVoidPointerCast : DiagGroup<"int-to-void-pointer-cast">;
    574 def IntToPointerCast : DiagGroup<"int-to-pointer-cast",
    575                                  [IntToVoidPointerCast]>;
    576 
    577 def Extra : DiagGroup<"extra", [
    578     MissingFieldInitializers,
    579     IgnoredQualifiers,
    580     InitializerOverrides,
    581     SemiBeforeMethodBody,
    582     MissingMethodReturnType,
    583     SignCompare,
    584     UnusedParameter
    585   ]>;
    586 
    587 def Most : DiagGroup<"most", [
    588     CharSubscript,
    589     Comment,
    590     DeleteNonVirtualDtor,
    591     Format,
    592     Implicit,
    593     MismatchedTags,
    594     MissingBraces,
    595     MultiChar,
    596     Reorder,
    597     ReturnType,
    598     SelfAssignment,
    599     SelfMove,
    600     SizeofArrayArgument,
    601     SizeofArrayDecay,
    602     StringPlusInt,
    603     Trigraphs,
    604     Uninitialized,
    605     UnknownPragmas,
    606     Unused,
    607     VolatileRegisterVar,
    608     ObjCMissingSuperCalls,
    609     ObjCDesignatedInit,
    610     OverloadedVirtual,
    611     PrivateExtern,
    612     SelTypeCast,
    613     ExternCCompat
    614  ]>;
    615 
    616 // Thread Safety warnings 
    617 def ThreadSafetyAttributes : DiagGroup<"thread-safety-attributes">;
    618 def ThreadSafetyAnalysis   : DiagGroup<"thread-safety-analysis">;
    619 def ThreadSafetyPrecise    : DiagGroup<"thread-safety-precise">;
    620 def ThreadSafetyReference  : DiagGroup<"thread-safety-reference">;
    621 def ThreadSafetyNegative   : DiagGroup<"thread-safety-negative">;
    622 def ThreadSafety : DiagGroup<"thread-safety",
    623                              [ThreadSafetyAttributes, 
    624                               ThreadSafetyAnalysis,
    625                               ThreadSafetyPrecise,
    626                               ThreadSafetyReference]>;
    627 def ThreadSafetyVerbose : DiagGroup<"thread-safety-verbose">;
    628 def ThreadSafetyBeta : DiagGroup<"thread-safety-beta">;
    629 
    630 // Uniqueness Analysis warnings
    631 def Consumed       : DiagGroup<"consumed">;
    632 
    633 // Note that putting warnings in -Wall will not disable them by default. If a
    634 // warning should be active _only_ when -Wall is passed in, mark it as
    635 // DefaultIgnore in addition to putting it here.
    636 def : DiagGroup<"all", [Most, Parentheses, Switch, SwitchBool]>;
    637 
    638 // Warnings enabled by -pedantic.  This is magically filled in by TableGen.
    639 def Pedantic : DiagGroup<"pedantic">;
    640 
    641 // Aliases.
    642 def : DiagGroup<"", [Extra]>;                   // -W = -Wextra
    643 def : DiagGroup<"endif-labels", [ExtraTokens]>; // -Wendif-labels=-Wextra-tokens
    644 def : DiagGroup<"comments", [Comment]>;         // -Wcomments = -Wcomment
    645 def : DiagGroup<"conversion-null",
    646                 [NullConversion]>; // -Wconversion-null = -Wnull-conversion
    647 def : DiagGroup<"bool-conversions",
    648                 [BoolConversion]>; // -Wbool-conversions  = -Wbool-conversion
    649 def : DiagGroup<"int-conversions",
    650                 [IntConversion]>; // -Wint-conversions = -Wint-conversion
    651 def : DiagGroup<"vector-conversions",
    652                 [VectorConversion]>; // -Wvector-conversions = -Wvector-conversion
    653 def : DiagGroup<"unused-local-typedefs", [UnusedLocalTypedef]>;
    654                 // -Wunused-local-typedefs = -Wunused-local-typedef
    655 
    656 // A warning group for warnings that we want to have on by default in clang,
    657 // but which aren't on by default in GCC.
    658 def NonGCC : DiagGroup<"non-gcc",
    659     [SignCompare, Conversion, LiteralRange]>;
    660 
    661 // A warning group for warnings about using C++11 features as extensions in
    662 // earlier C++ versions.
    663 def CXX11 : DiagGroup<"c++11-extensions", [CXX11ExtraSemi, CXX11LongLong]>;
    664 
    665 // A warning group for warnings about using C++14 features as extensions in
    666 // earlier C++ versions.
    667 def CXX14 : DiagGroup<"c++14-extensions">;
    668 
    669 // A warning group for warnings about using C++1z features as extensions in
    670 // earlier C++ versions.
    671 def CXX1z : DiagGroup<"c++1z-extensions">;
    672 
    673 def : DiagGroup<"c++0x-extensions", [CXX11]>;
    674 def : DiagGroup<"c++1y-extensions", [CXX14]>;
    675 
    676 def DelegatingCtorCycles :
    677   DiagGroup<"delegating-ctor-cycles">;
    678 
    679 // A warning group for warnings about using C11 features as extensions.
    680 def C11 : DiagGroup<"c11-extensions">;
    681 
    682 // A warning group for warnings about using C99 features as extensions.
    683 def C99 : DiagGroup<"c99-extensions">;
    684 
    685 // A warning group for warnings about GCC extensions.
    686 def GNU : DiagGroup<"gnu", [GNUAlignofExpression, GNUAnonymousStruct,
    687                             GNUBinaryLiteral, GNUCaseRange,
    688                             GNUComplexInteger, GNUCompoundLiteralInitializer,
    689                             GNUConditionalOmittedOperand, GNUDesignator,
    690                             GNUEmptyInitializer, GNUEmptyStruct,
    691                             VLAExtension, GNUFlexibleArrayInitializer,
    692                             GNUFlexibleArrayUnionMember, GNUFoldingConstant,
    693                             GNUImaginaryConstant, GNULabelsAsValue,
    694                             RedeclaredClassMember, GNURedeclaredEnum,
    695                             GNUStatementExpression, GNUStaticFloatInit,
    696                             GNUStringLiteralOperatorTemplate,
    697                             GNUUnionCast, GNUVariableSizedTypeNotAtEnd,
    698                             ZeroLengthArray, GNUZeroLineDirective,
    699                             GNUZeroVariadicMacroArguments]>;
    700 // A warning group for warnings about code that clang accepts but gcc doesn't.
    701 def GccCompat : DiagGroup<"gcc-compat">;
    702 
    703 // A warning group for warnings about Microsoft extensions.
    704 def Microsoft : DiagGroup<"microsoft">;
    705 
    706 def ObjCNonUnifiedException : DiagGroup<"objc-nonunified-exceptions">;
    707 
    708 def ObjCProtocolMethodImpl : DiagGroup<"objc-protocol-method-implementation">;
    709 
    710 def ObjCNoPropertyAutoSynthesis : DiagGroup<"objc-property-synthesis">;
    711 
    712 // ObjC API warning groups.
    713 def ObjCRedundantLiteralUse : DiagGroup<"objc-redundant-literal-use">;
    714 def ObjCRedundantAPIUse : DiagGroup<"objc-redundant-api-use", [
    715     ObjCRedundantLiteralUse
    716   ]>;
    717 
    718 def ObjCCocoaAPI : DiagGroup<"objc-cocoa-api", [
    719     ObjCRedundantAPIUse
    720   ]>;
    721 
    722 def ObjCStringComparison : DiagGroup<"objc-string-compare">;
    723 def ObjCStringConcatenation : DiagGroup<"objc-string-concatenation">;
    724 def ObjCLiteralComparison : DiagGroup<"objc-literal-compare", [
    725     ObjCStringComparison
    726   ]>;
    727 
    728 // Inline ASM warnings.
    729 def ASMOperandWidths : DiagGroup<"asm-operand-widths">;
    730 def ASM : DiagGroup<"asm", [
    731     ASMOperandWidths
    732   ]>;
    733 
    734 // OpenMP warnings.
    735 def SourceUsesOpenMP : DiagGroup<"source-uses-openmp">;
    736 def OpenMPClauses : DiagGroup<"openmp-clauses">;
    737 def OpenMPLoopForm : DiagGroup<"openmp-loop-form">;
    738 
    739 // Backend warnings.
    740 def BackendInlineAsm : DiagGroup<"inline-asm">;
    741 def BackendFrameLargerThanEQ : DiagGroup<"frame-larger-than=">;
    742 def BackendPlugin : DiagGroup<"backend-plugin">;
    743 def RemarkBackendPlugin : DiagGroup<"remark-backend-plugin">;
    744 def BackendOptimizationRemark : DiagGroup<"pass">;
    745 def BackendOptimizationRemarkMissed : DiagGroup<"pass-missed">;
    746 def BackendOptimizationRemarkAnalysis : DiagGroup<"pass-analysis">;
    747 def BackendOptimizationFailure : DiagGroup<"pass-failed">;
    748 
    749 // Instrumentation based profiling warnings.
    750 def ProfileInstrOutOfDate : DiagGroup<"profile-instr-out-of-date">;
    751 def ProfileInstrUnprofiled : DiagGroup<"profile-instr-unprofiled">;
    752 
    753 // AddressSanitizer frontent instrumentation remarks.
    754 def SanitizeAddressRemarks : DiagGroup<"sanitize-address">;
    755 
    756 // Issues with serialized diagnostics.
    757 def SerializedDiagnostics : DiagGroup<"serialized-diagnostics">;
    758 
    759 // A warning group for warnings about code that clang accepts when
    760 // compiling CUDA C/C++ but which is not compatible with the CUDA spec.
    761 def CudaCompat : DiagGroup<"cuda-compat">;
    762 
    763 // A warning group for things that will change semantics in the future.
    764 def FutureCompat : DiagGroup<"future-compat">;
    765