Bots, Bureaucrats, Interface administrators, smwadministrator, smwcurator, smweditor, Administrators
2,557
edits
Timo.stripf (talk | contribs) (Created page with "local a=""; local b="note\\: "; local c="category"; local d="regex3"; local e="regex2"; local f="title"; local g="regex1"; local h="message"; local i="type"; local j="Note"; local k="prefix"; local l="note: "; local m="commit"; local n="source"; local o="Semantic Issue"; local p="clang/lib/AST/ExprConstant.cpp"; local q="clang/lib/Sema/SemaDeclCXX.cpp"; local r="clang/lib/Sema/SemaExpr.cpp"; local s="clang/lib/Sema/SemaExprObjC.cpp"; local t="clang/lib/Sema/SemaDecl.cpp"...") |
Timo.stripf (talk | contribs) No edit summary |
||
Line 129: | Line 129: | ||
[c]=o, | [c]=o, | ||
[m]={"5dadb65e0722",1333767860,"Fix several problems with protected access control:"}, | [m]={"5dadb65e0722",1333767860,"Fix several problems with protected access control:"}, | ||
[n]={{"clang/lib/Sema/SemaAccess.cpp", | [n]={{"clang/lib/Sema/SemaAccess.cpp",1079,"/// Given that an entity has protected natural access, check whether\n/// access might be denied because of the protected member access\n/// restriction.\n///\n/// \\return true if a note was emitted\nstatic bool TryDiagnoseProtectedAccess(Sema &S, const EffectiveContext &EC, AccessTarget &Target) {\n for (EffectiveContext::record_iterator I = EC.Records.begin(), E = EC.Records.end(); I != E; ++I) {\n // If we don\'t have an instance context, [class.protected] says the\n // naming class has to equal the context class.\n if (!Target.hasInstanceContext()) {\n S.Diag(D->getLocation(), diag::note_access_protected_restricted_noobject) << S.Context.getTypeDeclType(ECRecord);"}} | ||
}, | }, | ||
["note_access_protected_restricted_object"]={ | ["note_access_protected_restricted_object"]={ | ||
Line 141: | Line 141: | ||
[c]=o, | [c]=o, | ||
[m]={"5dadb65e0722",1333767860,"Fix several problems with protected access control:"}, | [m]={"5dadb65e0722",1333767860,"Fix several problems with protected access control:"}, | ||
[n]={{"clang/lib/Sema/SemaAccess.cpp", | [n]={{"clang/lib/Sema/SemaAccess.cpp",1108,"/// Given that an entity has protected natural access, check whether\n/// access might be denied because of the protected member access\n/// restriction.\n///\n/// \\return true if a note was emitted\nstatic bool TryDiagnoseProtectedAccess(Sema &S, const EffectiveContext &EC, AccessTarget &Target) {\n for (EffectiveContext::record_iterator I = EC.Records.begin(), E = EC.Records.end(); I != E; ++I) {\n return S.Diag(D->getLocation(), diag::note_access_protected_restricted_object) << S.Context.getTypeDeclType(ECRecord);"}} | ||
}, | }, | ||
["note_add_deprecation_attr"]={ | ["note_add_deprecation_attr"]={ | ||
Line 153: | Line 153: | ||
[c]=nb, | [c]=nb, | ||
[m]={"1da888691587",1348350470,"Comment sema: warn when comment has \\deprecated but declaration does not have a"}, | [m]={"1da888691587",1348350470,"Comment sema: warn when comment has \\deprecated but declaration does not have a"}, | ||
[n]={{ob, | [n]={{ob,700,"void Sema::checkDeprecatedCommand(const BlockCommandComment *Command) {\n // Try to emit a fixit with a deprecation attribute.\n if (const FunctionDecl *FD = dyn_cast<FunctionDecl>(D)) {\n Diag(Loc, diag::note_add_deprecation_attr) << FixItHint::CreateInsertion(Loc, TextToInsert);"}} | ||
}, | }, | ||
["note_add_synthesize_directive"]={ | ["note_add_synthesize_directive"]={ | ||
Line 165: | Line 165: | ||
[c]=o, | [c]=o, | ||
[m]={"6c9af50cc815",1499076744,"Add a fixit for -Wobjc-protocol-property-synthesis"}, | [m]={"6c9af50cc815",1499076744,"Add a fixit for -Wobjc-protocol-property-synthesis"}, | ||
[n]={{N, | [n]={{N,1940,"/// Default synthesizes all properties which must be synthesized\n/// in class\'s \\@implementation.\nvoid Sema::DefaultSynthesizeProperties(Scope *S, ObjCImplDecl *IMPDecl, ObjCInterfaceDecl *IDecl, SourceLocation AtEnd) {\n for (const auto &PropEntry : PropMap) {\n if (ObjCProtocolDecl *Proto = dyn_cast<ObjCProtocolDecl>(Prop->getDeclContext())) {\n // We won\'t auto-synthesize properties declared in protocols.\n // Suppress the warning if class\'s superclass implements property\'s\n // getter and implements property\'s setter (if readwrite property).\n // Or, if property is going to be implemented in its super class.\n if (!SuperClassImplementsProperty(IDecl, Prop) && !PropInSuperClass) {\n Diag(AtEnd, diag::note_add_synthesize_directive) << FixItHint::CreateInsertion(AtEnd, FixIt);"}} | ||
}, | }, | ||
["note_additional_parens_for_variable_declaration"]={ | ["note_additional_parens_for_variable_declaration"]={ | ||
Line 177: | Line 177: | ||
[c]=o, | [c]=o, | ||
[m]={"943c44045551",1343683852,"Improvements to vexing-parse warnings. Make the no-parameters case more"}, | [m]={"943c44045551",1343683852,"Improvements to vexing-parse warnings. Make the no-parameters case more"}, | ||
[n]={{B, | [n]={{B,3893,"/// Produce an appropriate diagnostic for an ambiguity between a function\n/// declarator and a C++ direct-initializer.\nstatic void warnAboutAmbiguousFunction(Sema &S, Declarator &D, DeclaratorChunk &DeclType, QualType RT) {\n if (FTI.NumParams > 0) {\n S.Diag(B, diag::note_additional_parens_for_variable_declaration) << FixItHint::CreateInsertion(B, \"(\") << FixItHint::CreateInsertion(E, \")\");"}} | ||
}, | }, | ||
["note_addrof_ovl_candidate_disabled_by_enable_if_attr"]={ | ["note_addrof_ovl_candidate_disabled_by_enable_if_attr"]={ | ||
Line 189: | Line 189: | ||
[c]=o, | [c]=o, | ||
[m]={"3e3bb95b6951",1449093488,"Add the `pass_object_size` attribute to clang."}, | [m]={"3e3bb95b6951",1449093488,"Add the `pass_object_size` attribute to clang."}, | ||
[n]={{P, | [n]={{P,10561,"/// Returns true if we can take the address of the function.\n///\n/// \\param Complain - If true, we\'ll emit a diagnostic\n/// \\param InOverloadResolution - For the purposes of emitting a diagnostic, are\n/// we in overload resolution?\n/// \\param Loc - The location of the statement we\'re complaining about. Ignored\n/// if we\'re not complaining, or if we\'re in overload resolution.\nstatic bool checkAddressOfFunctionIsAvailable(Sema &S, const FunctionDecl *FD, bool Complain, bool InOverloadResolution, SourceLocation Loc) {\n if (!isFunctionAlwaysEnabled(S.Context, FD)) {\n if (Complain) {\n if (InOverloadResolution)\n S.Diag(FD->getBeginLoc(), diag::note_addrof_ovl_candidate_disabled_by_enable_if_attr);"}} | ||
}, | }, | ||
["note_alias_mangled_name_alternative"]={ | ["note_alias_mangled_name_alternative"]={ | ||
Line 201: | Line 201: | ||
[c]=a, | [c]=a, | ||
[m]={"ba6e747f9b05",1670524276,"[clang] Set ShowInSystemHeader for module-build and module-import remarks"}, | [m]={"ba6e747f9b05",1670524276,"[clang] Set ShowInSystemHeader for module-build and module-import remarks"}, | ||
[n]={{"clang/lib/CodeGen/CodeGenModule.cpp", | [n]={{"clang/lib/CodeGen/CodeGenModule.cpp",586,"static bool checkAliasedGlobal(DiagnosticsEngine &Diags, SourceLocation Location, bool IsIFunc, const llvm::GlobalValue *Alias, const llvm::GlobalValue *&GV, const llvm::MapVector<GlobalDecl, StringRef> &MangledDeclNames, SourceRange AliasRange) {\n if (GV->isDeclaration()) {\n // Provide a note if the given function is not found and exists as a\n // mangled name.\n for (const auto &[Decl, Name] : MangledDeclNames) {\n if (const auto *ND = dyn_cast<NamedDecl>(Decl.getDecl())) {\n if (ND->getName() == GV->getName()) {\n Diags.Report(Location, diag::note_alias_mangled_name_alternative) << Name << FixItHint::CreateReplacement(AliasRange, (Twine(IsIFunc ? \"ifunc\" : \"alias\") + \"(\\\"\" + Name + \"\\\")\").str());"}} | ||
}, | }, | ||
["note_alias_requires_mangled_name"]={ | ["note_alias_requires_mangled_name"]={ | ||
Line 213: | Line 213: | ||
[c]=a, | [c]=a, | ||
[m]={"ba6e747f9b05",1670524276,"[clang] Set ShowInSystemHeader for module-build and module-import remarks"}, | [m]={"ba6e747f9b05",1670524276,"[clang] Set ShowInSystemHeader for module-build and module-import remarks"}, | ||
[n]={{"clang/lib/CodeGen/CodeGenModule.cpp", | [n]={{"clang/lib/CodeGen/CodeGenModule.cpp",579,"static bool checkAliasedGlobal(DiagnosticsEngine &Diags, SourceLocation Location, bool IsIFunc, const llvm::GlobalValue *Alias, const llvm::GlobalValue *&GV, const llvm::MapVector<GlobalDecl, StringRef> &MangledDeclNames, SourceRange AliasRange) {\n if (GV->isDeclaration()) {\n Diags.Report(Location, diag::note_alias_requires_mangled_name) << IsIFunc << IsIFunc;"}} | ||
}, | }, | ||
["note_alignas_on_declaration"]={ | ["note_alignas_on_declaration"]={ | ||
Line 225: | Line 225: | ||
[c]=o, | [c]=o, | ||
[m]={"bc8caaf05f09",1361508939,"Implement C++11 [dcl.align]p6-p8, and C11 6.7.5/7. This had to be split out of"}, | [m]={"bc8caaf05f09",1361508939,"Implement C++11 [dcl.align]p6-p8, and C11 6.7.5/7. This had to be split out of"}, | ||
[n]={{t, | [n]={{t,2859,"/// Merge alignment attributes from \\p Old to \\p New, taking into account the\n/// special semantics of C11\'s _Alignas specifier and C++11\'s alignas attribute.\n///\n/// \\return \\c true if any attributes were added to \\p New.\nstatic bool mergeAlignedAttrs(Sema &S, NamedDecl *New, Decl *Old) {\n if (OldAlignasAttr && !NewAlignasAttr && isAttributeTargetADefinition(New)) {\n S.Diag(OldAlignasAttr->getLocation(), diag::note_alignas_on_declaration) << OldAlignasAttr;"},{t,3087,"/// checkNewAttributesAfterDef - If we already have a definition, check that\n/// there are no new attributes in this declaration.\nstatic void checkNewAttributesAfterDef(Sema &S, Decl *New, const Decl *Old) {\n for (unsigned I = 0, E = NewAttributes.size(); I != E;) {\n if (isa<C11NoReturnAttr>(NewAttribute)) {\n } else if (isa<UuidAttr>(NewAttribute)) {\n } else if (const AlignedAttr *AA = dyn_cast<AlignedAttr>(NewAttribute)) {\n if (AA->isAlignas()) {\n S.Diag(NewAttribute->getLocation(), diag::note_alignas_on_declaration) << AA;"}} | ||
}, | }, | ||
["note_allocated_here"]={ | ["note_allocated_here"]={ | ||
Line 237: | Line 237: | ||
[c]=o, | [c]=o, | ||
[m]={"538ef53c139d",1431620097,"Detect uses of mismatching forms of \'new\' and \'delete\'"}, | [m]={"538ef53c139d",1431620097,"Detect uses of mismatching forms of \'new\' and \'delete\'"}, | ||
[n]={{K, | [n]={{K,3541,"static void DiagnoseMismatchedNewDelete(Sema &SemaRef, SourceLocation DeleteLoc, const MismatchingNewDeleteDetector &Detector) {\n for (const auto *NE : Detector.NewExprs)\n SemaRef.Diag(NE->getExprLoc(), diag::note_allocated_here) << Detector.IsArrayForm;"}} | ||
}, | }, | ||
["note_also_found"]={ | ["note_also_found"]={ | ||
Line 249: | Line 249: | ||
[c]=a, | [c]=a, | ||
[m]={"e29c5cd2398c",1260474663,"Improve the diagnostic when a new declaration conflicts with a using shadow"}, | [m]={"e29c5cd2398c",1260474663,"Improve the diagnostic when a new declaration conflicts with a using shadow"}, | ||
[n]={{E, | [n]={{E,3645,"void Sema::DiagnoseMultipleMethodInGlobalPool(SmallVectorImpl<ObjCMethodDecl *> &Methods, Selector Sel, SourceRange R, bool receiverIdOrClass) {\n if (issueDiagnostic) {\n for (unsigned I = 1, N = Methods.size(); I != N; ++I) {\n Diag(Methods[I]->getBeginLoc(), diag::note_also_found) << Methods[I]->getSourceRange();"}} | ||
}, | }, | ||
["note_ambig_member_ref_object_type"]={ | ["note_ambig_member_ref_object_type"]={ | ||
Line 261: | Line 261: | ||
[c]=o, | [c]=o, | ||
[m]={"b7bfe794129f",1251932376,"Rewrite of our handling of name lookup in C++ member access expressions, e.g.,"}, | [m]={"b7bfe794129f",1251932376,"Rewrite of our handling of name lookup in C++ member access expressions, e.g.,"}, | ||
[n]={{cc, | [n]={{cc,684,"/// Build a new nested-name-specifier for \"identifier::\", as described\n/// by ActOnCXXNestedNameSpecifier.\n///\n/// \\param S Scope in which the nested-name-specifier occurs.\n/// \\param IdInfo Parser information about an identifier in the\n/// nested-name-spec.\n/// \\param EnteringContext If true, enter the context specified by the\n/// nested-name-specifier.\n/// \\param SS Optional nested name specifier preceding the identifier.\n/// \\param ScopeLookupResult Provides the result of name lookup within the\n/// scope of the nested-name-specifier that was computed at template\n/// definition time.\n/// \\param ErrorRecoveryLookup Specifies if the method is called to improve\n/// error recovery and what kind of recovery is performed.\n/// \\param IsCorrectedToColon If not null, suggestion of replace \'::\' -> \':\'\n/// are allowed. The bool value pointed by this parameter is set to\n/// \'true\' if the identifier is treated as if it was followed by \':\',\n/// not \'::\'.\n/// \\param OnlyNamespace If true, only considers namespaces in lookup.\n///\n/// This routine differs only slightly from ActOnCXXNestedNameSpecifier, in\n/// that it contains an extra parameter \\p ScopeLookupResult, which provides\n/// the result of name lookup within the scope of the nested-name-specifier\n/// that was computed at template definition time.\n///\n/// If ErrorRecoveryLookup is true, then this call is used to improve error\n/// recovery. This means that it should not emit diagnostics, it should\n/// just return true on failure. It also means it should only return a valid\n/// scope if it *knows* that the result is correct. It should not return in a\n/// dependent context, for example. Nor will it extend \\p SS with the scope\n/// specifier.\nbool Sema::BuildCXXNestedNameSpecifier(Scope *S, NestedNameSpecInfo &IdInfo, bool EnteringContext, CXXScopeSpec &SS, NamedDecl *ScopeLookupResult, bool ErrorRecoveryLookup, bool *IsCorrectedToColon, bool OnlyNamespace) {\n if (AcceptSpec) {\n if (!ObjectType.isNull() && !ObjectTypeSearchedInScope && !getLangOpts().CPlusPlus11) {\n if (isAcceptableNestedNameSpecifier(OuterDecl) && OuterDecl->getCanonicalDecl() != SD->getCanonicalDecl() && (!isa<TypeDecl>(OuterDecl) || !isa<TypeDecl>(SD) || !Context.hasSameType(Context.getTypeDeclType(cast<TypeDecl>(OuterDecl)), Context.getTypeDeclType(cast<TypeDecl>(SD))))) {\n Diag(SD->getLocation(), diag::note_ambig_member_ref_object_type) << ObjectType;"},{u,609,"bool Sema::LookupTemplateName(LookupResult &Found, Scope *S, CXXScopeSpec &SS, QualType ObjectType, bool EnteringContext, bool &MemberOfUnknownSpecialization, RequiredTemplateKind RequiredTemplate, AssumedTemplateKind *ATK, bool AllowTypoCorrection) {\n if (S && !ObjectType.isNull() && !ObjectTypeSearchedInScope && !getLangOpts().CPlusPlus11) {\n if (FoundOuter.empty()) {\n } else if (FoundOuter.isAmbiguous() || !FoundOuter.isSingleResult() || !(OuterTemplate = getAsTemplateNameDecl(FoundOuter.getFoundDecl()))) {\n } else if (!Found.isSuppressingDiagnostics()) {\n // - if the name found is a class template, it must refer to the same\n // entity as the one found in the class of the object expression,\n // otherwise the program is ill-formed.\n if (!Found.isSingleResult() || getAsTemplateNameDecl(Found.getFoundDecl())->getCanonicalDecl() != OuterTemplate->getCanonicalDecl()) {\n Diag(Found.getRepresentativeDecl()->getLocation(), diag::note_ambig_member_ref_object_type) << ObjectType;"}} | ||
}, | }, | ||
["note_ambig_member_ref_scope"]={ | ["note_ambig_member_ref_scope"]={ | ||
Line 273: | Line 273: | ||
[c]=o, | [c]=o, | ||
[m]={"b7bfe794129f",1251932376,"Rewrite of our handling of name lookup in C++ member access expressions, e.g.,"}, | [m]={"b7bfe794129f",1251932376,"Rewrite of our handling of name lookup in C++ member access expressions, e.g.,"}, | ||
[n]={{cc, | [n]={{cc,686,"/// Build a new nested-name-specifier for \"identifier::\", as described\n/// by ActOnCXXNestedNameSpecifier.\n///\n/// \\param S Scope in which the nested-name-specifier occurs.\n/// \\param IdInfo Parser information about an identifier in the\n/// nested-name-spec.\n/// \\param EnteringContext If true, enter the context specified by the\n/// nested-name-specifier.\n/// \\param SS Optional nested name specifier preceding the identifier.\n/// \\param ScopeLookupResult Provides the result of name lookup within the\n/// scope of the nested-name-specifier that was computed at template\n/// definition time.\n/// \\param ErrorRecoveryLookup Specifies if the method is called to improve\n/// error recovery and what kind of recovery is performed.\n/// \\param IsCorrectedToColon If not null, suggestion of replace \'::\' -> \':\'\n/// are allowed. The bool value pointed by this parameter is set to\n/// \'true\' if the identifier is treated as if it was followed by \':\',\n/// not \'::\'.\n/// \\param OnlyNamespace If true, only considers namespaces in lookup.\n///\n/// This routine differs only slightly from ActOnCXXNestedNameSpecifier, in\n/// that it contains an extra parameter \\p ScopeLookupResult, which provides\n/// the result of name lookup within the scope of the nested-name-specifier\n/// that was computed at template definition time.\n///\n/// If ErrorRecoveryLookup is true, then this call is used to improve error\n/// recovery. This means that it should not emit diagnostics, it should\n/// just return true on failure. It also means it should only return a valid\n/// scope if it *knows* that the result is correct. It should not return in a\n/// dependent context, for example. Nor will it extend \\p SS with the scope\n/// specifier.\nbool Sema::BuildCXXNestedNameSpecifier(Scope *S, NestedNameSpecInfo &IdInfo, bool EnteringContext, CXXScopeSpec &SS, NamedDecl *ScopeLookupResult, bool ErrorRecoveryLookup, bool *IsCorrectedToColon, bool OnlyNamespace) {\n if (AcceptSpec) {\n if (!ObjectType.isNull() && !ObjectTypeSearchedInScope && !getLangOpts().CPlusPlus11) {\n if (isAcceptableNestedNameSpecifier(OuterDecl) && OuterDecl->getCanonicalDecl() != SD->getCanonicalDecl() && (!isa<TypeDecl>(OuterDecl) || !isa<TypeDecl>(SD) || !Context.hasSameType(Context.getTypeDeclType(cast<TypeDecl>(OuterDecl)), Context.getTypeDeclType(cast<TypeDecl>(SD))))) {\n Diag(OuterDecl->getLocation(), diag::note_ambig_member_ref_scope);"},{u,612,"bool Sema::LookupTemplateName(LookupResult &Found, Scope *S, CXXScopeSpec &SS, QualType ObjectType, bool EnteringContext, bool &MemberOfUnknownSpecialization, RequiredTemplateKind RequiredTemplate, AssumedTemplateKind *ATK, bool AllowTypoCorrection) {\n if (S && !ObjectType.isNull() && !ObjectTypeSearchedInScope && !getLangOpts().CPlusPlus11) {\n if (FoundOuter.empty()) {\n } else if (FoundOuter.isAmbiguous() || !FoundOuter.isSingleResult() || !(OuterTemplate = getAsTemplateNameDecl(FoundOuter.getFoundDecl()))) {\n } else if (!Found.isSuppressingDiagnostics()) {\n // - if the name found is a class template, it must refer to the same\n // entity as the one found in the class of the object expression,\n // otherwise the program is ill-formed.\n if (!Found.isSingleResult() || getAsTemplateNameDecl(Found.getFoundDecl())->getCanonicalDecl() != OuterTemplate->getCanonicalDecl()) {\n Diag(FoundOuter.getFoundDecl()->getLocation(), diag::note_ambig_member_ref_scope);"}} | ||
}, | }, | ||
["note_ambiguous_atomic_constraints"]={ | ["note_ambiguous_atomic_constraints"]={ | ||
Line 285: | Line 285: | ||
[c]=o, | [c]=o, | ||
[m]={"349636d2bfc3",1575555459,"Implement VectorType conditional operator GNU extension."}, | [m]={"349636d2bfc3",1575555459,"Implement VectorType conditional operator GNU extension."}, | ||
[n]={{O, | [n]={{O,1579,"bool Sema::MaybeEmitAmbiguousAtomicConstraintsDiagnostic(NamedDecl *D1, ArrayRef<const Expr *> AC1, NamedDecl *D2, ArrayRef<const Expr *> AC2) {\n Diag(AmbiguousAtomic1->getBeginLoc(), diag::note_ambiguous_atomic_constraints) << AmbiguousAtomic1->getSourceRange();"}} | ||
}, | }, | ||
["note_ambiguous_atomic_constraints_similar_expression"]={ | ["note_ambiguous_atomic_constraints_similar_expression"]={ | ||
Line 297: | Line 297: | ||
[c]=o, | [c]=o, | ||
[m]={"349636d2bfc3",1575555459,"Implement VectorType conditional operator GNU extension."}, | [m]={"349636d2bfc3",1575555459,"Implement VectorType conditional operator GNU extension."}, | ||
[n]={{O, | [n]={{O,1,"bool Sema::MaybeEmitAmbiguousAtomicConstraintsDiagnostic(NamedDecl *D1, ArrayRef<const Expr *> AC1, NamedDecl *D2, ArrayRef<const Expr *> AC2) {\n Diag(AmbiguousAtomic2->getBeginLoc(), diag::note_ambiguous_atomic_constraints_similar_expression) << AmbiguousAtomic2->getSourceRange();"}} | ||
}, | }, | ||
["note_ambiguous_candidate"]={ | ["note_ambiguous_candidate"]={ | ||
Line 309: | Line 309: | ||
[c]=o, | [c]=o, | ||
[m]={"5a8987ca5113",1237025389,"Update tablegen diagnostic files to be in sync with the def files."}, | [m]={"5a8987ca5113",1237025389,"Update tablegen diagnostic files to be in sync with the def files."}, | ||
[n]={{zb, | [n]={{zb,2866,"/// Produce a diagnostic describing the ambiguity that resulted\n/// from name lookup.\n///\n/// \\param Result The result of the ambiguous lookup to be diagnosed.\nvoid Sema::DiagnoseAmbiguousLookup(LookupResult &Result) {\n case LookupResult::AmbiguousReference: {\n for (auto *D : Result)\n Diag(D->getLocation(), diag::note_ambiguous_candidate) << D;"}} | ||
}, | }, | ||
["note_ambiguous_inherited_constructor_using"]={ | ["note_ambiguous_inherited_constructor_using"]={ | ||
Line 321: | Line 321: | ||
[c]=o, | [c]=o, | ||
[m]={"5179eb78210a",1467140637,"P0136R1, DR1573, DR1645, DR1715, DR1736, DR1903, DR1941, DR1959, DR1991:"}, | [m]={"5179eb78210a",1467140637,"P0136R1, DR1573, DR1645, DR1715, DR1736, DR1903, DR1941, DR1959, DR1991:"}, | ||
[n]={{q, | [n]={{q,7305,"class Sema::InheritedConstructorInfo {\n InheritedConstructorInfo(Sema &S, SourceLocation UseLoc, ConstructorUsingShadowDecl *Shadow) : S(S), UseLoc(UseLoc) {\n // Find the set of such base class subobjects and check that there\'s a\n // unique constructed subobject.\n for (auto *D : Shadow->redecls()) {\n // [class.inhctor.init]p2:\n // If the constructor was inherited from multiple base class subobjects\n // of type B, the program is ill-formed.\n if (!ConstructedBase) {\n } else if (ConstructedBase != DConstructedBase && !Shadow->isInvalidDecl()) {\n if (!DiagnosedMultipleConstructedBases) {\n S.Diag(ConstructedBaseIntroducer->getLocation(), diag::note_ambiguous_inherited_constructor_using) << ConstructedBase;"},{q,7310,"class Sema::InheritedConstructorInfo {\n InheritedConstructorInfo(Sema &S, SourceLocation UseLoc, ConstructorUsingShadowDecl *Shadow) : S(S), UseLoc(UseLoc) {\n // Find the set of such base class subobjects and check that there\'s a\n // unique constructed subobject.\n for (auto *D : Shadow->redecls()) {\n // [class.inhctor.init]p2:\n // If the constructor was inherited from multiple base class subobjects\n // of type B, the program is ill-formed.\n if (!ConstructedBase) {\n } else if (ConstructedBase != DConstructedBase && !Shadow->isInvalidDecl()) {\n S.Diag(D->getIntroducer()->getLocation(), diag::note_ambiguous_inherited_constructor_using) << DConstructedBase;"}} | ||
}, | }, | ||
["note_ambiguous_member_found"]={ | ["note_ambiguous_member_found"]={ | ||
Line 333: | Line 333: | ||
[c]=o, | [c]=o, | ||
[m]={"5a8987ca5113",1237025389,"Update tablegen diagnostic files to be in sync with the def files."}, | [m]={"5a8987ca5113",1237025389,"Update tablegen diagnostic files to be in sync with the def files."}, | ||
[n]={{zb, | [n]={{zb,2807,"/// Produce a diagnostic describing the ambiguity that resulted\n/// from name lookup.\n///\n/// \\param Result The result of the ambiguous lookup to be diagnosed.\nvoid Sema::DiagnoseAmbiguousLookup(LookupResult &Result) {\n case LookupResult::AmbiguousBaseSubobjects: {\n Diag((*Found)->getLocation(), diag::note_ambiguous_member_found);"},{zb,2831,"/// Produce a diagnostic describing the ambiguity that resulted\n/// from name lookup.\n///\n/// \\param Result The result of the ambiguous lookup to be diagnosed.\nvoid Sema::DiagnoseAmbiguousLookup(LookupResult &Result) {\n case LookupResult::AmbiguousBaseSubobjectTypes: {\n for (CXXBasePaths::paths_iterator Path = Paths->begin(), PathEnd = Paths->end(); Path != PathEnd; ++Path) {\n if (DeclsPrinted.insert(D).second) {\n if (const auto *TD = dyn_cast<TypedefNameDecl>(D->getUnderlyingDecl()))\n else if (const auto *TD = dyn_cast<TypeDecl>(D->getUnderlyingDecl()))\n else\n Diag(D->getLocation(), diag::note_ambiguous_member_found);"}} | ||
}, | }, | ||
["note_ambiguous_member_type_found"]={ | ["note_ambiguous_member_type_found"]={ | ||
Line 345: | Line 345: | ||
[c]=o, | [c]=o, | ||
[m]={T,1590001902,S}, | [m]={T,1590001902,S}, | ||
[n]={{zb, | [n]={{zb,2825,"/// Produce a diagnostic describing the ambiguity that resulted\n/// from name lookup.\n///\n/// \\param Result The result of the ambiguous lookup to be diagnosed.\nvoid Sema::DiagnoseAmbiguousLookup(LookupResult &Result) {\n case LookupResult::AmbiguousBaseSubobjectTypes: {\n for (CXXBasePaths::paths_iterator Path = Paths->begin(), PathEnd = Paths->end(); Path != PathEnd; ++Path) {\n if (DeclsPrinted.insert(D).second) {\n if (const auto *TD = dyn_cast<TypedefNameDecl>(D->getUnderlyingDecl()))\n Diag(D->getLocation(), diag::note_ambiguous_member_type_found) << TD->getUnderlyingType();"},{zb,2828,"/// Produce a diagnostic describing the ambiguity that resulted\n/// from name lookup.\n///\n/// \\param Result The result of the ambiguous lookup to be diagnosed.\nvoid Sema::DiagnoseAmbiguousLookup(LookupResult &Result) {\n case LookupResult::AmbiguousBaseSubobjectTypes: {\n for (CXXBasePaths::paths_iterator Path = Paths->begin(), PathEnd = Paths->end(); Path != PathEnd; ++Path) {\n if (DeclsPrinted.insert(D).second) {\n if (const auto *TD = dyn_cast<TypedefNameDecl>(D->getUnderlyingDecl()))\n else if (const auto *TD = dyn_cast<TypeDecl>(D->getUnderlyingDecl()))\n Diag(D->getLocation(), diag::note_ambiguous_member_type_found) << Context.getTypeDeclType(TD);"}} | ||
}, | }, | ||
["note_ambiguous_type_conversion"]={ | ["note_ambiguous_type_conversion"]={ | ||
Line 357: | Line 357: | ||
[c]=o, | [c]=o, | ||
[m]={"574de2c5a4f0",1255369879,"If built-in operators could not be selected because of ambiguity in"}, | [m]={"574de2c5a4f0",1255369879,"If built-in operators could not be selected because of ambiguity in"}, | ||
[n]={{P, | [n]={{P,11697,"static void NoteAmbiguousUserConversions(Sema &S, SourceLocation OpLoc, OverloadCandidate *Cand) {\n for (const ImplicitConversionSequence &ICS : Cand->Conversions) {\n ICS.DiagnoseAmbiguousConversion(S, OpLoc, S.PDiag(diag::note_ambiguous_type_conversion));"}} | ||
}, | }, | ||
["note_anonymous_namespace"]={ | ["note_anonymous_namespace"]={ | ||
Line 369: | Line 369: | ||
[c]=Sb, | [c]=Sb, | ||
[m]={"e181de7f4fe9",1555973411,"[c++2a] Implement semantic restrictions for \'export\' declarations."}, | [m]={"e181de7f4fe9",1555973411,"[c++2a] Implement semantic restrictions for \'export\' declarations."}, | ||
[n]={{cb, | [n]={{cb,790,"/// We have parsed the start of an export declaration, including the \'{\'\n/// (if present).\nDecl *Sema::ActOnStartExportDecl(Scope *S, SourceLocation ExportLoc, SourceLocation LBraceLoc) {\n for (const DeclContext *DC = CurContext; DC; DC = DC->getLexicalParent()) {\n if (const auto *ND = dyn_cast<NamespaceDecl>(DC)) {\n // An export-declaration shall not appear directly or indirectly within\n // an unnamed namespace [...]\n if (ND->isAnonymousNamespace()) {\n Diag(ND->getLocation(), diag::note_anonymous_namespace);"}} | ||
}, | }, | ||
["note_arc_bridge"]={ | ["note_arc_bridge"]={ | ||
Line 381: | Line 381: | ||
[c]=Xb, | [c]=Xb, | ||
[m]={Ib,1308178962,Hb}, | [m]={Ib,1308178962,Hb}, | ||
[n]={{s, | [n]={{s,3933,"static void diagnoseObjCARCConversion(Sema &S, SourceRange castRange, QualType castType, ARCConversionTypeClass castACTC, Expr *castExpr, Expr *realCast, ARCConversionTypeClass exprACTC, Sema::CheckedConversionKind CCK) {\n // Bridge from an ARC type to a CF type.\n if (castACTC == ACTC_retainable && isAnyRetainable(exprACTC)) {\n if (CreateRule != ACC_plusOne) {\n auto DiagB = (CCK != Sema::CCK_OtherCast) ? S.Diag(noteLoc, diag::note_arc_bridge) : S.Diag(noteLoc, diag::note_arc_cstyle_bridge);"},{s,3974,"static void diagnoseObjCARCConversion(Sema &S, SourceRange castRange, QualType castType, ARCConversionTypeClass castACTC, Expr *castExpr, Expr *realCast, ARCConversionTypeClass exprACTC, Sema::CheckedConversionKind CCK) {\n // Bridge from a CF type to an ARC type.\n if (exprACTC == ACTC_retainable && isAnyRetainable(castACTC)) {\n if (CreateRule != ACC_plusOne) {\n auto DiagB = (CCK != Sema::CCK_OtherCast) ? S.Diag(noteLoc, diag::note_arc_bridge) : S.Diag(noteLoc, diag::note_arc_cstyle_bridge);"},{s,4672,"ExprResult Sema::BuildObjCBridgedCast(SourceLocation LParenLoc, ObjCBridgeCastKind Kind, SourceLocation BridgeKeywordLoc, TypeSourceInfo *TSInfo, Expr *SubExpr) {\n if (T->isDependentType() || SubExpr->isTypeDependent()) {\n } else if (T->isObjCARCBridgableType() && FromType->isCARCBridgableType()) {\n case OBC_BridgeRetained: {\n Diag(BridgeKeywordLoc, diag::note_arc_bridge) << FixItHint::CreateReplacement(BridgeKeywordLoc, \"__bridge\");"},{s,4716,"ExprResult Sema::BuildObjCBridgedCast(SourceLocation LParenLoc, ObjCBridgeCastKind Kind, SourceLocation BridgeKeywordLoc, TypeSourceInfo *TSInfo, Expr *SubExpr) {\n if (T->isDependentType() || SubExpr->isTypeDependent()) {\n } else if (T->isObjCARCBridgableType() && FromType->isCARCBridgableType()) {\n } else if (T->isCARCBridgableType() && FromType->isObjCARCBridgableType()) {\n case OBC_BridgeTransfer: {\n Diag(BridgeKeywordLoc, diag::note_arc_bridge) << FixItHint::CreateReplacement(BridgeKeywordLoc, \"__bridge \");"}} | ||
}, | }, | ||
["note_arc_bridge_retained"]={ | ["note_arc_bridge_retained"]={ | ||
Line 393: | Line 393: | ||
[c]=Xb, | [c]=Xb, | ||
[m]={Ib,1308178962,Hb}, | [m]={Ib,1308178962,Hb}, | ||
[n]={{s, | [n]={{s,3986,"static void diagnoseObjCARCConversion(Sema &S, SourceRange castRange, QualType castType, ARCConversionTypeClass castACTC, Expr *castExpr, Expr *realCast, ARCConversionTypeClass exprACTC, Sema::CheckedConversionKind CCK) {\n // Bridge from a CF type to an ARC type.\n if (exprACTC == ACTC_retainable && isAnyRetainable(castACTC)) {\n if (CreateRule != ACC_plusZero) {\n auto DiagB = (CCK == Sema::CCK_OtherCast && !br) ? S.Diag(noteLoc, diag::note_arc_cstyle_bridge_retained) << castType : S.Diag(br ? castExpr->getExprLoc() : noteLoc, diag::note_arc_bridge_retained) << castType << br;"},{s,4718,"ExprResult Sema::BuildObjCBridgedCast(SourceLocation LParenLoc, ObjCBridgeCastKind Kind, SourceLocation BridgeKeywordLoc, TypeSourceInfo *TSInfo, Expr *SubExpr) {\n if (T->isDependentType() || SubExpr->isTypeDependent()) {\n } else if (T->isObjCARCBridgableType() && FromType->isCARCBridgableType()) {\n } else if (T->isCARCBridgableType() && FromType->isObjCARCBridgableType()) {\n case OBC_BridgeTransfer: {\n Diag(BridgeKeywordLoc, diag::note_arc_bridge_retained) << T << br << FixItHint::CreateReplacement(BridgeKeywordLoc, br ? \"CFBridgingRetain \" : \"__bridge_retained\");"}} | ||
}, | }, | ||
["note_arc_bridge_transfer"]={ | ["note_arc_bridge_transfer"]={ | ||
Line 405: | Line 405: | ||
[c]=Xb, | [c]=Xb, | ||
[m]={Ib,1308178962,Hb}, | [m]={Ib,1308178962,Hb}, | ||
[n]={{s, | [n]={{s,3946,"static void diagnoseObjCARCConversion(Sema &S, SourceRange castRange, QualType castType, ARCConversionTypeClass castACTC, Expr *castExpr, Expr *realCast, ARCConversionTypeClass exprACTC, Sema::CheckedConversionKind CCK) {\n // Bridge from an ARC type to a CF type.\n if (castACTC == ACTC_retainable && isAnyRetainable(exprACTC)) {\n if (CreateRule != ACC_plusZero) {\n auto DiagB = (CCK == Sema::CCK_OtherCast && !br) ? S.Diag(noteLoc, diag::note_arc_cstyle_bridge_transfer) << castExprType : S.Diag(br ? castExpr->getExprLoc() : noteLoc, diag::note_arc_bridge_transfer) << castExprType << br;"},{s,4674,"ExprResult Sema::BuildObjCBridgedCast(SourceLocation LParenLoc, ObjCBridgeCastKind Kind, SourceLocation BridgeKeywordLoc, TypeSourceInfo *TSInfo, Expr *SubExpr) {\n if (T->isDependentType() || SubExpr->isTypeDependent()) {\n } else if (T->isObjCARCBridgableType() && FromType->isCARCBridgableType()) {\n case OBC_BridgeRetained: {\n Diag(BridgeKeywordLoc, diag::note_arc_bridge_transfer) << FromType << br << FixItHint::CreateReplacement(BridgeKeywordLoc, br ? \"CFBridgingRelease \" : \"__bridge_transfer \");"}} | ||
}, | }, | ||
["note_arc_cstyle_bridge"]={ | ["note_arc_cstyle_bridge"]={ | ||
Line 417: | Line 417: | ||
[c]=Xb, | [c]=Xb, | ||
[m]={"ac2d082f58e6",1361496168,"objective-C arc: Diagnostic can not say to use bridge"}, | [m]={"ac2d082f58e6",1361496168,"objective-C arc: Diagnostic can not say to use bridge"}, | ||
[n]={{s, | [n]={{s,3934,"static void diagnoseObjCARCConversion(Sema &S, SourceRange castRange, QualType castType, ARCConversionTypeClass castACTC, Expr *castExpr, Expr *realCast, ARCConversionTypeClass exprACTC, Sema::CheckedConversionKind CCK) {\n // Bridge from an ARC type to a CF type.\n if (castACTC == ACTC_retainable && isAnyRetainable(exprACTC)) {\n if (CreateRule != ACC_plusOne) {\n auto DiagB = (CCK != Sema::CCK_OtherCast) ? S.Diag(noteLoc, diag::note_arc_bridge) : S.Diag(noteLoc, diag::note_arc_cstyle_bridge);"},{s,3975,"static void diagnoseObjCARCConversion(Sema &S, SourceRange castRange, QualType castType, ARCConversionTypeClass castACTC, Expr *castExpr, Expr *realCast, ARCConversionTypeClass exprACTC, Sema::CheckedConversionKind CCK) {\n // Bridge from a CF type to an ARC type.\n if (exprACTC == ACTC_retainable && isAnyRetainable(castACTC)) {\n if (CreateRule != ACC_plusOne) {\n auto DiagB = (CCK != Sema::CCK_OtherCast) ? S.Diag(noteLoc, diag::note_arc_bridge) : S.Diag(noteLoc, diag::note_arc_cstyle_bridge);"}} | ||
}, | }, | ||
["note_arc_cstyle_bridge_retained"]={ | ["note_arc_cstyle_bridge_retained"]={ | ||
Line 429: | Line 429: | ||
[c]=Xb, | [c]=Xb, | ||
[m]={"ac2d082f58e6",1361496168,"objective-C arc: Diagnostic can not say to use bridge"}, | [m]={"ac2d082f58e6",1361496168,"objective-C arc: Diagnostic can not say to use bridge"}, | ||
[n]={{s, | [n]={{s,3983,"static void diagnoseObjCARCConversion(Sema &S, SourceRange castRange, QualType castType, ARCConversionTypeClass castACTC, Expr *castExpr, Expr *realCast, ARCConversionTypeClass exprACTC, Sema::CheckedConversionKind CCK) {\n // Bridge from a CF type to an ARC type.\n if (exprACTC == ACTC_retainable && isAnyRetainable(castACTC)) {\n if (CreateRule != ACC_plusZero) {\n auto DiagB = (CCK == Sema::CCK_OtherCast && !br) ? S.Diag(noteLoc, diag::note_arc_cstyle_bridge_retained) << castType : S.Diag(br ? castExpr->getExprLoc() : noteLoc, diag::note_arc_bridge_retained) << castType << br;"}} | ||
}, | }, | ||
["note_arc_cstyle_bridge_transfer"]={ | ["note_arc_cstyle_bridge_transfer"]={ | ||
Line 441: | Line 441: | ||
[c]=Xb, | [c]=Xb, | ||
[m]={"ac2d082f58e6",1361496168,"objective-C arc: Diagnostic can not say to use bridge"}, | [m]={"ac2d082f58e6",1361496168,"objective-C arc: Diagnostic can not say to use bridge"}, | ||
[n]={{s, | [n]={{s,3943,"static void diagnoseObjCARCConversion(Sema &S, SourceRange castRange, QualType castType, ARCConversionTypeClass castACTC, Expr *castExpr, Expr *realCast, ARCConversionTypeClass exprACTC, Sema::CheckedConversionKind CCK) {\n // Bridge from an ARC type to a CF type.\n if (castACTC == ACTC_retainable && isAnyRetainable(exprACTC)) {\n if (CreateRule != ACC_plusZero) {\n auto DiagB = (CCK == Sema::CCK_OtherCast && !br) ? S.Diag(noteLoc, diag::note_arc_cstyle_bridge_transfer) << castExprType : S.Diag(br ? castExpr->getExprLoc() : noteLoc, diag::note_arc_bridge_transfer) << castExprType << br;"}} | ||
}, | }, | ||
["note_arc_field_with_ownership"]={ | ["note_arc_field_with_ownership"]={ | ||
Line 453: | Line 453: | ||
[c]=mc, | [c]=mc, | ||
[m]={lc,1446008599,kc}, | [m]={lc,1446008599,kc}, | ||
[n]={{V, | [n]={{V,492,"/// Actually emit an availability diagnostic for a reference to an unavailable\n/// decl.\n///\n/// \\param Ctx The context that the reference occurred in\n/// \\param ReferringDecl The exact declaration that was referenced.\n/// \\param OffendingDecl A related decl to \\c ReferringDecl that has an\n/// availability attribute corresponding to \\c K attached to it. Note that this\n/// may not be the same as ReferringDecl, i.e. if an EnumDecl is annotated and\n/// we refer to a member EnumConstantDecl, ReferringDecl is the EnumConstantDecl\n/// and OffendingDecl is the EnumDecl.\nstatic void DoEmitAvailabilityWarning(Sema &S, AvailabilityResult K, Decl *Ctx, const NamedDecl *ReferringDecl, const NamedDecl *OffendingDecl, StringRef Message, ArrayRef<SourceLocation> Locs, const ObjCInterfaceDecl *UnknownObjCClass, const ObjCPropertyDecl *ObjCProperty, bool ObjCPropertyAccess) {\n case AR_Unavailable:\n if (auto AL = OffendingDecl->getAttr<UnavailableAttr>()) {\n if (AL->isImplicit() && AL->getImplicitReason()) {\n case UnavailableAttr::IR_ARCFieldWithOwnership:\n diag_available_here = diag::note_arc_field_with_ownership;"}} | ||
}, | }, | ||
["note_arc_forbidden_type"]={ | ["note_arc_forbidden_type"]={ | ||
Line 465: | Line 465: | ||
[c]=mc, | [c]=mc, | ||
[m]={lc,1446008599,kc}, | [m]={lc,1446008599,kc}, | ||
[n]={{V, | [n]={{V,470,"/// Actually emit an availability diagnostic for a reference to an unavailable\n/// decl.\n///\n/// \\param Ctx The context that the reference occurred in\n/// \\param ReferringDecl The exact declaration that was referenced.\n/// \\param OffendingDecl A related decl to \\c ReferringDecl that has an\n/// availability attribute corresponding to \\c K attached to it. Note that this\n/// may not be the same as ReferringDecl, i.e. if an EnumDecl is annotated and\n/// we refer to a member EnumConstantDecl, ReferringDecl is the EnumConstantDecl\n/// and OffendingDecl is the EnumDecl.\nstatic void DoEmitAvailabilityWarning(Sema &S, AvailabilityResult K, Decl *Ctx, const NamedDecl *ReferringDecl, const NamedDecl *OffendingDecl, StringRef Message, ArrayRef<SourceLocation> Locs, const ObjCInterfaceDecl *UnknownObjCClass, const ObjCPropertyDecl *ObjCProperty, bool ObjCPropertyAccess) {\n case AR_Unavailable:\n if (auto AL = OffendingDecl->getAttr<UnavailableAttr>()) {\n if (AL->isImplicit() && AL->getImplicitReason()) {\n case UnavailableAttr::IR_ARCForbiddenType:\n diag_available_here = diag::note_arc_forbidden_type;"}} | ||
}, | }, | ||
["note_arc_gained_method_convention"]={ | ["note_arc_gained_method_convention"]={ | ||
Line 477: | Line 477: | ||
[c]="ARC Semantic Issue", | [c]="ARC Semantic Issue", | ||
[m]={Ib,1308178962,Hb}, | [m]={Ib,1308178962,Hb}, | ||
[n]={{E, | [n]={{E,2531,"/// In ARC, check whether the conventional meanings of the two methods\n/// match. If they don\'t, it\'s a hard error.\nstatic bool checkMethodFamilyMismatch(Sema &S, ObjCMethodDecl *impl, ObjCMethodDecl *decl) {\n if (declFamily == OMF_None) {\n noteID = diag::note_arc_gained_method_convention;"}} | ||
}, | }, | ||
["note_arc_init_returns_unrelated"]={ | ["note_arc_init_returns_unrelated"]={ | ||
Line 489: | Line 489: | ||
[c]=mc, | [c]=mc, | ||
[m]={lc,1446008599,kc}, | [m]={lc,1446008599,kc}, | ||
[n]={{V, | [n]={{V,487,"/// Actually emit an availability diagnostic for a reference to an unavailable\n/// decl.\n///\n/// \\param Ctx The context that the reference occurred in\n/// \\param ReferringDecl The exact declaration that was referenced.\n/// \\param OffendingDecl A related decl to \\c ReferringDecl that has an\n/// availability attribute corresponding to \\c K attached to it. Note that this\n/// may not be the same as ReferringDecl, i.e. if an EnumDecl is annotated and\n/// we refer to a member EnumConstantDecl, ReferringDecl is the EnumConstantDecl\n/// and OffendingDecl is the EnumDecl.\nstatic void DoEmitAvailabilityWarning(Sema &S, AvailabilityResult K, Decl *Ctx, const NamedDecl *ReferringDecl, const NamedDecl *OffendingDecl, StringRef Message, ArrayRef<SourceLocation> Locs, const ObjCInterfaceDecl *UnknownObjCClass, const ObjCPropertyDecl *ObjCProperty, bool ObjCPropertyAccess) {\n case AR_Unavailable:\n if (auto AL = OffendingDecl->getAttr<UnavailableAttr>()) {\n if (AL->isImplicit() && AL->getImplicitReason()) {\n case UnavailableAttr::IR_ARCInitReturnsUnrelated:\n diag_available_here = diag::note_arc_init_returns_unrelated;"}} | ||
}, | }, | ||
["note_arc_lost_method_convention"]={ | ["note_arc_lost_method_convention"]={ | ||
Line 501: | Line 501: | ||
[c]="ARC Semantic Issue", | [c]="ARC Semantic Issue", | ||
[m]={Ib,1308178962,Hb}, | [m]={Ib,1308178962,Hb}, | ||
[n]={{E, | [n]={{E,2526,"/// In ARC, check whether the conventional meanings of the two methods\n/// match. If they don\'t, it\'s a hard error.\nstatic bool checkMethodFamilyMismatch(Sema &S, ObjCMethodDecl *impl, ObjCMethodDecl *decl) {\n unsigned noteID = diag::note_arc_lost_method_convention;"}} | ||
}, | }, | ||
["note_arc_retain_cycle_owner"]={ | ["note_arc_retain_cycle_owner"]={ | ||
Line 513: | Line 513: | ||
[c]="ARC Retain Cycle", | [c]="ARC Retain Cycle", | ||
[m]={Ib,1308178962,Hb}, | [m]={Ib,1308178962,Hb}, | ||
[n]={{y, | [n]={{y,17475,"static void diagnoseRetainCycle(Sema &S, Expr *capturer, RetainCycleOwner &owner) {\n S.Diag(owner.Loc, diag::note_arc_retain_cycle_owner) << owner.Indirect << owner.Range;"}} | ||
}, | }, | ||
["note_arc_weak_also_accessed_here"]={ | ["note_arc_weak_also_accessed_here"]={ | ||
Line 525: | Line 525: | ||
[c]=o, | [c]=o, | ||
[m]={"d393458c3316",1348870890,"Add a warning (off by default) for repeated use of the same weak property."}, | [m]={"d393458c3316",1348870890,"Add a warning (off by default) for repeated use of the same weak property."}, | ||
[n]={{Z, | [n]={{Z,1512,"static void diagnoseRepeatedUseOfWeak(Sema &S, const sema::FunctionScopeInfo *CurFn, const Decl *D, const ParentMap &PM) {\n // Iterate through the sorted problems and emit warnings for each.\n for (const auto &P : UsesByStmt) {\n // Print all the other accesses as notes.\n for (const auto &Use : Uses) {\n S.Diag(Use.getUseExpr()->getBeginLoc(), diag::note_arc_weak_also_accessed_here) << Use.getUseExpr()->getSourceRange();"}} | ||
}, | }, | ||
["note_arc_weak_disabled"]={ | ["note_arc_weak_disabled"]={ | ||
Line 537: | Line 537: | ||
[c]=mc, | [c]=mc, | ||
[m]={lc,1446008599,kc}, | [m]={lc,1446008599,kc}, | ||
[n]={{V, | [n]={{V,475,"/// Actually emit an availability diagnostic for a reference to an unavailable\n/// decl.\n///\n/// \\param Ctx The context that the reference occurred in\n/// \\param ReferringDecl The exact declaration that was referenced.\n/// \\param OffendingDecl A related decl to \\c ReferringDecl that has an\n/// availability attribute corresponding to \\c K attached to it. Note that this\n/// may not be the same as ReferringDecl, i.e. if an EnumDecl is annotated and\n/// we refer to a member EnumConstantDecl, ReferringDecl is the EnumConstantDecl\n/// and OffendingDecl is the EnumDecl.\nstatic void DoEmitAvailabilityWarning(Sema &S, AvailabilityResult K, Decl *Ctx, const NamedDecl *ReferringDecl, const NamedDecl *OffendingDecl, StringRef Message, ArrayRef<SourceLocation> Locs, const ObjCInterfaceDecl *UnknownObjCClass, const ObjCPropertyDecl *ObjCProperty, bool ObjCPropertyAccess) {\n case AR_Unavailable:\n if (auto AL = OffendingDecl->getAttr<UnavailableAttr>()) {\n if (AL->isImplicit() && AL->getImplicitReason()) {\n case UnavailableAttr::IR_ForbiddenWeak:\n if (S.getLangOpts().ObjCWeakRuntime)\n diag_available_here = diag::note_arc_weak_disabled;"}} | ||
}, | }, | ||
["note_arc_weak_no_runtime"]={ | ["note_arc_weak_no_runtime"]={ | ||
Line 549: | Line 549: | ||
[c]=mc, | [c]=mc, | ||
[m]={lc,1446008599,kc}, | [m]={lc,1446008599,kc}, | ||
[n]={{V, | [n]={{V,477,"/// Actually emit an availability diagnostic for a reference to an unavailable\n/// decl.\n///\n/// \\param Ctx The context that the reference occurred in\n/// \\param ReferringDecl The exact declaration that was referenced.\n/// \\param OffendingDecl A related decl to \\c ReferringDecl that has an\n/// availability attribute corresponding to \\c K attached to it. Note that this\n/// may not be the same as ReferringDecl, i.e. if an EnumDecl is annotated and\n/// we refer to a member EnumConstantDecl, ReferringDecl is the EnumConstantDecl\n/// and OffendingDecl is the EnumDecl.\nstatic void DoEmitAvailabilityWarning(Sema &S, AvailabilityResult K, Decl *Ctx, const NamedDecl *ReferringDecl, const NamedDecl *OffendingDecl, StringRef Message, ArrayRef<SourceLocation> Locs, const ObjCInterfaceDecl *UnknownObjCClass, const ObjCPropertyDecl *ObjCProperty, bool ObjCPropertyAccess) {\n case AR_Unavailable:\n if (auto AL = OffendingDecl->getAttr<UnavailableAttr>()) {\n if (AL->isImplicit() && AL->getImplicitReason()) {\n case UnavailableAttr::IR_ForbiddenWeak:\n if (S.getLangOpts().ObjCWeakRuntime)\n else\n diag_available_here = diag::note_arc_weak_no_runtime;"}} | ||
}, | }, | ||
["note_array_declared_here"]={ | ["note_array_declared_here"]={ | ||
Line 561: | Line 561: | ||
[c]=o, | [c]=o, | ||
[m]={Ab,1567434909,Cb}, | [m]={Ab,1567434909,Cb}, | ||
[n]={{y, | [n]={{y,17103,"void Sema::CheckArrayAccess(const Expr *BaseExpr, const Expr *IndexExpr, const ArraySubscriptExpr *ASE, bool AllowOnePastEnd, bool IndexNegated) {\n if (IsUnboundedArray) {\n if (index.isUnsigned() || !index.isNegative()) {\n if (ND)\n DiagRuntimeBehavior(ND->getBeginLoc(), BaseExpr, PDiag(diag::note_array_declared_here) << ND);"},{y,17200,"void Sema::CheckArrayAccess(const Expr *BaseExpr, const Expr *IndexExpr, const ArraySubscriptExpr *ASE, bool AllowOnePastEnd, bool IndexNegated) {\n if (ND)\n DiagRuntimeBehavior(ND->getBeginLoc(), BaseExpr, PDiag(diag::note_array_declared_here) << ND);"},{r,11333,"static void DiagnoseDivisionSizeofPointerOrArray(Sema &S, Expr *LHS, Expr *RHS, SourceLocation Loc) {\n if (LHSTy->isPointerType() && !RHSTy->isPointerType()) {\n } else if (const auto *ArrayTy = S.Context.getAsArrayType(LHSTy)) {\n if (const auto *DRE = dyn_cast<DeclRefExpr>(LHSArg)) {\n if (const ValueDecl *LHSArgDecl = DRE->getDecl())\n S.Diag(LHSArgDecl->getLocation(), diag::note_array_declared_here) << LHSArgDecl;"}} | ||
}, | }, | ||
["note_array_init_plain_string_into_char8_t"]={ | ["note_array_init_plain_string_into_char8_t"]={ | ||
Line 573: | Line 573: | ||
[c]=o, | [c]=o, | ||
[m]={"3a8244df6fb8",1525150965,"Implement P0482R2, support for char8_t type."}, | [m]={"3a8244df6fb8",1525150965,"Implement P0482R2, support for char8_t type."}, | ||
[n]={{D, | [n]={{D,9600,"bool InitializationSequence::Diagnose(Sema &S, const InitializedEntity &Entity, const InitializationKind &Kind, ArrayRef<Expr *> Args) {\n case FK_PlainStringIntoUTF8Char:\n S.Diag(Args.front()->getBeginLoc(), diag::note_array_init_plain_string_into_char8_t) << FixItHint::CreateInsertion(Args.front()->getBeginLoc(), \"u8\");"}} | ||
}, | }, | ||
["note_array_size_conversion"]={ | ["note_array_size_conversion"]={ | ||
Line 585: | Line 585: | ||
[c]=o, | [c]=o, | ||
[m]={"4799d03ce841",1277857243,"Implement C++ DR299, which allows an implicit conversion from a class"}, | [m]={"4799d03ce841",1277857243,"Implement C++ DR299, which allows an implicit conversion from a class"}, | ||
[n]={{K, | [n]={{K,2166,"ExprResult Sema::BuildCXXNew(SourceRange Range, bool UseGlobal, SourceLocation PlacementLParen, MultiExprArg PlacementArgs, SourceLocation PlacementRParen, SourceRange TypeIdParens, QualType AllocType, TypeSourceInfo *AllocTypeInfo, std::optional<Expr *> ArraySize, SourceRange DirectInitRange, Expr *Initializer) {\n if (ArraySize && *ArraySize && !(*ArraySize)->isTypeDependent()) {\n if (getLangOpts().CPlusPlus14) {\n } else {\n class SizeConvertDiagnoser : public ICEConvertDiagnoser {\n SemaDiagnosticBuilder noteExplicitConv(Sema &S, CXXConversionDecl *Conv, QualType ConvTy) override { return S.Diag(Conv->getLocation(), diag::note_array_size_conversion) << ConvTy->isEnumeralType() << ConvTy; }"},{K,2177,"ExprResult Sema::BuildCXXNew(SourceRange Range, bool UseGlobal, SourceLocation PlacementLParen, MultiExprArg PlacementArgs, SourceLocation PlacementRParen, SourceRange TypeIdParens, QualType AllocType, TypeSourceInfo *AllocTypeInfo, std::optional<Expr *> ArraySize, SourceRange DirectInitRange, Expr *Initializer) {\n if (ArraySize && *ArraySize && !(*ArraySize)->isTypeDependent()) {\n if (getLangOpts().CPlusPlus14) {\n } else {\n class SizeConvertDiagnoser : public ICEConvertDiagnoser {\n SemaDiagnosticBuilder noteAmbiguous(Sema &S, CXXConversionDecl *Conv, QualType ConvTy) override { return S.Diag(Conv->getLocation(), diag::note_array_size_conversion) << ConvTy->isEnumeralType() << ConvTy; }"}} | ||
}, | }, | ||
["note_asm_input_duplicate_first"]={ | ["note_asm_input_duplicate_first"]={ | ||
Line 597: | Line 597: | ||
[c]="Inline Assembly Issue", | [c]="Inline Assembly Issue", | ||
[m]={"8e261be91106",1442846460,"Fix assertion in inline assembler IR gen"}, | [m]={"8e261be91106",1442846460,"Fix assertion in inline assembler IR gen"}, | ||
[n]={{Tb, | [n]={{Tb,609,"StmtResult Sema::ActOnGCCAsmStmt(SourceLocation AsmLoc, bool IsSimple, bool IsVolatile, unsigned NumOutputs, unsigned NumInputs, IdentifierInfo **Names, MultiExprArg constraints, MultiExprArg Exprs, Expr *asmString, MultiExprArg clobbers, unsigned NumLabels, SourceLocation RParenLoc) {\n for (unsigned i = 0, e = InputConstraintInfos.size(); i != e; ++i) {\n if (InputMatchedToOutput[TiedTo] != ~0U) {\n targetDiag(NS->getInputExpr(InputMatchedToOutput[TiedTo])->getBeginLoc(), diag::note_asm_input_duplicate_first) << TiedTo;"}} | ||
}, | }, | ||
["note_asm_missing_constraint_modifier"]={ | ["note_asm_missing_constraint_modifier"]={ | ||
Line 609: | Line 609: | ||
[c]="Inline Assembly Issue", | [c]="Inline Assembly Issue", | ||
[m]={"987f1864caeb",1408687521,"[AArch64, inline-asm] Improve diagnostic that is printed when the size of a"}, | [m]={"987f1864caeb",1408687521,"[AArch64, inline-asm] Improve diagnostic that is printed when the size of a"}, | ||
[n]={{Tb, | [n]={{Tb,554,"StmtResult Sema::ActOnGCCAsmStmt(SourceLocation AsmLoc, bool IsSimple, bool IsVolatile, unsigned NumOutputs, unsigned NumInputs, IdentifierInfo **Names, MultiExprArg constraints, MultiExprArg Exprs, Expr *asmString, MultiExprArg clobbers, unsigned NumLabels, SourceLocation RParenLoc) {\n // Validate constraints and modifiers.\n for (unsigned i = 0, e = Pieces.size(); i != e; ++i) {\n if (!Context.getTargetInfo().validateConstraintModifier(Literal->getString(), Piece.getModifier(), Size, SuggestedModifier)) {\n if (!SuggestedModifier.empty()) {\n auto B = targetDiag(Piece.getRange().getBegin(), diag::note_asm_missing_constraint_modifier) << SuggestedModifier;"}} | ||
}, | }, | ||
["note_assign_lhs_incomplete"]={ | ["note_assign_lhs_incomplete"]={ | ||
Line 621: | Line 621: | ||
[c]=o, | [c]=o, | ||
[m]={"a31efa07ff70",1377722135,"Improve error for assignment to incomplete class."}, | [m]={"a31efa07ff70",1377722135,"Improve error for assignment to incomplete class."}, | ||
[n]={{P, | [n]={{P,14260,"/// Create a binary operation that may resolve to an overloaded\n/// operator.\n///\n/// \\param OpLoc The location of the operator itself (e.g., \'+\').\n///\n/// \\param Opc The BinaryOperatorKind that describes this operator.\n///\n/// \\param Fns The set of non-member functions that will be\n/// considered by overload resolution. The caller needs to build this\n/// set based on the context using, e.g.,\n/// LookupOverloadedOperatorName() and ArgumentDependentLookup(). This\n/// set should not contain any member functions; those will be added\n/// by CreateOverloadedBinOp().\n///\n/// \\param LHS Left-hand argument.\n/// \\param RHS Right-hand argument.\n/// \\param PerformADL Whether to consider operator candidates found by ADL.\n/// \\param AllowRewrittenCandidates Whether to consider candidates found by\n/// C++20 operator rewrites.\n/// \\param DefaultedFn If we are synthesizing a defaulted operator function,\n/// the function in question. Such a function is never a candidate in\n/// our overload resolution. This also enables synthesizing a three-way\n/// comparison from < and == as described in C++20 [class.spaceship]p1.\nExprResult Sema::CreateOverloadedBinOp(SourceLocation OpLoc, BinaryOperatorKind Opc, const UnresolvedSetImpl &Fns, Expr *LHS, Expr *RHS, bool PerformADL, bool AllowRewrittenCandidates, FunctionDecl *DefaultedFn) {\n case OR_No_Viable_Function: {\n if (Args[0]->getType()->isRecordType() && Opc >= BO_Assign && Opc <= BO_OrAssign) {\n if (Args[0]->getType()->isIncompleteType()) {\n Diag(OpLoc, diag::note_assign_lhs_incomplete) << Args[0]->getType() << Args[0]->getSourceRange() << Args[1]->getSourceRange();"}} | ||
}, | }, | ||
["note_atomic_constraint_evaluated_to_false"]={ | ["note_atomic_constraint_evaluated_to_false"]={ | ||
Line 633: | Line 633: | ||
[c]=o, | [c]=o, | ||
[m]={Rb,1569403888,Nb}, | [m]={Rb,1569403888,Nb}, | ||
[n]={{O, | [n]={{O,1134,"static void diagnoseWellFormedUnsatisfiedConstraintExpr(Sema &S, Expr *SubstExpr, bool First) {\n S.Diag(SubstExpr->getSourceRange().getBegin(), diag::note_atomic_constraint_evaluated_to_false) << (int)First << SubstExpr;"}} | ||
}, | }, | ||
["note_atomic_constraint_evaluated_to_false_elaborated"]={ | ["note_atomic_constraint_evaluated_to_false_elaborated"]={ | ||
Line 645: | Line 645: | ||
[c]=o, | [c]=o, | ||
[m]={Rb,1569403888,Nb}, | [m]={Rb,1569403888,Nb}, | ||
[n]={{O, | [n]={{O,1078,"static void diagnoseWellFormedUnsatisfiedConstraintExpr(Sema &S, Expr *SubstExpr, bool First) {\n if (BinaryOperator *BO = dyn_cast<BinaryOperator>(SubstExpr)) {\n case BO_NE:\n if (BO->getLHS()->getType()->isIntegerType() && BO->getRHS()->getType()->isIntegerType()) {\n if (!SimplifiedLHS.Diag && !SimplifiedRHS.Diag) {\n S.Diag(SubstExpr->getBeginLoc(), diag::note_atomic_constraint_evaluated_to_false_elaborated) << (int)First << SubstExpr << toString(SimplifiedLHS.Val.getInt(), 10) << BinaryOperator::getOpcodeStr(BO->getOpcode()) << toString(SimplifiedRHS.Val.getInt(), 10);"}} | ||
}, | }, | ||
["note_atomic_property_fixup_suggest"]={ | ["note_atomic_property_fixup_suggest"]={ | ||
Line 657: | Line 657: | ||
[c]=o, | [c]=o, | ||
[m]={"9cd57a7061c8",1317944878,"objc: Improve on diagnostic when atomic proeprty is synthesized"}, | [m]={"9cd57a7061c8",1317944878,"objc: Improve on diagnostic when atomic proeprty is synthesized"}, | ||
[n]={{N, | [n]={{N,2240,"void Sema::AtomicPropertySetterGetterRules(ObjCImplDecl *IMPDecl, ObjCInterfaceDecl *IDecl) {\n for (ObjCContainerDecl::PropertyMap::iterator I = PM.begin(), E = PM.end(); I != E; ++I) {\n if (const ObjCPropertyImplDecl *PIDecl = IMPDecl->FindPropertyImplDecl(Property->getIdentifier(), Property->getQueryKind())) {\n if ((bool)GetterMethod ^ (bool)SetterMethod) {\n // fixit stuff.\n if (Property->getLParenLoc().isValid() && !(AttributesAsWritten & ObjCPropertyAttribute::kind_atomic)) {\n Diag(Property->getLocation(), diag::note_atomic_property_fixup_suggest) << FixItHint::CreateInsertion(AfterLParen, NonatomicStr);"},{N,2247,"void Sema::AtomicPropertySetterGetterRules(ObjCImplDecl *IMPDecl, ObjCInterfaceDecl *IDecl) {\n for (ObjCContainerDecl::PropertyMap::iterator I = PM.begin(), E = PM.end(); I != E; ++I) {\n if (const ObjCPropertyImplDecl *PIDecl = IMPDecl->FindPropertyImplDecl(Property->getIdentifier(), Property->getQueryKind())) {\n if ((bool)GetterMethod ^ (bool)SetterMethod) {\n // fixit stuff.\n if (Property->getLParenLoc().isValid() && !(AttributesAsWritten & ObjCPropertyAttribute::kind_atomic)) {\n } else if (Property->getLParenLoc().isInvalid()) {\n Diag(Property->getLocation(), diag::note_atomic_property_fixup_suggest) << FixItHint::CreateInsertion(startLoc, \"(nonatomic) \");"},{N,2250,"void Sema::AtomicPropertySetterGetterRules(ObjCImplDecl *IMPDecl, ObjCInterfaceDecl *IDecl) {\n for (ObjCContainerDecl::PropertyMap::iterator I = PM.begin(), E = PM.end(); I != E; ++I) {\n if (const ObjCPropertyImplDecl *PIDecl = IMPDecl->FindPropertyImplDecl(Property->getIdentifier(), Property->getQueryKind())) {\n if ((bool)GetterMethod ^ (bool)SetterMethod) {\n // fixit stuff.\n if (Property->getLParenLoc().isValid() && !(AttributesAsWritten & ObjCPropertyAttribute::kind_atomic)) {\n } else if (Property->getLParenLoc().isInvalid()) {\n } else\n Diag(MethodLoc, diag::note_atomic_property_fixup_suggest);"}} | ||
}, | }, | ||
["note_attribute"]={ | ["note_attribute"]={ | ||
Line 669: | Line 669: | ||
[c]=o, | [c]=o, | ||
[m]={"078d2f89cd6a",1401382220,"Sema: Check dll attributes on static data members"}, | [m]={"078d2f89cd6a",1401382220,"Sema: Check dll attributes on static data members"}, | ||
[n]={{t, | [n]={{t,7131,"static void checkDLLAttributeRedeclaration(Sema &S, NamedDecl *OldDecl, NamedDecl *NewDecl, bool IsSpecialization, bool IsDefinition) {\n if (OldImportAttr && !HasNewAttr && (!IsInline || (IsMicrosoftABI && IsTemplate)) && !IsStaticDataMember && !NewDecl->isLocalExternDecl() && !IsQualifiedFriend) {\n if (IsMicrosoftABI && IsDefinition) {\n if (IsSpecialization) {\n S.Diag(OldImportAttr->getLocation(), diag::note_attribute);"},{t,14447,"/// FinalizeDeclaration - called by ParseDeclarationAfterDeclarator to perform\n/// any semantic actions necessary after any initializer has been attached.\nvoid Sema::FinalizeDeclaration(Decl *ThisDecl) {\n // Imported static data members cannot be defined out-of-line.\n if (const auto *IA = dyn_cast_or_null<DLLImportAttr>(DLLAttr)) {\n if (VD->isStaticDataMember() && VD->isOutOfLine() && VD->isThisDeclarationADefinition()) {\n Diag(IA->getLocation(), diag::note_attribute);"},{t,15936,"Decl *Sema::ActOnFinishFunctionBody(Decl *dcl, Stmt *Body, bool IsInstantiation) {\n {\n // Verify and clean out per-function state.\n if (Body && (!FD || !FD->isDefaulted())) {\n if (FD && FD->hasAttr<NakedAttr>()) {\n for (const Stmt *S : Body->children()) {\n if (!isa<AsmStmt>(S) && !isa<NullStmt>(S)) {\n Diag(FD->getAttr<NakedAttr>()->getLocation(), diag::note_attribute);"},{q,6658,"/// Perform propagation of DLL attributes from a derived class to a\n/// templated base class for MS compatibility.\nvoid Sema::propagateDLLAttrToBaseClassTemplate(CXXRecordDecl *Class, Attr *ClassAttr, ClassTemplateSpecializationDecl *BaseTemplateSpec, SourceLocation BaseLoc) {\n Diag(ClassAttr->getLocation(), diag::note_attribute);"},{Tb,144,"static bool CheckNakedParmReference(Expr *E, Sema &S) {\n while (WorkList.size()) {\n if (isa<CXXThisExpr>(E)) {\n S.Diag(Func->getAttr<NakedAttr>()->getLocation(), diag::note_attribute);"},{Tb,150,"static bool CheckNakedParmReference(Expr *E, Sema &S) {\n while (WorkList.size()) {\n if (DeclRefExpr *DRE = dyn_cast<DeclRefExpr>(E)) {\n if (isa<ParmVarDecl>(DRE->getDecl())) {\n S.Diag(Func->getAttr<NakedAttr>()->getLocation(), diag::note_attribute);"},{u,9996,"// Explicit instantiation of a class template specialization\nDeclResult Sema::ActOnExplicitInstantiation(Scope *S, SourceLocation ExternLoc, SourceLocation TemplateLoc, unsigned TagSpec, SourceLocation KWLoc, const CXXScopeSpec &SS, TemplateTy TemplateD, SourceLocation TemplateNameLoc, SourceLocation LAngleLoc, ASTTemplateArgsPtr TemplateArgsIn, SourceLocation RAngleLoc, const ParsedAttributesView &Attr) {\n if (TSK == TSK_ExplicitInstantiationDeclaration && !Context.getTargetInfo().getTriple().isWindowsGNUEnvironment()) {\n // Check for dllexport class template instantiation declarations,\n // except for MinGW mode.\n for (const ParsedAttr &AL : Attr) {\n if (AL.getKind() == ParsedAttr::AT_DLLExport) {\n Diag(AL.getLoc(), diag::note_attribute);"},{u,10004,"// Explicit instantiation of a class template specialization\nDeclResult Sema::ActOnExplicitInstantiation(Scope *S, SourceLocation ExternLoc, SourceLocation TemplateLoc, unsigned TagSpec, SourceLocation KWLoc, const CXXScopeSpec &SS, TemplateTy TemplateD, SourceLocation TemplateNameLoc, SourceLocation LAngleLoc, ASTTemplateArgsPtr TemplateArgsIn, SourceLocation RAngleLoc, const ParsedAttributesView &Attr) {\n if (TSK == TSK_ExplicitInstantiationDeclaration && !Context.getTargetInfo().getTriple().isWindowsGNUEnvironment()) {\n if (auto *A = ClassTemplate->getTemplatedDecl()->getAttr<DLLExportAttr>()) {\n Diag(A->getLocation(), diag::note_attribute);"}} | ||
}, | }, | ||
["note_attribute_has_no_effect_on_compile_time_if_here"]={ | ["note_attribute_has_no_effect_on_compile_time_if_here"]={ | ||
Line 681: | Line 681: | ||
[c]=o, | [c]=o, | ||
[m]={Pb,1615397021,Ob}, | [m]={Pb,1615397021,Ob}, | ||
[n]={{A, | [n]={{A,912,"StmtResult Sema::ActOnIfStmt(SourceLocation IfLoc, IfStatementKind StatementKind, SourceLocation LParenLoc, Stmt *InitStmt, ConditionResult Cond, SourceLocation RParenLoc, Stmt *thenStmt, SourceLocation ElseLoc, Stmt *elseStmt) {\n if (ConstevalOrNegatedConsteval || StatementKind == IfStatementKind::Constexpr) {\n auto DiagnoseLikelihood = [&](const Stmt *S) {\n if (const Attr *A = Stmt::getLikelihoodAttr(S)) {\n Diags.Report(IfLoc, diag::note_attribute_has_no_effect_on_compile_time_if_here) << ConstevalOrNegatedConsteval << SourceRange(IfLoc, (ConstevalOrNegatedConsteval ? thenStmt->getBeginLoc() : LParenLoc).getLocWithOffset(-1));"}} | ||
}, | }, | ||
["note_attribute_has_no_effect_on_infinite_loop_here"]={ | ["note_attribute_has_no_effect_on_infinite_loop_here"]={ | ||
Line 693: | Line 693: | ||
[c]=o, | [c]=o, | ||
[m]={T,1590001902,S}, | [m]={T,1590001902,S}, | ||
[n]={{"clang/lib/CodeGen/CGStmt.cpp", | [n]={{"clang/lib/CodeGen/CGStmt.cpp",937,"void CodeGenFunction::EmitWhileStmt(const WhileStmt &S, ArrayRef<const Attr *> WhileAttrs) {\n if (EmitBoolCondBranch) {\n } else if (const Attr *A = Stmt::getLikelihoodAttr(S.getBody())) {\n CGM.getDiags().Report(S.getWhileLoc(), diag::note_attribute_has_no_effect_on_infinite_loop_here) << SourceRange(S.getWhileLoc(), S.getRParenLoc());"}} | ||
}, | }, | ||
["note_attribute_overloadable_prev_overload"]={ | ["note_attribute_overloadable_prev_overload"]={ | ||
Line 705: | Line 705: | ||
[c]=o, | [c]=o, | ||
[m]={wb,1236199783,vb}, | [m]={wb,1236199783,vb}, | ||
[n]={{t, | [n]={{t,3752,"/// MergeFunctionDecl - We just parsed a function \'New\' from\n/// declarator D which has the same name and scope as a previous\n/// declaration \'Old\'. Figure out how to resolve this situation,\n/// merging decls or emitting diagnostics as appropriate.\n///\n/// In C++, New and Old must be declarations that are not\n/// overloaded. Use IsOverload to determine whether New and Old are\n/// overloaded, and to select the Old declaration that New should be\n/// merged with.\n///\n/// Returns true if there was an error, false otherwise.\nbool Sema::MergeFunctionDecl(FunctionDecl *New, NamedDecl *&OldD, Scope *S, bool MergeTypeWithOld, bool NewDeclIsDefn) {\n if (!getLangOpts().CPlusPlus) {\n if (OldOvl != New->hasAttr<OverloadableAttr>() && !Old->isImplicit()) {\n if (DiagOld)\n Diag(DiagOld->getLocation(), diag::note_attribute_overloadable_prev_overload) << OldOvl;"},{t,11889,"/// Perform semantic checking of a new function declaration.\n///\n/// Performs semantic analysis of the new function declaration\n/// NewFD. This routine performs all semantic checking that does not\n/// require the actual declarator involved in the declaration, and is\n/// used both for the declaration of functions as they are parsed\n/// (called via ActOnDeclarator) and for the declaration of functions\n/// that have been instantiated via C++ template instantiation (called\n/// via InstantiateDecl).\n///\n/// \\param IsMemberSpecialization whether this new function declaration is\n/// a member specialization (that replaces any definition provided by the\n/// previous declaration).\n///\n/// This sets NewFD->isInvalidDecl() to true if there was an error.\n///\n/// \\returns true if the function declaration is a redeclaration.\nbool Sema::CheckFunctionDeclaration(Scope *S, FunctionDecl *NewFD, LookupResult &Previous, bool IsMemberSpecialization, bool DeclIsDefn) {\n if (Redeclaration) {\n } else if (!getLangOpts().CPlusPlus && MayNeedOverloadableChecks && !NewFD->getAttr<OverloadableAttr>()) {\n if (OtherUnmarkedIter != Previous.end()) {\n Diag((*OtherUnmarkedIter)->getLocation(), diag::note_attribute_overloadable_prev_overload) << false;"}} | ||
}, | }, | ||
["note_auto_readonly_iboutlet_fixup_suggest"]={ | ["note_auto_readonly_iboutlet_fixup_suggest"]={ | ||
Line 717: | Line 717: | ||
[c]=o, | [c]=o, | ||
[m]={"199a9b57a6bb",1337451437,"objective-c: Warn if default synthesizing readonly IBOutlet properties"}, | [m]={"199a9b57a6bb",1337451437,"objective-c: Warn if default synthesizing readonly IBOutlet properties"}, | ||
[n]={{N, | [n]={{N,1165,"/// ActOnPropertyImplDecl - This routine performs semantic checks and\n/// builds the AST node for a property implementation declaration; declared\n/// as \\@synthesize or \\@dynamic.\n///\nDecl *Sema::ActOnPropertyImplDecl(Scope *S, SourceLocation AtLoc, SourceLocation PropertyLoc, bool Synthesize, IdentifierInfo *PropertyId, IdentifierInfo *PropertyIvar, SourceLocation PropertyIvarLoc, ObjCPropertyQueryKind QueryKind) {\n if ((IC = dyn_cast<ObjCImplementationDecl>(ClassImpDecl))) {\n if (Synthesize && (PIkind & ObjCPropertyAttribute::kind_readonly) && property->hasAttr<IBOutletAttr>() && !AtLoc.isValid()) {\n if (!ReadWriteProperty) {\n if (LocPropertyAttribute(Context, \"readonly\", property->getLParenLoc(), readonlyLoc)) {\n Diag(property->getLocation(), diag::note_auto_readonly_iboutlet_fixup_suggest) << FixItHint::CreateReplacement(ReadonlySourceRange, \"readwrite\");"}} | ||
}, | }, | ||
["note_availability_specified_here"]={ | ["note_availability_specified_here"]={ | ||
Line 729: | Line 729: | ||
[c]=o, | [c]=o, | ||
[m]={"b79ee57080fa",1387409406,"Implemented delayed processing of \'unavailable\' checking, just like with \'deprecated\'."}, | [m]={"b79ee57080fa",1387409406,"Implemented delayed processing of \'unavailable\' checking, just like with \'deprecated\'."}, | ||
[n]={{V, | [n]={{V,337,"/// Actually emit an availability diagnostic for a reference to an unavailable\n/// decl.\n///\n/// \\param Ctx The context that the reference occurred in\n/// \\param ReferringDecl The exact declaration that was referenced.\n/// \\param OffendingDecl A related decl to \\c ReferringDecl that has an\n/// availability attribute corresponding to \\c K attached to it. Note that this\n/// may not be the same as ReferringDecl, i.e. if an EnumDecl is annotated and\n/// we refer to a member EnumConstantDecl, ReferringDecl is the EnumConstantDecl\n/// and OffendingDecl is the EnumDecl.\nstatic void DoEmitAvailabilityWarning(Sema &S, AvailabilityResult K, Decl *Ctx, const NamedDecl *ReferringDecl, const NamedDecl *OffendingDecl, StringRef Message, ArrayRef<SourceLocation> Locs, const ObjCInterfaceDecl *UnknownObjCClass, const ObjCPropertyDecl *ObjCProperty, bool ObjCPropertyAccess) {\n unsigned diag_available_here = diag::note_availability_specified_here;"},{V,343,"/// Actually emit an availability diagnostic for a reference to an unavailable\n/// decl.\n///\n/// \\param Ctx The context that the reference occurred in\n/// \\param ReferringDecl The exact declaration that was referenced.\n/// \\param OffendingDecl A related decl to \\c ReferringDecl that has an\n/// availability attribute corresponding to \\c K attached to it. Note that this\n/// may not be the same as ReferringDecl, i.e. if an EnumDecl is annotated and\n/// we refer to a member EnumConstantDecl, ReferringDecl is the EnumConstantDecl\n/// and OffendingDecl is the EnumDecl.\nstatic void DoEmitAvailabilityWarning(Sema &S, AvailabilityResult K, Decl *Ctx, const NamedDecl *ReferringDecl, const NamedDecl *OffendingDecl, StringRef Message, ArrayRef<SourceLocation> Locs, const ObjCInterfaceDecl *UnknownObjCClass, const ObjCPropertyDecl *ObjCProperty, bool ObjCPropertyAccess) {\n // Matches diag::note_availability_specified_here."},{r,135,"/// Emit a note explaining that this function is deleted.\nvoid Sema::NoteDeletedFunction(FunctionDecl *Decl) {\n Diag(Decl->getLocation(), diag::note_availability_specified_here) << Decl << 1;"}} | ||
}, | }, | ||
["note_await_ready_no_bool_conversion"]={ | ["note_await_ready_no_bool_conversion"]={ | ||
Line 741: | Line 741: | ||
[c]=Zb, | [c]=Zb, | ||
[m]={"d978e53c6d70",1495995672,"[coroutines] Diagnose invalid result types for `await_resume` and `await_suspend` and add missing c..."}, | [m]={"d978e53c6d70",1495995672,"[coroutines] Diagnose invalid result types for `await_resume` and `await_suspend` and add missing c..."}, | ||
[n]={{L, | [n]={{L,408,"/// Build calls to await_ready, await_suspend, and await_resume for a co_await\n/// expression.\n/// The generated AST tries to clean up temporary objects as early as\n/// possible so that they don\'t live across suspension points if possible.\n/// Having temporary objects living across suspension points unnecessarily can\n/// lead to large frame size, and also lead to memory corruptions if the\n/// coroutine frame is destroyed after coming back from suspension. This is done\n/// by wrapping both the await_ready call and the await_suspend call with\n/// ExprWithCleanups. In the end of this function, we also need to explicitly\n/// set cleanup state so that the CoawaitExpr is also wrapped with an\n/// ExprWithCleanups to clean up the awaiter associated with the co_await\n/// expression.\nstatic ReadySuspendResumeResult buildCoawaitCalls(Sema &S, VarDecl *CoroPromise, SourceLocation Loc, Expr *E) {\n if (!AwaitReady->getType()->isDependentType()) {\n if (Conv.isInvalid()) {\n S.Diag(AwaitReady->getDirectCallee()->getBeginLoc(), diag::note_await_ready_no_bool_conversion);"}} | ||
}, | }, | ||
["note_bad_memaccess_silence"]={ | ["note_bad_memaccess_silence"]={ | ||
Line 753: | Line 753: | ||
[c]=o, | [c]=o, | ||
[m]={"ac6872655bc6",1307082237,"Clean up the \"non-POD memaccess\" stuff some. This adds a properly named"}, | [m]={"ac6872655bc6",1307082237,"Clean up the \"non-POD memaccess\" stuff some. This adds a properly named"}, | ||
[n]={{y, | [n]={{y,12604,"/// Check for dangerous or invalid arguments to memset().\n///\n/// This issues warnings on known problematic, dangerous or unspecified\n/// arguments to the standard \'memset\', \'memcpy\', \'memmove\', and \'memcmp\'\n/// function calls.\n///\n/// \\param Call The call expression to diagnose.\nvoid Sema::CheckMemaccessArguments(const CallExpr *Call, unsigned BId, IdentifierInfo *FnName) {\n for (unsigned ArgIdx = 0; ArgIdx != LastArg; ++ArgIdx) {\n DiagRuntimeBehavior(Dest->getExprLoc(), Dest, PDiag(diag::note_bad_memaccess_silence) << FixItHint::CreateInsertion(ArgRange.getBegin(), \"(void*)\"));"}} | ||
}, | }, | ||
["note_base_class_specified_here"]={ | ["note_base_class_specified_here"]={ | ||
Line 765: | Line 765: | ||
[c]=o, | [c]=o, | ||
[m]={"43a0857631ab",1262823985,"When we typo-correct a base class initializer, point to the base class"}, | [m]={"43a0857631ab",1262823985,"When we typo-correct a base class initializer, point to the base class"}, | ||
[n]={{q, | [n]={{q,2759,"/// Check the validity of a C++ base class specifier.\n///\n/// \\returns a new CXXBaseSpecifier if well-formed, emits diagnostics\n/// and returns NULL otherwise.\nCXXBaseSpecifier *Sema::CheckBaseSpecifier(CXXRecordDecl *Class, SourceRange SpecifierRange, bool Virtual, AccessSpecifier Access, TypeSourceInfo *TInfo, SourceLocation EllipsisLoc) {\n if ((DerivedCSA || BaseCSA) && (!BaseCSA || !DerivedCSA || BaseCSA->getName() != DerivedCSA->getName())) {\n Diag(CXXBaseDecl->getLocation(), diag::note_base_class_specified_here) << CXXBaseDecl;"},{q,4500,"/// Handle a C++ member initializer.\nMemInitResult Sema::BuildMemInitializer(Decl *ConstructorD, Scope *S, CXXScopeSpec &SS, IdentifierInfo *MemberOrBase, ParsedType TemplateTypeTy, const DeclSpec &DS, SourceLocation IdLoc, Expr *Init, SourceLocation EllipsisLoc) {\n if (TemplateTypeTy) {\n } else if (DS.getTypeSpecType() == TST_decltype) {\n } else if (DS.getTypeSpecType() == TST_decltype_auto) {\n } else {\n if (!TyD) {\n if (R.empty() && BaseType.isNull() && (Corr = CorrectTypo(R.getLookupNameInfo(), R.getLookupKind(), S, &SS, CCC, CTK_ErrorRecovery, ClassDecl))) {\n if (FieldDecl *Member = Corr.getCorrectionDeclAs<FieldDecl>()) {\n } else if (TypeDecl *Type = Corr.getCorrectionDeclAs<TypeDecl>()) {\n if (FindBaseInitializer(*this, ClassDecl, Context.getTypeDeclType(Type), DirectBaseSpec, VirtualBaseSpec)) {\n Diag(BaseSpec->getBeginLoc(), diag::note_base_class_specified_here) << BaseSpec->getType() << BaseSpec->getSourceRange();"}} | ||
}, | }, | ||
["note_bitfield_decl"]={ | ["note_bitfield_decl"]={ | ||
Line 777: | Line 777: | ||
[c]=o, | [c]=o, | ||
[m]={"3e1e52782604",1260399737,"Reimplement reference initialization (C++ [dcl.init.ref]) using the"}, | [m]={"3e1e52782604",1260399737,"Reimplement reference initialization (C++ [dcl.init.ref]) using the"}, | ||
[n]={{r, | [n]={{r,16704,"ExprResult Sema::BuildBuiltinOffsetOf(SourceLocation BuiltinLoc, TypeSourceInfo *TInfo, ArrayRef<OffsetOfComponent> Components, SourceLocation RParenLoc) {\n for (const OffsetOfComponent &OC : Components) {\n // C99 7.17p3:\n // (If the specified member is a bit-field, the behavior is undefined.)\n //\n // We diagnose this as an error.\n if (MemberDecl->isBitField()) {\n Diag(MemberDecl->getLocation(), diag::note_bitfield_decl);"},{D,9722,"bool InitializationSequence::Diagnose(Sema &S, const InitializedEntity &Entity, const InitializationKind &Kind, ArrayRef<Expr *> Args) {\n case FK_NonConstLValueReferenceBindingToBitfield: {\n if (BitField)\n S.Diag(BitField->getLocation(), diag::note_bitfield_decl);"},{Tb,956,"StmtResult Sema::ActOnMSAsmStmt(SourceLocation AsmLoc, SourceLocation LBraceLoc, ArrayRef<Token> AsmToks, StringRef AsmString, unsigned NumOutputs, unsigned NumInputs, ArrayRef<StringRef> Constraints, ArrayRef<StringRef> Clobbers, ArrayRef<Expr *> Exprs, SourceLocation EndLoc) {\n for (uint64_t I = 0; I < NumOutputs + NumInputs; ++I) {\n if (E->getType()->isBitIntType()) {\n } else if (E->refersToBitField()) {\n Diag(BitField->getLocation(), diag::note_bitfield_decl);"}} | ||
}, | }, | ||
["note_block_var_fixit_add_initialization"]={ | ["note_block_var_fixit_add_initialization"]={ | ||
Line 789: | Line 789: | ||
[c]=o, | [c]=o, | ||
[m]={"429fadb8e262",1331166170,"improve on diagnostic and provide a fixit hint when"}, | [m]={"429fadb8e262",1331166170,"improve on diagnostic and provide a fixit hint when"}, | ||
[n]={{Z, | [n]={{Z,776,"static bool SuggestInitializationFixit(Sema &S, const VarDecl *VD) {\n if (VariableTy->isBlockPointerType() && !VD->hasAttr<BlocksAttr>()) {\n S.Diag(VD->getLocation(), diag::note_block_var_fixit_add_initialization) << VD->getDeclName() << FixItHint::CreateInsertion(VD->getLocation(), \"__block \");"}} | ||
}, | }, | ||
["note_bracket_depth"]={ | ["note_bracket_depth"]={ | ||
Line 801: | Line 801: | ||
[c]=Q, | [c]=Q, | ||
[m]={"b3a145293dc8",1361498391,"Add -fbracket-depth=N, analogous to -ftemplate-depth= and -fconstexpr-depth=,"}, | [m]={"b3a145293dc8",1361498391,"Add -fbracket-depth=N, analogous to -ftemplate-depth= and -fconstexpr-depth=,"}, | ||
[n]={{"clang/lib/Parse/Parser.cpp", | [n]={{"clang/lib/Parse/Parser.cpp",2698,"bool BalancedDelimiterTracker::diagnoseOverflow() {\n P.Diag(P.Tok, diag::note_bracket_depth);"}} | ||
}, | }, | ||
["note_building_builtin_dump_struct_call"]={ | ["note_building_builtin_dump_struct_call"]={ | ||
Line 813: | Line 813: | ||
[c]=o, | [c]=o, | ||
[m]={"cb08f4aa4467",1620530452,"Support warn_unused_result on typedefs"}, | [m]={"cb08f4aa4467",1620530452,"Support warn_unused_result on typedefs"}, | ||
[n]={{z, | [n]={{z,1009,"/// Prints the current instantiation stack through a series of\n/// notes.\nvoid Sema::PrintInstantiationStack() {\n for (SmallVectorImpl<CodeSynthesisContext>::reverse_iterator Active = CodeSynthesisContexts.rbegin(), ActiveEnd = CodeSynthesisContexts.rend(); Active != ActiveEnd; ++Active, ++InstantiationIdx) {\n case CodeSynthesisContext::BuildingBuiltinDumpStructCall:\n Diags.Report(Active->PointOfInstantiation, diag::note_building_builtin_dump_struct_call) << convertCallArgsToString(*this, llvm::ArrayRef(Active->CallArgs, Active->NumCallArgs));"}} | ||
}, | }, | ||
["note_called_by"]={ | ["note_called_by"]={ | ||
Line 825: | Line 825: | ||
[c]=o, | [c]=o, | ||
[m]={"6c86e9160d9b",1476911701,"[CUDA] When we emit an error that might have been deferred, also print a callstack."}, | [m]={"6c86e9160d9b",1476911701,"[CUDA] When we emit an error that might have been deferred, also print a callstack."}, | ||
[n]={{"clang/lib/Sema/Sema.cpp", | [n]={{"clang/lib/Sema/Sema.cpp",1629,"// Print notes showing how we can reach FD starting from an a priori\n// known-callable function.\nstatic void emitCallStackNotes(Sema &S, const FunctionDecl *FD) {\n while (FnIt != S.DeviceKnownEmittedFns.end()) {\n DiagnosticBuilder Builder(S.Diags.Report(FnIt->second.Loc, diag::note_called_by));"}} | ||
}, | }, | ||
["note_called_once_gets_called_twice"]={ | ["note_called_once_gets_called_twice"]={ | ||
Line 837: | Line 837: | ||
[c]=o, | [c]=o, | ||
[m]={T,1590001902,S}, | [m]={T,1590001902,S}, | ||
[n]={{Z, | [n]={{Z,1692,"class CalledOnceCheckReporter : public CalledOnceCheckHandler {\n void handleDoubleCall(const ParmVarDecl *Parameter, const Expr *Call, const Expr *PrevCall, bool IsCompletionHandler, bool Poised) override {\n S.Diag(PrevCall->getBeginLoc(), diag::note_called_once_gets_called_twice) << Poised;"}} | ||
}, | }, | ||
["note_callee_decl"]={ | ["note_callee_decl"]={ | ||
Line 849: | Line 849: | ||
[c]=o, | [c]=o, | ||
[m]={"3bc84ca376a2",1311899082,"Fix an inconsistency in Sema::ConvertArgumentsForCall in that"}, | [m]={"3bc84ca376a2",1311899082,"Fix an inconsistency in Sema::ConvertArgumentsForCall in that"}, | ||
[n]={{r, | [n]={{r,6496,"/// ConvertArgumentsForCall - Converts the arguments specified in\n/// Args/NumArgs to the parameter types of the function FDecl with\n/// function prototype Proto. Call is the call expression itself, and\n/// Fn is the function expression. For a C++ member function, this\n/// routine does not attempt to convert the object argument. Returns\n/// true if the call is ill-formed.\nbool Sema::ConvertArgumentsForCall(CallExpr *Call, Expr *Fn, FunctionDecl *FDecl, const FunctionProtoType *Proto, ArrayRef<Expr *> Args, SourceLocation RParenLoc, bool IsExecConfig) {\n // If too few arguments are available (and we don\'t have default\n // arguments for the remaining parameters), don\'t make the call.\n if (Args.size() < NumParams) {\n if (Args.size() < MinArgs) {\n // Emit the location of the prototype.\n if (!TC && FDecl && !FDecl->getBuiltinID() && !IsExecConfig)\n Diag(FDecl->getLocation(), diag::note_callee_decl) << FDecl << FDecl->getParametersSourceRange();"},{r,6565,"/// ConvertArgumentsForCall - Converts the arguments specified in\n/// Args/NumArgs to the parameter types of the function FDecl with\n/// function prototype Proto. Call is the call expression itself, and\n/// Fn is the function expression. For a C++ member function, this\n/// routine does not attempt to convert the object argument. Returns\n/// true if the call is ill-formed.\nbool Sema::ConvertArgumentsForCall(CallExpr *Call, Expr *Fn, FunctionDecl *FDecl, const FunctionProtoType *Proto, ArrayRef<Expr *> Args, SourceLocation RParenLoc, bool IsExecConfig) {\n // If too many are passed and not variadic, error on the extras and drop\n // them.\n if (Args.size() > NumParams) {\n if (!Proto->isVariadic()) {\n // Emit the location of the prototype.\n if (!TC && FDecl && !FDecl->getBuiltinID() && !IsExecConfig)\n Diag(FDecl->getLocation(), diag::note_callee_decl) << FDecl << FDecl->getParametersSourceRange();"},{r,7363,"/// BuildResolvedCallExpr - Build a call to a resolved expression,\n/// i.e. an expression not of \\p OverloadTy. The expression should\n/// unary-convert to an expression of function-pointer or\n/// block-pointer type.\n///\n/// \\param NDecl the declaration being called, if available\nExprResult Sema::BuildResolvedCallExpr(Expr *Fn, NamedDecl *NDecl, SourceLocation LParenLoc, ArrayRef<Expr *> Args, SourceLocation RParenLoc, Expr *Config, bool IsExecConfig, ADLCallKind UsesADL) {\n // Interrupt handlers don\'t save off the VFP regs automatically on ARM,\n // so there\'s some risk when calling out to non-interrupt handler functions\n // that the callee might not preserve them. This is easy to diagnose here,\n // but can be very challenging to debug.\n // Likewise, X86 interrupt handlers may only call routines with attribute\n // no_caller_saved_registers since there is no efficient way to\n // save and restore the non-GPR state.\n if (auto *Caller = getCurFunctionDecl()) {\n if (Caller->hasAttr<ARMInterruptAttr>()) {\n if (VFP && (!FDecl || !FDecl->hasAttr<ARMInterruptAttr>())) {\n if (FDecl)\n Diag(FDecl->getLocation(), diag::note_callee_decl) << FDecl;"},{r,7402,"/// BuildResolvedCallExpr - Build a call to a resolved expression,\n/// i.e. an expression not of \\p OverloadTy. The expression should\n/// unary-convert to an expression of function-pointer or\n/// block-pointer type.\n///\n/// \\param NDecl the declaration being called, if available\nExprResult Sema::BuildResolvedCallExpr(Expr *Fn, NamedDecl *NDecl, SourceLocation LParenLoc, ArrayRef<Expr *> Args, SourceLocation RParenLoc, Expr *Config, bool IsExecConfig, ADLCallKind UsesADL) {\n // Interrupt handlers don\'t save off the VFP regs automatically on ARM,\n // so there\'s some risk when calling out to non-interrupt handler functions\n // that the callee might not preserve them. This is easy to diagnose here,\n // but can be very challenging to debug.\n // Likewise, X86 interrupt handlers may only call routines with attribute\n // no_caller_saved_registers since there is no efficient way to\n // save and restore the non-GPR state.\n if (auto *Caller = getCurFunctionDecl()) {\n if (Caller->hasAttr<AnyX86InterruptAttr>() && ((!FDecl || !FDecl->hasAttr<AnyX86NoCallerSavedRegistersAttr>()))) {\n if (FDecl)\n Diag(FDecl->getLocation(), diag::note_callee_decl) << FDecl;"},{N,1549,"/// ActOnPropertyImplDecl - This routine performs semantic checks and\n/// builds the AST node for a property implementation declaration; declared\n/// as \\@synthesize or \\@dynamic.\n///\nDecl *Sema::ActOnPropertyImplDecl(Scope *S, SourceLocation AtLoc, SourceLocation PropertyLoc, bool Synthesize, IdentifierInfo *PropertyId, IdentifierInfo *PropertyIvar, SourceLocation PropertyIvarLoc, ObjCPropertyQueryKind QueryKind) {\n if (ObjCMethodDecl *setterMethod = property->getSetterMethodDecl()) {\n if (getLangOpts().CPlusPlus && Synthesize && !CompleteTypeErr && Ivar->getType()->isRecordType()) {\n if (property->getPropertyAttributes() & ObjCPropertyAttribute::kind_atomic) {\n if (const CXXOperatorCallExpr *CXXCE = dyn_cast_or_null<CXXOperatorCallExpr>(callExpr))\n if (const FunctionDecl *FuncDecl = CXXCE->getDirectCallee())\n if (!FuncDecl->isTrivial())\n if (property->getType()->isReferenceType()) {\n Diag(FuncDecl->getBeginLoc(), diag::note_callee_decl) << FuncDecl;"},{"clang/lib/Sema/SemaTemplateDeduction.cpp",5039,"bool Sema::DeduceReturnType(FunctionDecl *FD, SourceLocation Loc, bool Diagnose) {\n if (StillUndeduced && Diagnose && !FD->isInvalidDecl()) {\n Diag(FD->getLocation(), diag::note_callee_decl) << FD;"}} | ||
}, | }, | ||
["note_callee_static_array"]={ | ["note_callee_static_array"]={ | ||
Line 861: | Line 861: | ||
[c]=o, | [c]=o, | ||
[m]={"5aa6ecb619bc",1318799852,"Add sema checks for calls to functions taking static array parameters"}, | [m]={"5aa6ecb619bc",1318799852,"Add sema checks for calls to functions taking static array parameters"}, | ||
[n]={{r, | [n]={{r,6683,"static void DiagnoseCalleeStaticArrayParam(Sema &S, ParmVarDecl *PVD) {\n if (ArrayTypeLoc ATL = TL.getAs<ArrayTypeLoc>())\n S.Diag(PVD->getLocation(), diag::note_callee_static_array) << ATL.getLocalSourceRange();"}} | ||
}, | }, | ||
["note_cannot_use_trivial_abi_reason"]={ | ["note_cannot_use_trivial_abi_reason"]={ | ||
Line 873: | Line 873: | ||
[c]=o, | [c]=o, | ||
[m]={Y,1582847864,W}, | [m]={Y,1582847864,W}, | ||
[n]={{q, | [n]={{q,10304,"void Sema::checkIllFormedTrivialABIStruct(CXXRecordDecl &RD) {\n auto PrintDiagAndRemoveAttr = [&](unsigned N) {\n // No diagnostics if this is a template instantiation.\n if (!isTemplateInstantiation(RD.getTemplateSpecializationKind())) {\n Diag(RD.getAttr<TrivialABIAttr>()->getLocation(), diag::note_cannot_use_trivial_abi_reason) << &RD << N;"}} | ||
}, | }, | ||
["note_carries_dependency_missing_first_decl"]={ | ["note_carries_dependency_missing_first_decl"]={ | ||
Line 885: | Line 885: | ||
[c]=o, | [c]=o, | ||
[m]={"e233fbfc16fe",1359412965,"Finish semantic analysis for [[carries_dependency]] attribute."}, | [m]={"e233fbfc16fe",1359412965,"Finish semantic analysis for [[carries_dependency]] attribute."}, | ||
[n]={{t, | [n]={{t,3349,"/// mergeParamDeclAttributes - Copy attributes from the old parameter\n/// to the new one.\nstatic void mergeParamDeclAttributes(ParmVarDecl *newDecl, const ParmVarDecl *oldDecl, Sema &S) {\n if (CDA && !oldDecl->hasAttr<CarriesDependencyAttr>()) {\n S.Diag(FirstVD->getLocation(), diag::note_carries_dependency_missing_first_decl) << 1 /*Param*/;"},{t,4057,"/// MergeFunctionDecl - We just parsed a function \'New\' from\n/// declarator D which has the same name and scope as a previous\n/// declaration \'Old\'. Figure out how to resolve this situation,\n/// merging decls or emitting diagnostics as appropriate.\n///\n/// In C++, New and Old must be declarations that are not\n/// overloaded. Use IsOverload to determine whether New and Old are\n/// overloaded, and to select the Old declaration that New should be\n/// merged with.\n///\n/// Returns true if there was an error, false otherwise.\nbool Sema::MergeFunctionDecl(FunctionDecl *New, NamedDecl *&OldD, Scope *S, bool MergeTypeWithOld, bool NewDeclIsDefn) {\n if (getLangOpts().CPlusPlus) {\n if (CDA && !Old->hasAttr<CarriesDependencyAttr>()) {\n Diag(Old->getFirstDecl()->getLocation(), diag::note_carries_dependency_missing_first_decl) << 0 /*Function*/;"}} | ||
}, | }, | ||
["note_cast_operand_to_int"]={ | ["note_cast_operand_to_int"]={ | ||
Line 897: | Line 897: | ||
[c]=o, | [c]=o, | ||
[m]={Pb,1615397021,Ob}, | [m]={Pb,1615397021,Ob}, | ||
[n]={{y, | [n]={{y,15253,"/// Data recursive variant of AnalyzeImplicitConversions. Subexpressions\n/// that should be visited are added to WorkList.\nstatic void AnalyzeImplicitConversions(Sema &S, AnalyzeImplicitConversionsWorkItem Item, llvm::SmallVectorImpl<AnalyzeImplicitConversionsWorkItem> &WorkList) {\n if (const auto *BO = dyn_cast<BinaryOperator>(SourceExpr))\n if ((BO->getOpcode() == BO_And || BO->getOpcode() == BO_Or) && BO->getLHS()->isKnownToHaveBooleanValue() && BO->getRHS()->isKnownToHaveBooleanValue() && BO->getLHS()->HasSideEffects(S.Context) && BO->getRHS()->HasSideEffects(S.Context)) {\n S.Diag(BO->getBeginLoc(), diag::note_cast_operand_to_int);"}} | ||
}, | }, | ||
["note_cast_to_void"]={ | ["note_cast_to_void"]={ | ||
Line 909: | Line 909: | ||
[c]=o, | [c]=o, | ||
[m]={"faca2d83b13e",1455839920,"Add -Wcomma warning to Clang."}, | [m]={"faca2d83b13e",1455839920,"Add -Wcomma warning to Clang."}, | ||
[n]={{r, | [n]={{r,14659,"// Look for instances where it is likely the comma operator is confused with\n// another operator. There is an explicit list of acceptable expressions for\n// the left hand side of the comma operator, otherwise emit a warning.\nvoid Sema::DiagnoseCommaOperator(const Expr *LHS, SourceLocation Loc) {\n Diag(LHS->getBeginLoc(), diag::note_cast_to_void) << LHS->getSourceRange() << FixItHint::CreateInsertion(LHS->getBeginLoc(), LangOpts.CPlusPlus ? \"static_cast<void>(\" : \"(void)(\") << FixItHint::CreateInsertion(PP.getLocForEndOfToken(LHS->getEndLoc()), \")\");"}} | ||
}, | }, | ||
["note_cat_conform_to_noescape_prot"]={ | ["note_cat_conform_to_noescape_prot"]={ | ||
Line 921: | Line 921: | ||
[c]=o, | [c]=o, | ||
[m]={"a6b5e0036128",1532750773,"[Sema][ObjC] Warn when a method declared in a protocol takes a"}, | [m]={"a6b5e0036128",1532750773,"[Sema][ObjC] Warn when a method declared in a protocol takes a"}, | ||
[n]={{E, | [n]={{E,132,"/// Produce additional diagnostics if a category conforms to a protocol that\n/// defines a method taking a non-escaping parameter.\nstatic void diagnoseNoescape(const ParmVarDecl *NewD, const ParmVarDecl *OldD, const ObjCCategoryDecl *CD, const ObjCProtocolDecl *PD, Sema &S) {\n if (!diagnoseNoescape(NewD, OldD, S))\n S.Diag(CD->getLocation(), diag::note_cat_conform_to_noescape_prot) << CD->IsClassExtension() << PD << cast<ObjCMethodDecl>(NewD->getDeclContext());"}} | ||
}, | }, | ||
["note_cc1_round_trip_generated"]={ | ["note_cc1_round_trip_generated"]={ | ||
Line 933: | Line 933: | ||
[c]=a, | [c]=a, | ||
[m]={"0175999805cf",1585492323,"[AMDGPU] Add options -mamdgpu-ieee -mno-amdgpu-ieee"}, | [m]={"0175999805cf",1585492323,"[AMDGPU] Add options -mamdgpu-ieee -mno-amdgpu-ieee"}, | ||
[n]={{bc, | [n]={{bc,756,"#endif\n // The first parse on original arguments succeeded, but second parse of\n // generated arguments failed. Something must be wrong with the generator.\n if (!Success2) {\n Diags.Report(diag::note_cc1_round_trip_generated) << 1 << SerializeArgs(GeneratedArgs);"},{bc,784,"#endif\n // If we generated different arguments from what we assume are two\n // semantically equivalent CompilerInvocations, the Generate function may\n // be non-deterministic.\n if (!Equal(GeneratedArgs, ComparisonArgs)) {\n Diags.Report(diag::note_cc1_round_trip_generated) << 1 << SerializeArgs(GeneratedArgs);"},{bc,786,"#endif\n // If we generated different arguments from what we assume are two\n // semantically equivalent CompilerInvocations, the Generate function may\n // be non-deterministic.\n if (!Equal(GeneratedArgs, ComparisonArgs)) {\n Diags.Report(diag::note_cc1_round_trip_generated) << 2 << SerializeArgs(ComparisonArgs);"}} | ||
}, | }, | ||
["note_cc1_round_trip_original"]={ | ["note_cc1_round_trip_original"]={ | ||
Line 945: | Line 945: | ||
[c]=a, | [c]=a, | ||
[m]={"0175999805cf",1585492323,"[AMDGPU] Add options -mamdgpu-ieee -mno-amdgpu-ieee"}, | [m]={"0175999805cf",1585492323,"[AMDGPU] Add options -mamdgpu-ieee -mno-amdgpu-ieee"}, | ||
[n]={{bc, | [n]={{bc,728,"#endif\n // Run the first parse on the original arguments with the dummy invocation and\n // diagnostics.\n if (!Parse(DummyInvocation, CommandLineArgs, DummyDiags, Argv0) || DummyDiags.getNumWarnings() != 0) {\n Diags.Report(diag::note_cc1_round_trip_original) << SerializeArgs(CommandLineArgs);"}} | ||
}, | }, | ||
["note_change_bitfield_sign"]={ | ["note_change_bitfield_sign"]={ | ||
Line 957: | Line 957: | ||
[c]=o, | [c]=o, | ||
[m]={"329f24d6f6e7",1489514462,"Warn on enum assignment to bitfields that can\'t fit all values"}, | [m]={"329f24d6f6e7",1489514462,"Warn on enum assignment to bitfields that can\'t fit all values"}, | ||
[n]={{y, | [n]={{y,14095,"/// Analyzes an attempt to assign the given value to a bitfield.\n///\n/// Returns true if there was something fishy about the attempt.\nstatic bool AnalyzeBitFieldAssignment(Sema &S, FieldDecl *Bitfield, Expr *Init, SourceLocation InitLoc) {\n if (!OriginalInit->EvaluateAsInt(Result, S.Context, Expr::SE_AllowSideEffects)) {\n // The RHS is not constant. If the RHS has an enum type, make sure the\n // bitfield is wide enough to hold all the values of the enum without\n // truncation.\n if (const auto *EnumTy = OriginalInit->getType()->getAs<EnumType>()) {\n if (DiagID) {\n S.Diag(Bitfield->getTypeSpecStartLoc(), diag::note_change_bitfield_sign) << SignedEnum << TypeRange;"}} | ||
}, | }, | ||
["note_change_calling_conv_fixit"]={ | ["note_change_calling_conv_fixit"]={ | ||
Line 969: | Line 969: | ||
[c]=o, | [c]=o, | ||
[m]={"9f49733c65b0",1462914003,"Add -Wcast-calling-convention to warn when casting away calling conventions"}, | [m]={"9f49733c65b0",1462914003,"Add -Wcast-calling-convention to warn when casting away calling conventions"}, | ||
[n]={{"clang/lib/Sema/SemaCast.cpp", | [n]={{"clang/lib/Sema/SemaCast.cpp",2188,"/// Diagnose casts that change the calling convention of a pointer to a function\n/// defined in the current TU.\nstatic void DiagnoseCallingConvCast(Sema &Self, const ExprResult &SrcExpr, QualType DstType, SourceRange OpRange) {\n Self.Diag(NameLoc, diag::note_change_calling_conv_fixit) << FD << DstCCName << FixItHint::CreateInsertion(NameLoc, CCAttrText);"}} | ||
}, | }, | ||
["note_checking_constraints_for_class_spec_id_here"]={ | ["note_checking_constraints_for_class_spec_id_here"]={ | ||
Line 981: | Line 981: | ||
[c]=o, | [c]=o, | ||
[m]={Rb,1569403888,Nb}, | [m]={Rb,1569403888,Nb}, | ||
[n]={{z, | [n]={{z,1036,"/// Prints the current instantiation stack through a series of\n/// notes.\nvoid Sema::PrintInstantiationStack() {\n for (SmallVectorImpl<CodeSynthesisContext>::reverse_iterator Active = CodeSynthesisContexts.rbegin(), ActiveEnd = CodeSynthesisContexts.rend(); Active != ActiveEnd; ++Active, ++InstantiationIdx) {\n case CodeSynthesisContext::ConstraintsCheck: {\n if (isa<ConceptDecl>(Active->Entity))\n else if (isa<TemplateDecl>(Active->Entity))\n else if (isa<VarTemplatePartialSpecializationDecl>(Active->Entity))\n else if (isa<ClassTemplatePartialSpecializationDecl>(Active->Entity))\n DiagID = diag::note_checking_constraints_for_class_spec_id_here;"}} | ||
}, | }, | ||
["note_checking_constraints_for_function_here"]={ | ["note_checking_constraints_for_function_here"]={ | ||
Line 993: | Line 993: | ||
[c]=o, | [c]=o, | ||
[m]={"1228d42ddab8",1576809732,"[OpenMP][Part 2] Use reusable OpenMP context/traits handling"}, | [m]={"1228d42ddab8",1576809732,"[OpenMP][Part 2] Use reusable OpenMP context/traits handling"}, | ||
[n]={{z, | [n]={{z,1039,"/// Prints the current instantiation stack through a series of\n/// notes.\nvoid Sema::PrintInstantiationStack() {\n for (SmallVectorImpl<CodeSynthesisContext>::reverse_iterator Active = CodeSynthesisContexts.rbegin(), ActiveEnd = CodeSynthesisContexts.rend(); Active != ActiveEnd; ++Active, ++InstantiationIdx) {\n case CodeSynthesisContext::ConstraintsCheck: {\n if (isa<ConceptDecl>(Active->Entity))\n else if (isa<TemplateDecl>(Active->Entity))\n else if (isa<VarTemplatePartialSpecializationDecl>(Active->Entity))\n else if (isa<ClassTemplatePartialSpecializationDecl>(Active->Entity))\n else {\n DiagID = diag::note_checking_constraints_for_function_here;"}} | ||
}, | }, | ||
["note_checking_constraints_for_template_id_here"]={ | ["note_checking_constraints_for_template_id_here"]={ | ||
Line 1,005: | Line 1,005: | ||
[c]=o, | [c]=o, | ||
[m]={Rb,1569403888,Nb}, | [m]={Rb,1569403888,Nb}, | ||
[n]={{z, | [n]={{z,1032,"/// Prints the current instantiation stack through a series of\n/// notes.\nvoid Sema::PrintInstantiationStack() {\n for (SmallVectorImpl<CodeSynthesisContext>::reverse_iterator Active = CodeSynthesisContexts.rbegin(), ActiveEnd = CodeSynthesisContexts.rend(); Active != ActiveEnd; ++Active, ++InstantiationIdx) {\n case CodeSynthesisContext::ConstraintsCheck: {\n if (isa<ConceptDecl>(Active->Entity))\n else if (isa<TemplateDecl>(Active->Entity))\n DiagID = diag::note_checking_constraints_for_template_id_here;"}} | ||
}, | }, | ||
["note_checking_constraints_for_var_spec_id_here"]={ | ["note_checking_constraints_for_var_spec_id_here"]={ | ||
Line 1,017: | Line 1,017: | ||
[c]=o, | [c]=o, | ||
[m]={Rb,1569403888,Nb}, | [m]={Rb,1569403888,Nb}, | ||
[n]={{z, | [n]={{z,1034,"/// Prints the current instantiation stack through a series of\n/// notes.\nvoid Sema::PrintInstantiationStack() {\n for (SmallVectorImpl<CodeSynthesisContext>::reverse_iterator Active = CodeSynthesisContexts.rbegin(), ActiveEnd = CodeSynthesisContexts.rend(); Active != ActiveEnd; ++Active, ++InstantiationIdx) {\n case CodeSynthesisContext::ConstraintsCheck: {\n if (isa<ConceptDecl>(Active->Entity))\n else if (isa<TemplateDecl>(Active->Entity))\n else if (isa<VarTemplatePartialSpecializationDecl>(Active->Entity))\n DiagID = diag::note_checking_constraints_for_var_spec_id_here;"}} | ||
}, | }, | ||
["note_class_declared"]={ | ["note_class_declared"]={ | ||
Line 1,029: | Line 1,029: | ||
[c]=o, | [c]=o, | ||
[m]={"1f626d6fd1ca",1309980245,"objc-arc: Support objc_arc_weak_unavailable on those"}, | [m]={"1f626d6fd1ca",1309980245,"objc-arc: Support objc_arc_weak_unavailable on those"}, | ||
[n]={{E, | [n]={{E,4166,"// Note: For class/category implementations, allMethods is always null.\nDecl *Sema::ActOnAtEnd(Scope *S, SourceRange AtEnd, ArrayRef<Decl *> allMethods, ArrayRef<DeclGroupPtrTy> allTUVars) {\n if (ObjCImplementationDecl *IC = dyn_cast<ObjCImplementationDecl>(ClassDecl)) {\n if (ObjCInterfaceDecl *IDecl = IC->getClassInterface()) {\n if (const ObjCInterfaceDecl *Super = IDecl->getSuperClass()) {\n // An interface can subclass another interface with a\n // objc_subclassing_restricted attribute when it has that attribute as\n // well (because of interfaces imported from Swift). Therefore we have\n // to check if we can subclass in the implementation as well.\n if (IDecl->hasAttr<ObjCSubclassingRestrictedAttr>() && Super->hasAttr<ObjCSubclassingRestrictedAttr>()) {\n Diag(Super->getLocation(), diag::note_class_declared);"},{E,4198,"// Note: For class/category implementations, allMethods is always null.\nDecl *Sema::ActOnAtEnd(Scope *S, SourceRange AtEnd, ArrayRef<Decl *> allMethods, ArrayRef<DeclGroupPtrTy> allTUVars) {\n if (ObjCImplementationDecl *IC = dyn_cast<ObjCImplementationDecl>(ClassDecl)) {\n } else if (ObjCCategoryImplDecl *CatImplClass = dyn_cast<ObjCCategoryImplDecl>(ClassDecl)) {\n } else if (const auto *IntfDecl = dyn_cast<ObjCInterfaceDecl>(ClassDecl)) {\n if (const ObjCInterfaceDecl *Super = IntfDecl->getSuperClass()) {\n if (!IntfDecl->hasAttr<ObjCSubclassingRestrictedAttr>() && Super->hasAttr<ObjCSubclassingRestrictedAttr>()) {\n Diag(Super->getLocation(), diag::note_class_declared);"},{B,7076,"/// handleObjCOwnershipTypeAttr - Process an objc_ownership\n/// attribute on the specified type.\n///\n/// Returns \'true\' if the attribute was handled.\nstatic bool handleObjCOwnershipTypeAttr(TypeProcessingState &state, ParsedAttr &attr, QualType &type) {\n // Forbid __weak for class objects marked as\n // objc_arc_weak_reference_unavailable\n if (lifetime == Qualifiers::OCL_Weak) {\n if (const ObjCObjectPointerType *ObjT = type->getAs<ObjCObjectPointerType>()) {\n if (ObjCInterfaceDecl *Class = ObjT->getInterfaceDecl()) {\n if (Class->isArcWeakrefUnavailable()) {\n S.Diag(ObjT->getInterfaceDecl()->getLocation(), diag::note_class_declared);"}} | ||
}, | }, | ||
["note_cocoa_naming_declare_family"]={ | ["note_cocoa_naming_declare_family"]={ | ||
Line 1,041: | Line 1,041: | ||
[c]=o, | [c]=o, | ||
[m]={"a34d04d35e72",1421449471,"Suggest objc_method_family(none) for a property named -newFoo or similar."}, | [m]={"a34d04d35e72",1421449471,"Suggest objc_method_family(none) for a property named -newFoo or similar."}, | ||
[n]={{N, | [n]={{N,2304,"void Sema::DiagnoseOwningPropertyGetterSynthesis(const ObjCImplementationDecl *D) {\n for (const auto *PID : D->property_impls()) {\n if (PD && !PD->hasAttr<NSReturnsNotRetainedAttr>() && !PD->isClassProperty()) {\n if (family == OMF_alloc || family == OMF_copy || family == OMF_mutableCopy || family == OMF_new) {\n auto noteDiag = Diag(noteLoc, diag::note_cocoa_naming_declare_family) << method->getDeclName() << spelling;"}} | ||
}, | }, | ||
["note_collapse_loop_count"]={ | ["note_collapse_loop_count"]={ | ||
Line 1,053: | Line 1,053: | ||
[c]="OpenMP Issue", | [c]="OpenMP Issue", | ||
[m]={"7b6bc88c5aaf",1448524239,"[OPENMP 4.5] Fixed rules for \'ordered\' clause."}, | [m]={"7b6bc88c5aaf",1448524239,"[OPENMP 4.5] Fixed rules for \'ordered\' clause."}, | ||
[n]={{C, | [n]={{C,9607,"/// Called on a for stmt to check itself and nested loops (if any).\n/// \\return Returns 0 if one of the collapsed stmts is not canonical for loop,\n/// number of collapsed loops otherwise.\nstatic unsigned checkOpenMPLoop(OpenMPDirectiveKind DKind, Expr *CollapseLoopCountExpr, Expr *OrderedLoopCountExpr, Stmt *AStmt, Sema &SemaRef, DSAStackTy &DSA, Sema::VarsWithInheritedDSAType &VarsWithImplicitDSA, OMPLoopBasedDirective::HelperExprs &Built) {\n if (OrderedLoopCountExpr) {\n if (!OrderedLoopCountExpr->isValueDependent() && OrderedLoopCountExpr->EvaluateAsInt(EVResult, SemaRef.getASTContext())) {\n if (Result.getLimitedValue() < NestedLoopCount) {\n SemaRef.Diag(CollapseLoopCountExpr->getExprLoc(), diag::note_collapse_loop_count) << CollapseLoopCountExpr->getSourceRange();"}} | ||
}, | }, | ||
["note_comparison_synthesized_at"]={ | ["note_comparison_synthesized_at"]={ | ||
Line 1,065: | Line 1,065: | ||
[c]=o, | [c]=o, | ||
[m]={"cafc7416baf7",1575501927,"[c++20] Synthesis of defaulted comparison functions."}, | [m]={"cafc7416baf7",1575501927,"[c++20] Synthesis of defaulted comparison functions."}, | ||
[n]={{z, | [n]={{z,984,"/// Prints the current instantiation stack through a series of\n/// notes.\nvoid Sema::PrintInstantiationStack() {\n for (SmallVectorImpl<CodeSynthesisContext>::reverse_iterator Active = CodeSynthesisContexts.rbegin(), ActiveEnd = CodeSynthesisContexts.rend(); Active != ActiveEnd; ++Active, ++InstantiationIdx) {\n case CodeSynthesisContext::DefiningSynthesizedFunction: {\n if (DFK.isSpecialMember()) {\n } else if (DFK.isComparison()) {\n Diags.Report(Active->PointOfInstantiation, diag::note_comparison_synthesized_at) << (int)DFK.asComparison() << RecordType;"}} | ||
}, | }, | ||
["note_compat_assoc"]={ | ["note_compat_assoc"]={ | ||
Line 1,077: | Line 1,077: | ||
[c]=o, | [c]=o, | ||
[m]={"91147596414d",1302827748,"C1X: implement generic selections"}, | [m]={"91147596414d",1302827748,"C1X: implement generic selections"}, | ||
[n]={{r, | [n]={{r,1783,"ExprResult Sema::CreateGenericSelectionExpr(SourceLocation KeyLoc, SourceLocation DefaultLoc, SourceLocation RParenLoc, bool PredicateIsExpr, void *ControllingExprOrType, ArrayRef<TypeSourceInfo *> Types, ArrayRef<Expr *> Exprs) {\n for (unsigned i = 0; i < NumAssocs; ++i) {\n if (Types[i]) {\n if (Types[i]->getType()->isDependentType()) {\n } else {\n // C11 6.5.1.1p2 \"No two generic associations in the same generic\n // selection shall specify compatible types.\"\n for (unsigned j = i + 1; j < NumAssocs; ++j)\n if (Types[j] && !Types[j]->getType()->isDependentType() && Context.typesAreCompatible(Types[i]->getType(), Types[j]->getType())) {\n Diag(Types[i]->getTypeLoc().getBeginLoc(), diag::note_compat_assoc) << Types[i]->getTypeLoc().getSourceRange() << Types[i]->getType();"},{r,1852,"ExprResult Sema::CreateGenericSelectionExpr(SourceLocation KeyLoc, SourceLocation DefaultLoc, SourceLocation RParenLoc, bool PredicateIsExpr, void *ControllingExprOrType, ArrayRef<TypeSourceInfo *> Types, ArrayRef<Expr *> Exprs) {\n // C11 6.5.1.1p2 \"The controlling expression of a generic selection shall have\n // type compatible with at most one of the types named in its generic\n // association list.\"\n if (CompatIndices.size() > 1) {\n for (unsigned I : CompatIndices) {\n Diag(Types[I]->getTypeLoc().getBeginLoc(), diag::note_compat_assoc) << Types[I]->getTypeLoc().getSourceRange() << Types[I]->getType();"}} | ||
}, | }, | ||
["note_compound_token_split_second_token_here"]={ | ["note_compound_token_split_second_token_here"]={ | ||
Line 1,089: | Line 1,089: | ||
[c]=Q, | [c]=Q, | ||
[m]={"5c63ae156e96",1597298751,"[OpenMP] Support nested OpenMP context selectors (declare variant)"}, | [m]={"5c63ae156e96",1597298751,"[OpenMP] Support nested OpenMP context selectors (declare variant)"}, | ||
[n]={{"clang/lib/Parse/Parser.cpp", | [n]={{"clang/lib/Parse/Parser.cpp",246,"void Parser::checkCompoundToken(SourceLocation FirstTokLoc, tok::TokenKind FirstTokKind, CompoundToken Op) {\n // If either token is in a macro, we expect both tokens to come from the same\n // macro expansion.\n if ((FirstTokLoc.isMacroID() || SecondTokLoc.isMacroID()) && PP.getSourceManager().getFileID(FirstTokLoc) != PP.getSourceManager().getFileID(SecondTokLoc)) {\n Diag(SecondTokLoc, diag::note_compound_token_split_second_token_here) << (FirstTokKind == Tok.getKind()) << Tok.getKind() << SourceRange(SecondTokLoc);"}} | ||
}, | }, | ||
["note_concatenated_string_literal_silence"]={ | ["note_concatenated_string_literal_silence"]={ | ||
Line 1,101: | Line 1,101: | ||
[c]=o, | [c]=o, | ||
[m]={Y,1582847864,W}, | [m]={Y,1582847864,W}, | ||
[n]={{t, | [n]={{t,14157,"void Sema::CheckCompleteVariableDeclaration(VarDecl *var) {\n if (!var->getType()->isStructureType() && var->hasInit() && isa<InitListExpr>(var->getInit())) {\n if (NumInits > 2)\n for (unsigned I = 0; I < NumInits; ++I) {\n // Diagnose missing comma in string array initialization.\n // Do not warn when all the elements in the initializer are concatenated\n // together. Do not warn for macros too.\n if (NumConcat == 2 && !SL->getBeginLoc().isMacroID()) {\n if (OnlyOneMissingComma) {\n Diag(SL->getBeginLoc(), diag::note_concatenated_string_literal_silence);"}} | ||
}, | }, | ||
["note_concept_specialization_constraint_evaluated_to_false"]={ | ["note_concept_specialization_constraint_evaluated_to_false"]={ | ||
Line 1,113: | Line 1,113: | ||
[c]=o, | [c]=o, | ||
[m]={Rb,1569403888,Nb}, | [m]={Rb,1569403888,Nb}, | ||
[n]={{O, | [n]={{O,1124,"static void diagnoseWellFormedUnsatisfiedConstraintExpr(Sema &S, Expr *SubstExpr, bool First) {\n if (BinaryOperator *BO = dyn_cast<BinaryOperator>(SubstExpr)) {\n } else if (auto *CSE = dyn_cast<ConceptSpecializationExpr>(SubstExpr)) {\n if (CSE->getTemplateArgsAsWritten()->NumTemplateArgs == 1) {\n } else {\n S.Diag(SubstExpr->getSourceRange().getBegin(), diag::note_concept_specialization_constraint_evaluated_to_false) << (int)First << CSE;"}} | ||
}, | }, | ||
["note_concept_specialization_here"]={ | ["note_concept_specialization_here"]={ | ||
Line 1,125: | Line 1,125: | ||
[c]=o, | [c]=o, | ||
[m]={Ab,1567434909,Cb}, | [m]={Ab,1567434909,Cb}, | ||
[n]={{z, | [n]={{z,1030,"/// Prints the current instantiation stack through a series of\n/// notes.\nvoid Sema::PrintInstantiationStack() {\n for (SmallVectorImpl<CodeSynthesisContext>::reverse_iterator Active = CodeSynthesisContexts.rbegin(), ActiveEnd = CodeSynthesisContexts.rend(); Active != ActiveEnd; ++Active, ++InstantiationIdx) {\n case CodeSynthesisContext::ConstraintsCheck: {\n if (isa<ConceptDecl>(Active->Entity))\n DiagID = diag::note_concept_specialization_here;"}} | ||
}, | }, | ||
["note_condition_assign_silence"]={ | ["note_condition_assign_silence"]={ | ||
Line 1,137: | Line 1,137: | ||
[c]=o, | [c]=o, | ||
[m]={"2bf2d3d0165f",1271261392,"When diagnosing suspicious precedence or assignments, move the fix-it"}, | [m]={"2bf2d3d0165f",1271261392,"When diagnosing suspicious precedence or assignments, move the fix-it"}, | ||
[n]={{r, | [n]={{r,20883,"// Diagnose the s/=/==/ and s/\\|=/!=/ typos. Note that adding parentheses\n// will prevent this condition from triggering, which is what we want.\nvoid Sema::DiagnoseAssignmentAsCondition(Expr *E) {\n Diag(Loc, diag::note_condition_assign_silence) << FixItHint::CreateInsertion(Open, \"(\") << FixItHint::CreateInsertion(Close, \")\");"}} | ||
}, | }, | ||
["note_condition_assign_to_comparison"]={ | ["note_condition_assign_to_comparison"]={ | ||
Line 1,149: | Line 1,149: | ||
[c]=o, | [c]=o, | ||
[m]={"fa1e36d0de87",1262910023,"Improve the fix-its for -Wparentheses to ensure that the fix-it"}, | [m]={"fa1e36d0de87",1262910023,"Improve the fix-its for -Wparentheses to ensure that the fix-it"}, | ||
[n]={{r, | [n]={{r,20909,"// Diagnose the s/=/==/ and s/\\|=/!=/ typos. Note that adding parentheses\n// will prevent this condition from triggering, which is what we want.\nvoid Sema::DiagnoseAssignmentAsCondition(Expr *E) {\n if (IsOrAssign)\n else\n Diag(Loc, diag::note_condition_assign_to_comparison) << FixItHint::CreateReplacement(Loc, \"==\");"}} | ||
}, | }, | ||
["note_condition_or_assign_to_comparison"]={ | ["note_condition_or_assign_to_comparison"]={ | ||
Line 1,161: | Line 1,161: | ||
[c]=o, | [c]=o, | ||
[m]={"2d4f64f441ce",1295455808,"Warn about the use of unparenthesized |= in conditionals (which may be"}, | [m]={"2d4f64f441ce",1295455808,"Warn about the use of unparenthesized |= in conditionals (which may be"}, | ||
[n]={{r, | [n]={{r,20886,"// Diagnose the s/=/==/ and s/\\|=/!=/ typos. Note that adding parentheses\n// will prevent this condition from triggering, which is what we want.\nvoid Sema::DiagnoseAssignmentAsCondition(Expr *E) {\n if (IsOrAssign)\n Diag(Loc, diag::note_condition_or_assign_to_comparison) << FixItHint::CreateReplacement(Loc, \"!=\");"}} | ||
}, | }, | ||
["note_conflicting_attribute"]={ | ["note_conflicting_attribute"]={ | ||
Line 1,173: | Line 1,173: | ||
[c]=o, | [c]=o, | ||
[m]={"30e41fb4da68",1418669848,"Warn when attribute \'optnone\' conflicts with attributes on a"}, | [m]={"30e41fb4da68",1418669848,"Warn when attribute \'optnone\' conflicts with attributes on a"}, | ||
[n]={{I, | [n]={{I,280,"/// Diagnose mutually exclusive attributes when present on a given\n/// declaration. Returns true if diagnosed.\ntemplate <typename AttrTy> static bool checkAttrMutualExclusion(Sema &S, Decl *D, const ParsedAttr &AL) {\n if (const auto *A = D->getAttr<AttrTy>()) {\n S.Diag(A->getLocation(), diag::note_conflicting_attribute);"},{I,292,"template <typename AttrTy> static bool checkAttrMutualExclusion(Sema &S, Decl *D, const Attr &AL) {\n if (const auto *A = D->getAttr<AttrTy>()) {\n S.Diag(A->getLocation(), diag::note_conflicting_attribute);"},{I,2071,"static void handleCPUSpecificAttr(Sema &S, Decl *D, const ParsedAttr &AL) {\n // Ensure we don\'t combine these with themselves, since that causes some\n // confusing behavior.\n if (AL.getParsedKind() == ParsedAttr::AT_CPUDispatch) {\n if (const auto *Other = D->getAttr<CPUDispatchAttr>()) {\n S.Diag(Other->getLocation(), diag::note_conflicting_attribute);"},{I,2080,"static void handleCPUSpecificAttr(Sema &S, Decl *D, const ParsedAttr &AL) {\n // Ensure we don\'t combine these with themselves, since that causes some\n // confusing behavior.\n if (AL.getParsedKind() == ParsedAttr::AT_CPUDispatch) {\n } else if (AL.getParsedKind() == ParsedAttr::AT_CPUSpecific) {\n if (const auto *Other = D->getAttr<CPUSpecificAttr>()) {\n S.Diag(Other->getLocation(), diag::note_conflicting_attribute);"},{I,3621,"static void handleTargetClonesAttr(Sema &S, Decl *D, const ParsedAttr &AL) {\n // Ensure we don\'t combine these with themselves, since that causes some\n // confusing behavior.\n if (const auto *Other = D->getAttr<TargetClonesAttr>()) {\n S.Diag(Other->getLocation(), diag::note_conflicting_attribute);"},{I,3902,"ErrorAttr *Sema::mergeErrorAttr(Decl *D, const AttributeCommonInfo &CI, StringRef NewUserDiagnostic) {\n if (const auto *EA = D->getAttr<ErrorAttr>()) {\n if (!Match) {\n Diag(CI.getLoc(), diag::note_conflicting_attribute);"},{I,4888,"AlwaysInlineAttr *Sema::mergeAlwaysInlineAttr(Decl *D, const AttributeCommonInfo &CI, const IdentifierInfo *Ident) {\n if (OptimizeNoneAttr *Optnone = D->getAttr<OptimizeNoneAttr>()) {\n Diag(Optnone->getLocation(), diag::note_conflicting_attribute);"},{I,4944,"MinSizeAttr *Sema::mergeMinSizeAttr(Decl *D, const AttributeCommonInfo &CI) {\n if (OptimizeNoneAttr *Optnone = D->getAttr<OptimizeNoneAttr>()) {\n Diag(Optnone->getLocation(), diag::note_conflicting_attribute);"},{I,4962,"SwiftNameAttr *Sema::mergeSwiftNameAttr(Decl *D, const SwiftNameAttr &SNA, StringRef Name) {\n if (const auto *PrevSNA = D->getAttr<SwiftNameAttr>()) {\n if (PrevSNA->getName() != Name && !PrevSNA->isImplicit()) {\n Diag(SNA.getLoc(), diag::note_conflicting_attribute);"},{I,4974,"OptimizeNoneAttr *Sema::mergeOptimizeNoneAttr(Decl *D, const AttributeCommonInfo &CI) {\n if (AlwaysInlineAttr *Inline = D->getAttr<AlwaysInlineAttr>()) {\n Diag(CI.getLoc(), diag::note_conflicting_attribute);"},{I,4979,"OptimizeNoneAttr *Sema::mergeOptimizeNoneAttr(Decl *D, const AttributeCommonInfo &CI) {\n if (MinSizeAttr *MinSize = D->getAttr<MinSizeAttr>()) {\n Diag(CI.getLoc(), diag::note_conflicting_attribute);"},{I,5260,"static void handleLifetimeCategoryAttr(Sema &S, Decl *D, const ParsedAttr &AL) {\n if (AL.getKind() == ParsedAttr::AT_Owner) {\n if (const auto *OAttr = D->getAttr<OwnerAttr>()) {\n if (ExistingDerefType != ParmType.getTypePtrOrNull()) {\n S.Diag(OAttr->getLocation(), diag::note_conflicting_attribute);"},{I,5279,"static void handleLifetimeCategoryAttr(Sema &S, Decl *D, const ParsedAttr &AL) {\n if (AL.getKind() == ParsedAttr::AT_Owner) {\n } else {\n if (const auto *PAttr = D->getAttr<PointerAttr>()) {\n if (ExistingDerefType != ParmType.getTypePtrOrNull()) {\n S.Diag(PAttr->getLocation(), diag::note_conflicting_attribute);"},{I,5516,"void Sema::AddParameterABIAttr(Decl *D, const AttributeCommonInfo &CI, ParameterABI abi) {\n if (auto existingAttr = D->getAttr<ParameterABIAttr>()) {\n if (existingAttr->getABI() != abi) {\n Diag(existingAttr->getLocation(), diag::note_conflicting_attribute);"},{I,7113,"HLSLNumThreadsAttr *Sema::mergeHLSLNumThreadsAttr(Decl *D, const AttributeCommonInfo &AL, int X, int Y, int Z) {\n if (HLSLNumThreadsAttr *NT = D->getAttr<HLSLNumThreadsAttr>()) {\n if (NT->getX() != X || NT->getY() != Y || NT->getZ() != Z) {\n Diag(AL.getLoc(), diag::note_conflicting_attribute);"},{I,7210,"HLSLShaderAttr *Sema::mergeHLSLShaderAttr(Decl *D, const AttributeCommonInfo &AL, HLSLShaderAttr::ShaderType ShaderType) {\n if (HLSLShaderAttr *NT = D->getAttr<HLSLShaderAttr>()) {\n if (NT->getType() != ShaderType) {\n Diag(AL.getLoc(), diag::note_conflicting_attribute);"},{I,8654,"template <typename AttrTy, typename ConflictingAttrTy> static AttrTy *mergeEnforceTCBAttrImpl(Sema &S, Decl *D, const AttrTy &AL) {\n if (const ConflictingAttrTy *ConflictingAttr = findEnforceTCBAttrByName<ConflictingAttrTy>(D, TCBName)) {\n S.Diag(AL.getLoc(), diag::note_conflicting_attribute);"},{A,931,"StmtResult Sema::ActOnIfStmt(SourceLocation IfLoc, IfStatementKind StatementKind, SourceLocation LParenLoc, Stmt *InitStmt, ConditionResult Cond, SourceLocation RParenLoc, Stmt *thenStmt, SourceLocation ElseLoc, Stmt *elseStmt) {\n if (ConstevalOrNegatedConsteval || StatementKind == IfStatementKind::Constexpr) {\n } else {\n if (std::get<0>(LHC)) {\n Diags.Report(ElseAttr->getLocation(), diag::note_conflicting_attribute) << ElseAttr << ElseAttr->getRange();"},{"clang/lib/Sema/SemaStmtAttr.cpp",254,"template <typename OtherAttr, int DiagIdx> static bool CheckStmtInlineAttr(Sema &SemaRef, const Stmt *OrigSt, const Stmt *CurSt, const AttributeCommonInfo &A) {\n for (const auto &Tup : llvm::zip_longest(OrigCEF.getCallExprs(), CEF.getCallExprs())) {\n // If the original call expression already had a callee, we already\n // diagnosed this, so skip it here. We can\'t skip if there isn\'t a 1:1\n // relationship between the two lists of call expressions.\n if (!CanSuppressDiag || !(*std::get<0>(Tup))->getCalleeDecl()) {\n if (Callee && (Callee->hasAttr<OtherAttr>() || Callee->hasAttr<FlattenAttr>())) {\n SemaRef.Diag(Callee->getBeginLoc(), diag::note_conflicting_attribute);"},{"clang/utils/TableGen/ClangAttrEmitter.cpp",4025,"// Generates the mutual exclusion checks. The checks for parsed attributes are\n// written into OS and the checks for merging declaration attributes are\n// written into MergeOS.\nstatic void GenerateMutualExclusionsChecks(const Record &Attr, const RecordKeeper &Records, raw_ostream &OS, raw_ostream &MergeDeclOS, raw_ostream &MergeStmtOS) {\n // If we discovered any decl or stmt attributes to test for, generate the\n // predicates for them now.\n if (!DeclAttrs.empty()) {\n for (const std::string &A : DeclAttrs) {\n OS << \" S.Diag(A->getLocation(), diag::note_conflicting_attribute);\";"},{"clang/utils/TableGen/ClangAttrEmitter.cpp",4048,"// Generates the mutual exclusion checks. The checks for parsed attributes are\n// written into OS and the checks for merging declaration attributes are\n// written into MergeOS.\nstatic void GenerateMutualExclusionsChecks(const Record &Attr, const RecordKeeper &Records, raw_ostream &OS, raw_ostream &MergeDeclOS, raw_ostream &MergeStmtOS) {\n // If we discovered any decl or stmt attributes to test for, generate the\n // predicates for them now.\n if (!DeclAttrs.empty()) {\n // Also generate the declaration attribute merging logic if the current\n // attribute is one that can be inheritted on a declaration. It is assumed\n // this code will be executed in the context of a function with parameters:\n // Sema &S, Decl *D, Attr *A and that returns a bool (false on diagnostic,\n // true on success).\n if (Attr.isSubClassOf(\"InheritableAttr\")) {\n for (const std::string &A : DeclAttrs) {\n MergeDeclOS << \" S.Diag(Second->getLocation(), \"\n << \"diag::note_conflicting_attribute);\\n\";"},{"clang/utils/TableGen/ClangAttrEmitter.cpp",4089,"// Generates the mutual exclusion checks. The checks for parsed attributes are\n// written into OS and the checks for merging declaration attributes are\n// written into MergeOS.\nstatic void GenerateMutualExclusionsChecks(const Record &Attr, const RecordKeeper &Records, raw_ostream &OS, raw_ostream &MergeDeclOS, raw_ostream &MergeStmtOS) {\n // Statement attributes are a bit different from declarations. With\n // declarations, each attribute is added to the declaration as it is\n // processed, and so you can look on the Decl * itself to see if there is a\n // conflicting attribute. Statement attributes are processed as a group\n // because AttributedStmt needs to tail-allocate all of the attribute nodes\n // at once. This means we cannot check whether the statement already contains\n // an attribute to check for the conflict. Instead, we need to check whether\n // the given list of semantic attributes contain any conflicts. It is assumed\n // this code will be executed in the context of a function with parameters:\n // Sema &S, const SmallVectorImpl<const Attr *> &C. The code will be within a\n // loop which loops over the container C with a loop variable named A to\n // represent the current attribute to check for conflicts.\n //\n // FIXME: it would be nice not to walk over the list of potential attributes\n // to apply to the statement more than once, but statements typically don\'t\n // have long lists of attributes on them, so re-walking the list should not\n // be an expensive operation.\n if (!StmtAttrs.empty()) {\n MergeStmtOS << \" S.Diag(Second->getLocation(), \"\n << \"diag::note_conflicting_attribute);\\n\";"}} | ||
}, | }, | ||
["note_conflicting_prototype"]={ | ["note_conflicting_prototype"]={ | ||
Line 1,185: | Line 1,185: | ||
[c]=o, | [c]=o, | ||
[m]={"cb08f4aa4467",1620530452,"Support warn_unused_result on typedefs"}, | [m]={"cb08f4aa4467",1620530452,"Support warn_unused_result on typedefs"}, | ||
[n]={{t, | [n]={{t,4179,"/// MergeFunctionDecl - We just parsed a function \'New\' from\n/// declarator D which has the same name and scope as a previous\n/// declaration \'Old\'. Figure out how to resolve this situation,\n/// merging decls or emitting diagnostics as appropriate.\n///\n/// In C++, New and Old must be declarations that are not\n/// overloaded. Use IsOverload to determine whether New and Old are\n/// overloaded, and to select the Old declaration that New should be\n/// merged with.\n///\n/// Returns true if there was an error, false otherwise.\nbool Sema::MergeFunctionDecl(FunctionDecl *New, NamedDecl *&OldD, Scope *S, bool MergeTypeWithOld, bool NewDeclIsDefn) {\n // C: Function types need to be compatible, not identical. This handles\n // duplicate function decls like \"void f(int); void f(enum X);\" properly.\n if (!getLangOpts().CPlusPlus) {\n // If we are merging two functions where only one of them has a prototype,\n // we may have enough information to decide to issue a diagnostic that the\n // function without a protoype will change behavior in C2x. This handles\n // cases like:\n // void i(); void i(int j);\n // void i(int j); void i();\n // void i(); void i(int j) {}\n // See ActOnFinishFunctionBody() for other cases of the behavior change\n // diagnostic. See GetFullTypeForDeclarator() for handling of a function\n // type without a prototype.\n if (New->hasWrittenPrototype() != Old->hasWrittenPrototype() && !New->isImplicit() && !Old->isImplicit()) {\n if (WithProto->getNumParams() != 0) {\n if (WithoutProto->getBuiltinID() == 0 && !WithoutProto->isImplicit()) {\n // The reason the one without the prototype will be changing behavior\n // is because of the one with the prototype, so note that so long as\n // it\'s a user-visible declaration. There is one exception to this:\n // when the new declaration is a definition without a prototype, the\n // old declaration with a prototype is not the cause of the issue,\n // and that does not need to be noted because the one with a\n // prototype will not change behavior in C2x.\n if (WithProto->getBuiltinID() == 0 && !WithProto->isImplicit() && !IsWithoutProtoADef)\n Diag(WithProto->getLocation(), diag::note_conflicting_prototype);"}} | ||
}, | }, | ||
["note_conflicting_try_here"]={ | ["note_conflicting_try_here"]={ | ||
Line 1,197: | Line 1,197: | ||
[c]=o, | [c]=o, | ||
[m]={"e71759103e72",1422915331,"SEH: Diagnose use of C++ EH and SEH in the same function"}, | [m]={"e71759103e72",1422915331,"SEH: Diagnose use of C++ EH and SEH in the same function"}, | ||
[n]={{A, | [n]={{A,4245,"StmtResult Sema::ActOnObjCAtTryStmt(SourceLocation AtLoc, Stmt *Try, MultiStmtArg CatchStmts, Stmt *Finally) {\n if (FSI->FirstSEHTryLoc.isValid()) {\n Diag(FSI->FirstSEHTryLoc, diag::note_conflicting_try_here) << \"\'__try\'\";"},{A,4495,"/// ActOnCXXTryBlock - Takes a try compound-statement and a number of\n/// handlers and creates a try statement from them.\nStmtResult Sema::ActOnCXXTryBlock(SourceLocation TryLoc, Stmt *TryBlock, ArrayRef<Stmt *> Handlers) {\n // C++ try is incompatible with SEH __try.\n if (!getLangOpts().Borland && FSI->FirstSEHTryLoc.isValid()) {\n Diag(FSI->FirstSEHTryLoc, diag::note_conflicting_try_here) << \"\'__try\'\";"},{A,4588,"StmtResult Sema::ActOnSEHTryBlock(bool IsCXXTry, SourceLocation TryLoc, Stmt *TryBlock, Stmt *Handler) {\n // SEH __try is incompatible with C++ try. Borland appears to support this,\n // however.\n if (!getLangOpts().Borland) {\n if (FSI->FirstCXXOrObjCTryLoc.isValid()) {\n Diag(FSI->FirstCXXOrObjCTryLoc, diag::note_conflicting_try_here) << (FSI->FirstTryType == sema::FunctionScopeInfo::TryLocIsCXX ? \"\'try\'\" : \"\'@try\'\");"}} | ||
}, | }, | ||
["note_consteval_address_accessible"]={ | ["note_consteval_address_accessible"]={ | ||
Line 1,209: | Line 1,209: | ||
[c]=a, | [c]=a, | ||
[m]={fc,1579695612,nc}, | [m]={fc,1579695612,nc}, | ||
[n]={{p, | [n]={{p,2196,"/// Check that this reference or pointer core constant expression is a valid\n/// value for an address or reference constant expression. Return true if we\n/// can fold this expression, whether or not it\'s a constant expression.\nstatic bool CheckLValueConstantExpression(EvalInfo &Info, SourceLocation Loc, QualType Type, const LValue &LVal, ConstantExprKind Kind, CheckedTemporaries &CheckedTemps) {\n if (auto *FD = dyn_cast_or_null<FunctionDecl>(BaseVD); FD && FD->isImmediateFunction()) {\n Info.FFDiag(Loc, diag::note_consteval_address_accessible) << !Type->isAnyPointerType();"},{p,2336,"/// Member pointers are constant expressions unless they point to a\n/// non-virtual dllimport member function.\nstatic bool CheckMemberPointerConstantExpression(EvalInfo &Info, SourceLocation Loc, QualType Type, const APValue &Value, ConstantExprKind Kind) {\n if (FD->isImmediateFunction()) {\n Info.FFDiag(Loc, diag::note_consteval_address_accessible) << /*pointer*/ 0;"}} | ||
}, | }, | ||
["note_constexpr_access_deleted_object"]={ | ["note_constexpr_access_deleted_object"]={ | ||
Line 1,221: | Line 1,221: | ||
[c]=a, | [c]=a, | ||
[m]={M,1569547607,J}, | [m]={M,1569547607,J}, | ||
[n]={{p, | [n]={{p,4174,"/// Find the complete object to which an LValue refers.\nstatic CompleteObject findCompleteObject(EvalInfo &Info, const Expr *E, AccessKinds AK, const LValue &LVal, QualType LValType) {\n if (Info.getLangOpts().CPlusPlus14 && LVal.Base == Info.EvaluatingDecl && lifetimeStartedInEvaluation(Info, LVal.Base)) {\n } else if (const ValueDecl *D = LVal.Base.dyn_cast<const ValueDecl *>()) {\n } else if (DynamicAllocLValue DA = LVal.Base.dyn_cast<DynamicAllocLValue>()) {\n if (!Alloc) {\n Info.FFDiag(E, diag::note_constexpr_access_deleted_object) << AK;"}} | ||
}, | }, | ||
["note_constexpr_access_inactive_union_member"]={ | ["note_constexpr_access_inactive_union_member"]={ | ||
Line 1,233: | Line 1,233: | ||
[c]=a, | [c]=a, | ||
[m]={xb,1366986990,sb}, | [m]={xb,1366986990,sb}, | ||
[n]={{p, | [n]={{p,3824,"/// Find the designated sub-object of an rvalue.\ntemplate <typename SubobjectHandler> typename SubobjectHandler::result_type findSubobject(EvalInfo &Info, const Expr *E, const CompleteObject &Obj, const SubobjectDesignator &Sub, SubobjectHandler &handler) {\n // Walk the designator\'s path to find the subobject.\n for (unsigned I = 0, N = Sub.Entries.size(); /**/; ++I) {\n if (ObjType->isArrayType()) {\n } else if (ObjType->isAnyComplexType()) {\n } else if (const FieldDecl *Field = getAsField(Sub.Entries[I])) {\n if (RD->isUnion()) {\n if (!UnionField || UnionField->getCanonicalDecl() != Field->getCanonicalDecl()) {\n if (I == N - 1 && handler.AccessKind == AK_Construct) {\n } else {\n Info.FFDiag(E, diag::note_constexpr_access_inactive_union_member) << handler.AccessKind << Field << !UnionField << UnionField;"},{w,84,"static bool CheckActive(InterpState &S, CodePtr OpPC, const Pointer &Ptr, AccessKinds AK) {\n S.FFDiag(Loc, diag::note_constexpr_access_inactive_union_member) << AK << InactiveField << !ActiveField << ActiveField;"}} | ||
}, | }, | ||
["note_constexpr_access_mutable"]={ | ["note_constexpr_access_mutable"]={ | ||
Line 1,245: | Line 1,245: | ||
[c]=a, | [c]=a, | ||
[m]={"2b4fa5348ee1",1569733726,"For P0784R7: compute whether a variable has constant destruction if it"}, | [m]={"2b4fa5348ee1",1569733726,"For P0784R7: compute whether a variable has constant destruction if it"}, | ||
[n]={{p, | [n]={{p,3542,"/// Diagnose an attempt to read from any unreadable field within the specified\n/// type, which might be a class type.\nstatic bool diagnoseMutableFields(EvalInfo &Info, const Expr *E, AccessKinds AK, QualType T) {\n for (auto *Field : RD->fields()) {\n // If we\'re actually going to read this field in some way, then it can\'t\n // be mutable. If we\'re in a union, then assigning to a mutable field\n // (even an empty one) can change the active member, so that\'s not OK.\n // FIXME: Add core issue number for the union case.\n if (Field->isMutable() && (RD->isUnion() || isReadByLvalueToRvalueConversion(Field->getType()))) {\n Info.FFDiag(E, diag::note_constexpr_access_mutable, 1) << AK << Field;"},{p,3804,"/// Find the designated sub-object of an rvalue.\ntemplate <typename SubobjectHandler> typename SubobjectHandler::result_type findSubobject(EvalInfo &Info, const Expr *E, const CompleteObject &Obj, const SubobjectDesignator &Sub, SubobjectHandler &handler) {\n // Walk the designator\'s path to find the subobject.\n for (unsigned I = 0, N = Sub.Entries.size(); /**/; ++I) {\n if (ObjType->isArrayType()) {\n } else if (ObjType->isAnyComplexType()) {\n } else if (const FieldDecl *Field = getAsField(Sub.Entries[I])) {\n if (Field->isMutable() && !Obj.mayAccessMutableMembers(Info, handler.AccessKind)) {\n Info.FFDiag(E, diag::note_constexpr_access_mutable, 1) << handler.AccessKind << Field;"},{w,231,"bool CheckMutable(InterpState &S, CodePtr OpPC, const Pointer &Ptr) {\n S.FFDiag(Loc, diag::note_constexpr_access_mutable, 1) << AK_Read << Field;"}} | ||
}, | }, | ||
["note_constexpr_access_null"]={ | ["note_constexpr_access_null"]={ | ||
Line 1,257: | Line 1,257: | ||
[c]=a, | [c]=a, | ||
[m]={xb,1366986990,sb}, | [m]={xb,1366986990,sb}, | ||
[n]={{p, | [n]={{p,1654,"#endif\n bool checkNullPointerForFoldAccess(EvalInfo &Info, const Expr *E, AccessKinds AK) {\n return checkNullPointerDiagnosingWith([&Info, E, AK] { Info.FFDiag(E, diag::note_constexpr_access_null) << AK; });"},{p,4009,"/// Find the complete object to which an LValue refers.\nstatic CompleteObject findCompleteObject(EvalInfo &Info, const Expr *E, AccessKinds AK, const LValue &LVal, QualType LValType) {\n if (!LVal.Base) {\n Info.FFDiag(E, diag::note_constexpr_access_null) << AK;"},{w,155,"bool CheckLive(InterpState &S, CodePtr OpPC, const Pointer &Ptr, AccessKinds AK) {\n if (Ptr.isZero()) {\n if (Ptr.isField())\n else\n S.FFDiag(Src, diag::note_constexpr_access_null) << AK;"}} | ||
}, | }, | ||
["note_constexpr_access_past_end"]={ | ["note_constexpr_access_past_end"]={ | ||
Line 1,269: | Line 1,269: | ||
[c]=a, | [c]=a, | ||
[m]={xb,1366986990,sb}, | [m]={xb,1366986990,sb}, | ||
[n]={{p, | [n]={{p,3659,"/// Find the designated sub-object of an rvalue.\ntemplate <typename SubobjectHandler> typename SubobjectHandler::result_type findSubobject(EvalInfo &Info, const Expr *E, const CompleteObject &Obj, const SubobjectDesignator &Sub, SubobjectHandler &handler) {\n if (Sub.isOnePastTheEnd() || Sub.isMostDerivedAnUnsizedArray()) {\n if (Info.getLangOpts().CPlusPlus11)\n Info.FFDiag(E, Sub.isOnePastTheEnd() ? diag::note_constexpr_access_past_end : diag::note_constexpr_access_unsized_array) << handler.AccessKind;"},{p,3761,"/// Find the designated sub-object of an rvalue.\ntemplate <typename SubobjectHandler> typename SubobjectHandler::result_type findSubobject(EvalInfo &Info, const Expr *E, const CompleteObject &Obj, const SubobjectDesignator &Sub, SubobjectHandler &handler) {\n // Walk the designator\'s path to find the subobject.\n for (unsigned I = 0, N = Sub.Entries.size(); /**/; ++I) {\n if (ObjType->isArrayType()) {\n if (CAT->getSize().ule(Index)) {\n // Note, it should not be possible to form a pointer with a valid\n // designator which points more than one past the end of the array.\n if (Info.getLangOpts().CPlusPlus11)\n Info.FFDiag(E, diag::note_constexpr_access_past_end) << handler.AccessKind;"},{p,3782,"/// Find the designated sub-object of an rvalue.\ntemplate <typename SubobjectHandler> typename SubobjectHandler::result_type findSubobject(EvalInfo &Info, const Expr *E, const CompleteObject &Obj, const SubobjectDesignator &Sub, SubobjectHandler &handler) {\n // Walk the designator\'s path to find the subobject.\n for (unsigned I = 0, N = Sub.Entries.size(); /**/; ++I) {\n if (ObjType->isArrayType()) {\n } else if (ObjType->isAnyComplexType()) {\n if (Index > 1) {\n if (Info.getLangOpts().CPlusPlus11)\n Info.FFDiag(E, diag::note_constexpr_access_past_end) << handler.AccessKind;"},{p,4340,"/// Perform an lvalue-to-rvalue conversion on the given glvalue. This\n/// can also be used for \'lvalue-to-lvalue\' conversions for looking up the\n/// glvalue referred to by an entity of reference type.\n///\n/// \\param Info - Information about the ongoing evaluation.\n/// \\param Conv - The expression for which we are performing the conversion.\n/// Used for diagnostics.\n/// \\param Type - The type of the glvalue (before stripping cv-qualifiers in the\n/// case of a non-class type).\n/// \\param LVal - The glvalue on which we are attempting to perform this action.\n/// \\param RVal - The produced value will be placed here.\n/// \\param WantObjectRepresentation - If true, we\'re looking for the object\n/// representation rather than the value, and in particular,\n/// there is no requirement that the result be fully initialized.\nstatic bool handleLValueToRValueConversion(EvalInfo &Info, const Expr *Conv, QualType Type, const LValue &LVal, APValue &RVal, bool WantObjectRepresentation = false) {\n if (Base && !LVal.getLValueCallIndex() && !Type.isVolatileQualified()) {\n if (const CompoundLiteralExpr *CLE = dyn_cast<CompoundLiteralExpr>(Base)) {\n } else if (isa<StringLiteral>(Base) || isa<PredefinedExpr>(Base)) {\n if (LVal.Designator.isOnePastTheEnd()) {\n if (Info.getLangOpts().CPlusPlus11)\n Info.FFDiag(Conv, diag::note_constexpr_access_past_end) << AK;"},{p,5661,"/// Check that we can access the notional vptr of an object / determine its\n/// dynamic type.\nstatic bool checkDynamicType(EvalInfo &Info, const Expr *E, const LValue &This, AccessKinds AK, bool Polymorphic) {\n if (!Obj.Value) {\n // The object is not usable in constant expressions, so we can\'t inspect\n // its value to see if it\'s in-lifetime or what the active union members\n // are. We can still check for a one-past-the-end lvalue.\n if (This.Designator.isOnePastTheEnd() || This.Designator.isMostDerivedAnUnsizedArray()) {\n Info.FFDiag(E, This.Designator.isOnePastTheEnd() ? diag::note_constexpr_access_past_end : diag::note_constexpr_access_unsized_array) << AK;"},{w,191,"bool CheckRange(InterpState &S, CodePtr OpPC, const Pointer &Ptr, AccessKinds AK) {\n S.FFDiag(Loc, diag::note_constexpr_access_past_end) << AK;"}} | ||
}, | }, | ||
["note_constexpr_access_static_temporary"]={ | ["note_constexpr_access_static_temporary"]={ | ||
Line 1,281: | Line 1,281: | ||
[c]=a, | [c]=a, | ||
[m]={"e6c0144208a4",1370393174,"Model temporary lifetime-extension explicitly in the AST. Use this model to"}, | [m]={"e6c0144208a4",1370393174,"Model temporary lifetime-extension explicitly in the AST. Use this model to"}, | ||
[n]={{p, | [n]={{p,4217,"/// Find the complete object to which an LValue refers.\nstatic CompleteObject findCompleteObject(EvalInfo &Info, const Expr *E, AccessKinds AK, const LValue &LVal, QualType LValType) {\n if (Info.getLangOpts().CPlusPlus14 && LVal.Base == Info.EvaluatingDecl && lifetimeStartedInEvaluation(Info, LVal.Base)) {\n } else if (const ValueDecl *D = LVal.Base.dyn_cast<const ValueDecl *>()) {\n } else if (DynamicAllocLValue DA = LVal.Base.dyn_cast<DynamicAllocLValue>()) {\n } else {\n if (!Frame) {\n if (const MaterializeTemporaryExpr *MTE = dyn_cast_or_null<MaterializeTemporaryExpr>(Base)) {\n // C++20 [expr.const]p4: [DR2126]\n // An object or reference is usable in constant expressions if it is\n // - a temporary object of non-volatile const-qualified literal type\n // whose lifetime is extended to that of a variable that is usable\n // in constant expressions\n //\n // C++20 [expr.const]p5:\n // an lvalue-to-rvalue conversion [is not allowed unless it applies to]\n // - a non-volatile glvalue that refers to an object that is usable\n // in constant expressions, or\n // - a non-volatile glvalue of literal type that refers to a\n // non-volatile object whose lifetime began within the evaluation\n // of E;\n //\n // C++11 misses the \'began within the evaluation of e\' check and\n // instead allows all temporaries, including things like:\n // int &&r = 1;\n // int x = ++r;\n // constexpr int k = r;\n // Therefore we use the C++14-onwards rules in C++11 too.\n //\n // Note that temporaries whose lifetimes began while evaluating a\n // variable\'s constructor are not usable while evaluating the\n // corresponding destructor, not even if they\'re of const-qualified\n // types.\n if (!MTE->isUsableInConstantExpressions(Info.Ctx) && !lifetimeStartedInEvaluation(Info, LVal.Base)) {\n Info.FFDiag(E, diag::note_constexpr_access_static_temporary, 1) << AK;"},{w,102,"static bool CheckTemporary(InterpState &S, CodePtr OpPC, const Pointer &Ptr, AccessKinds AK) {\n if (auto ID = Ptr.getDeclID()) {\n S.FFDiag(E, diag::note_constexpr_access_static_temporary, 1) << AK;"}} | ||
}, | }, | ||
["note_constexpr_access_uninit"]={ | ["note_constexpr_access_uninit"]={ | ||
Line 1,293: | Line 1,293: | ||
[c]=a, | [c]=a, | ||
[m]={xb,1366986990,sb}, | [m]={xb,1366986990,sb}, | ||
[n]={{p, | [n]={{p,3679,"/// Find the designated sub-object of an rvalue.\ntemplate <typename SubobjectHandler> typename SubobjectHandler::result_type findSubobject(EvalInfo &Info, const Expr *E, const CompleteObject &Obj, const SubobjectDesignator &Sub, SubobjectHandler &handler) {\n // Walk the designator\'s path to find the subobject.\n for (unsigned I = 0, N = Sub.Entries.size(); /**/; ++I) {\n // Reading an indeterminate value is undefined, but assigning over one is OK.\n if ((O->isAbsent() && !(handler.AccessKind == AK_Construct && I == N)) || (O->isIndeterminate() && !isValidIndeterminateAccess(handler.AccessKind))) {\n if (!Info.checkingPotentialConstantExpression())\n Info.FFDiag(E, diag::note_constexpr_access_uninit) << handler.AccessKind << O->isIndeterminate();"},{w,243,"bool CheckInitialized(InterpState &S, CodePtr OpPC, const Pointer &Ptr, AccessKinds AK) {\n if (!S.checkingPotentialConstantExpression()) {\n S.FFDiag(Loc, diag::note_constexpr_access_uninit) << AK << /*uninitialized=*/true;"}} | ||
}, | }, | ||
["note_constexpr_access_unreadable_object"]={ | ["note_constexpr_access_unreadable_object"]={ | ||
Line 1,305: | Line 1,305: | ||
[c]=a, | [c]=a, | ||
[m]={"7ee4307bd445",1558057565,"Refactor constant evaluation of typeid(T) to track a symbolic type_info"}, | [m]={"7ee4307bd445",1558057565,"Refactor constant evaluation of typeid(T) to track a symbolic type_info"}, | ||
[n]={{p, | [n]={{p,4229,"/// Find the complete object to which an LValue refers.\nstatic CompleteObject findCompleteObject(EvalInfo &Info, const Expr *E, AccessKinds AK, const LValue &LVal, QualType LValType) {\n if (Info.getLangOpts().CPlusPlus14 && LVal.Base == Info.EvaluatingDecl && lifetimeStartedInEvaluation(Info, LVal.Base)) {\n } else if (const ValueDecl *D = LVal.Base.dyn_cast<const ValueDecl *>()) {\n } else if (DynamicAllocLValue DA = LVal.Base.dyn_cast<DynamicAllocLValue>()) {\n } else {\n if (!Frame) {\n if (const MaterializeTemporaryExpr *MTE = dyn_cast_or_null<MaterializeTemporaryExpr>(Base)) {\n } else {\n Info.FFDiag(E, diag::note_constexpr_access_unreadable_object) << AK << Val.getAsString(Info.Ctx, Info.Ctx.getLValueReferenceType(LValType));"}} | ||
}, | }, | ||
["note_constexpr_access_unsized_array"]={ | ["note_constexpr_access_unsized_array"]={ | ||
Line 1,317: | Line 1,317: | ||
[c]=a, | [c]=a, | ||
[m]={"2cd56048239f",1503971533,"Improve constant expression evaluation of arrays of unknown bound."}, | [m]={"2cd56048239f",1503971533,"Improve constant expression evaluation of arrays of unknown bound."}, | ||
[n]={{p, | [n]={{p,3660,"/// Find the designated sub-object of an rvalue.\ntemplate <typename SubobjectHandler> typename SubobjectHandler::result_type findSubobject(EvalInfo &Info, const Expr *E, const CompleteObject &Obj, const SubobjectDesignator &Sub, SubobjectHandler &handler) {\n if (Sub.isOnePastTheEnd() || Sub.isMostDerivedAnUnsizedArray()) {\n if (Info.getLangOpts().CPlusPlus11)\n Info.FFDiag(E, Sub.isOnePastTheEnd() ? diag::note_constexpr_access_past_end : diag::note_constexpr_access_unsized_array) << handler.AccessKind;"},{p,5662,"/// Check that we can access the notional vptr of an object / determine its\n/// dynamic type.\nstatic bool checkDynamicType(EvalInfo &Info, const Expr *E, const LValue &This, AccessKinds AK, bool Polymorphic) {\n if (!Obj.Value) {\n // The object is not usable in constant expressions, so we can\'t inspect\n // its value to see if it\'s in-lifetime or what the active union members\n // are. We can still check for a one-past-the-end lvalue.\n if (This.Designator.isOnePastTheEnd() || This.Designator.isMostDerivedAnUnsizedArray()) {\n Info.FFDiag(E, This.Designator.isOnePastTheEnd() ? diag::note_constexpr_access_past_end : diag::note_constexpr_access_unsized_array) << AK;"}} | ||
}, | }, | ||
["note_constexpr_access_volatile_obj"]={ | ["note_constexpr_access_volatile_obj"]={ | ||
Line 1,329: | Line 1,329: | ||
[c]=a, | [c]=a, | ||
[m]={xb,1366986990,sb}, | [m]={xb,1366986990,sb}, | ||
[n]={{p, | [n]={{p,3719,"/// Find the designated sub-object of an rvalue.\ntemplate <typename SubobjectHandler> typename SubobjectHandler::result_type findSubobject(EvalInfo &Info, const Expr *E, const CompleteObject &Obj, const SubobjectDesignator &Sub, SubobjectHandler &handler) {\n // Walk the designator\'s path to find the subobject.\n for (unsigned I = 0, N = Sub.Entries.size(); /**/; ++I) {\n // If this is our last pass, check that the final object type is OK.\n if (I == N || (I == N - 1 && ObjType->isAnyComplexType())) {\n // Accesses to volatile objects are prohibited.\n if (ObjType.isVolatileQualified() && isFormalAccess(handler.AccessKind)) {\n if (Info.getLangOpts().CPlusPlus) {\n Info.FFDiag(E, diag::note_constexpr_access_volatile_obj, 1) << handler.AccessKind << DiagKind << Decl;"}} | ||
}, | }, | ||
["note_constexpr_access_volatile_type"]={ | ["note_constexpr_access_volatile_type"]={ | ||
Line 1,341: | Line 1,341: | ||
[c]=a, | [c]=a, | ||
[m]={xb,1366986990,sb}, | [m]={xb,1366986990,sb}, | ||
[n]={{p, | [n]={{p,4034,"/// Find the complete object to which an LValue refers.\nstatic CompleteObject findCompleteObject(EvalInfo &Info, const Expr *E, AccessKinds AK, const LValue &LVal, QualType LValType) {\n // C++11 DR1311: An lvalue-to-rvalue conversion on a volatile-qualified type\n // is not a constant expression (even if the object is non-volatile). We also\n // apply this rule to C++98, in order to conform to the expected \'volatile\'\n // semantics.\n if (isFormalAccess(AK) && LValType.isVolatileQualified()) {\n if (Info.getLangOpts().CPlusPlus)\n Info.FFDiag(E, diag::note_constexpr_access_volatile_type) << AK << LValType;"}} | ||
}, | }, | ||
["note_constexpr_alignment_adjust"]={ | ["note_constexpr_alignment_adjust"]={ | ||
Line 1,353: | Line 1,353: | ||
[c]=a, | [c]=a, | ||
[m]={"8c387cbea76b",1578602886,"Add builtins for aligning and checking alignment of pointers and integers"}, | [m]={"8c387cbea76b",1578602886,"Add builtins for aligning and checking alignment of pointers and integers"}, | ||
[n]={{p, | [n]={{p,9287,"bool PointerExprEvaluator::VisitBuiltinCallExpr(const CallExpr *E, unsigned BuiltinOp) {\n case Builtin::BI__builtin_align_down: {\n Info.FFDiag(E->getArg(0), diag::note_constexpr_alignment_adjust) << Alignment;"}} | ||
}, | }, | ||
["note_constexpr_alignment_compute"]={ | ["note_constexpr_alignment_compute"]={ | ||
Line 1,365: | Line 1,365: | ||
[c]=a, | [c]=a, | ||
[m]={"8c387cbea76b",1578602886,"Add builtins for aligning and checking alignment of pointers and integers"}, | [m]={"8c387cbea76b",1578602886,"Add builtins for aligning and checking alignment of pointers and integers"}, | ||
[n]={{p, | [n]={{p,12026,"bool IntExprEvaluator::VisitBuiltinCallExpr(const CallExpr *E, unsigned BuiltinOp) {\n case Builtin::BI__builtin_is_aligned: {\n if (Src.isLValue()) {\n Info.FFDiag(E->getArg(0), diag::note_constexpr_alignment_compute) << Alignment;"}} | ||
}, | }, | ||
["note_constexpr_alignment_too_big"]={ | ["note_constexpr_alignment_too_big"]={ | ||
Line 1,377: | Line 1,377: | ||
[c]=a, | [c]=a, | ||
[m]={"8c387cbea76b",1578602886,"Add builtins for aligning and checking alignment of pointers and integers"}, | [m]={"8c387cbea76b",1578602886,"Add builtins for aligning and checking alignment of pointers and integers"}, | ||
[n]={{p, | [n]={{p,9149,"/// Evaluate the value of the alignment argument to __builtin_align_{up,down},\n/// __builtin_is_aligned and __builtin_assume_aligned.\nstatic bool getAlignmentArgument(const Expr *E, QualType ForType, EvalInfo &Info, APSInt &Alignment) {\n if (APSInt::compareValues(Alignment, MaxValue) > 0) {\n Info.FFDiag(E, diag::note_constexpr_alignment_too_big) << MaxValue << ForType << Alignment;"}} | ||
}, | }, | ||
["note_constexpr_array_index"]={ | ["note_constexpr_array_index"]={ | ||
Line 1,389: | Line 1,389: | ||
[c]=a, | [c]=a, | ||
[m]={"a8105bc9cecb",1325867940,"C++11 generalized constant expressions: implement checking and diagnostics for"}, | [m]={"a8105bc9cecb",1325867940,"C++11 generalized constant expressions: implement checking and diagnostics for"}, | ||
[n]={{p, | [n]={{p,1435,"void SubobjectDesignator::diagnosePointerArithmetic(EvalInfo &Info, const Expr *E, const APSInt &N) {\n // If we\'re complaining, we must be able to statically determine the size of\n // the most derived array.\n if (MostDerivedPathLength == Entries.size() && MostDerivedIsArrayElement)\n Info.CCEDiag(E, diag::note_constexpr_array_index) << N << /*array*/ 0 << static_cast<unsigned>(getMostDerivedArraySize());"},{p,1439,"void SubobjectDesignator::diagnosePointerArithmetic(EvalInfo &Info, const Expr *E, const APSInt &N) {\n // If we\'re complaining, we must be able to statically determine the size of\n // the most derived array.\n if (MostDerivedPathLength == Entries.size() && MostDerivedIsArrayElement)\n else\n Info.CCEDiag(E, diag::note_constexpr_array_index) << N << /*non-array*/ 1;"}} | ||
}, | }, | ||
["note_constexpr_baa_insufficient_alignment"]={ | ["note_constexpr_baa_insufficient_alignment"]={ | ||
Line 1,401: | Line 1,401: | ||
[c]=a, | [c]=a, | ||
[m]={"0dd05d4b5936",1412356717,"constexpr evaluation for __builtin_assume_aligned"}, | [m]={"0dd05d4b5936",1412356717,"constexpr evaluation for __builtin_assume_aligned"}, | ||
[n]={{p, | [n]={{p,9231,"bool PointerExprEvaluator::VisitBuiltinCallExpr(const CallExpr *E, unsigned BuiltinOp) {\n case Builtin::BI__builtin_assume_aligned: {\n // If there is a base object, then it must have the correct alignment.\n if (OffsetResult.Base) {\n if (BaseAlignment < Align) {\n CCEDiag(E->getArg(0), diag::note_constexpr_baa_insufficient_alignment) << 0 << (unsigned)BaseAlignment.getQuantity() << (unsigned)Align.getQuantity();"},{p,9244,"bool PointerExprEvaluator::VisitBuiltinCallExpr(const CallExpr *E, unsigned BuiltinOp) {\n case Builtin::BI__builtin_assume_aligned: {\n // The offset must also have the correct alignment.\n if (OffsetResult.Offset.alignTo(Align) != OffsetResult.Offset) {\n (OffsetResult.Base ? CCEDiag(E->getArg(0), diag::note_constexpr_baa_insufficient_alignment) << 1 : CCEDiag(E->getArg(0), diag::note_constexpr_baa_value_insufficient_alignment)) << (int)OffsetResult.Offset.getQuantity() << (unsigned)Align.getQuantity();"}} | ||
}, | }, | ||
["note_constexpr_baa_value_insufficient_alignment"]={ | ["note_constexpr_baa_value_insufficient_alignment"]={ | ||
Line 1,413: | Line 1,413: | ||
[c]=a, | [c]=a, | ||
[m]={"0dd05d4b5936",1412356717,"constexpr evaluation for __builtin_assume_aligned"}, | [m]={"0dd05d4b5936",1412356717,"constexpr evaluation for __builtin_assume_aligned"}, | ||
[n]={{p, | [n]={{p,9246,"bool PointerExprEvaluator::VisitBuiltinCallExpr(const CallExpr *E, unsigned BuiltinOp) {\n case Builtin::BI__builtin_assume_aligned: {\n // The offset must also have the correct alignment.\n if (OffsetResult.Offset.alignTo(Align) != OffsetResult.Offset) {\n (OffsetResult.Base ? CCEDiag(E->getArg(0), diag::note_constexpr_baa_insufficient_alignment) << 1 : CCEDiag(E->getArg(0), diag::note_constexpr_baa_value_insufficient_alignment)) << (int)OffsetResult.Offset.getQuantity() << (unsigned)Align.getQuantity();"}} | ||
}, | }, | ||
["note_constexpr_bit_cast_indet_dest"]={ | ["note_constexpr_bit_cast_indet_dest"]={ | ||
Line 1,425: | Line 1,425: | ||
[c]=a, | [c]=a, | ||
[m]={gc,1562092093,hc}, | [m]={gc,1562092093,hc}, | ||
[n]={{p, | [n]={{p,7142,"/// Write an BitCastBuffer into an APValue.\nclass BufferToAPValueConverter {\n std::optional<APValue> visit(const BuiltinType *T, CharUnits Offset, const EnumType *EnumSugar = nullptr) {\n if (!Buffer.readObject(Offset, SizeOf, Bytes)) {\n if (!IsStdByte && !IsUChar) {\n Info.FFDiag(BCE->getExprLoc(), diag::note_constexpr_bit_cast_indet_dest) << DisplayType << Info.Ctx.getLangOpts().CharIsSigned;"}} | ||
}, | }, | ||
["note_constexpr_bit_cast_invalid_subtype"]={ | ["note_constexpr_bit_cast_invalid_subtype"]={ | ||
Line 1,437: | Line 1,437: | ||
[c]=a, | [c]=a, | ||
[m]={gc,1562092093,hc}, | [m]={gc,1562092093,hc}, | ||
[n]={{p, | [n]={{p,7309,"static bool checkBitCastConstexprEligibilityType(SourceLocation Loc, QualType Ty, EvalInfo *Info, const ASTContext &Ctx, bool CheckingDest) {\n auto note = [&](int Construct, QualType NoteTy, SourceLocation NoteLoc) {\n if (Info)\n Info->Note(NoteLoc, diag::note_constexpr_bit_cast_invalid_subtype) << NoteTy << Construct << Ty;"}} | ||
}, | }, | ||
["note_constexpr_bit_cast_invalid_type"]={ | ["note_constexpr_bit_cast_invalid_type"]={ | ||
Line 1,449: | Line 1,449: | ||
[c]=a, | [c]=a, | ||
[m]={gc,1562092093,hc}, | [m]={gc,1562092093,hc}, | ||
[n]={{p, | [n]={{p,7303,"static bool checkBitCastConstexprEligibilityType(SourceLocation Loc, QualType Ty, EvalInfo *Info, const ASTContext &Ctx, bool CheckingDest) {\n auto diag = [&](int Reason) {\n if (Info)\n Info->FFDiag(Loc, diag::note_constexpr_bit_cast_invalid_type) << CheckingDest << (Reason == 4) << Reason;"}} | ||
}, | }, | ||
["note_constexpr_bit_cast_unrepresentable_value"]={ | ["note_constexpr_bit_cast_unrepresentable_value"]={ | ||
Line 1,461: | Line 1,461: | ||
[c]=a, | [c]=a, | ||
[m]={"9523cf02c22a",1599063797,"[AST] Fix handling of long double and bool in __builtin_bit_cast"}, | [m]={"9523cf02c22a",1599063797,"[AST] Fix handling of long double and bool in __builtin_bit_cast"}, | ||
[n]={{p, | [n]={{p,7102,"/// Write an BitCastBuffer into an APValue.\nclass BufferToAPValueConverter {\n std::nullopt_t unrepresentableValue(QualType Ty, const APSInt &Val) {\n Info.FFDiag(BCE->getBeginLoc(), diag::note_constexpr_bit_cast_unrepresentable_value) << Ty << toString(Val, /*Radix=*/10);"}} | ||
}, | }, | ||
["note_constexpr_bit_cast_unsupported_bitfield"]={ | ["note_constexpr_bit_cast_unsupported_bitfield"]={ | ||
Line 1,473: | Line 1,473: | ||
[c]=a, | [c]=a, | ||
[m]={gc,1562092093,hc}, | [m]={gc,1562092093,hc}, | ||
[n]={{p, | [n]={{p,7003,"/// Traverse an APValue to produce an BitCastBuffer, emulating how the current\n/// target would represent the value at runtime.\nclass APValueToBufferConverter {\n bool visitRecord(const APValue &Val, QualType Ty, CharUnits Offset) {\n for (FieldDecl *FD : RD->fields()) {\n if (FD->isBitField()) {\n Info.FFDiag(BCE->getBeginLoc(), diag::note_constexpr_bit_cast_unsupported_bitfield);"},{p,7211,"/// Write an BitCastBuffer into an APValue.\nclass BufferToAPValueConverter {\n std::optional<APValue> visit(const RecordType *RTy, CharUnits Offset) {\n for (FieldDecl *FD : RD->fields()) {\n // FIXME: We don\'t currently support bit-fields. A lot of the logic for\n // this is in CodeGen, so we need to factor it around.\n if (FD->isBitField()) {\n Info.FFDiag(BCE->getBeginLoc(), diag::note_constexpr_bit_cast_unsupported_bitfield);"}} | ||
}, | }, | ||
["note_constexpr_bit_cast_unsupported_type"]={ | ["note_constexpr_bit_cast_unsupported_type"]={ | ||
Line 1,485: | Line 1,485: | ||
[c]=a, | [c]=a, | ||
[m]={gc,1562092093,hc}, | [m]={gc,1562092093,hc}, | ||
[n]={{p, | [n]={{p,6971,"/// Traverse an APValue to produce an BitCastBuffer, emulating how the current\n/// target would represent the value at runtime.\nclass APValueToBufferConverter {\n // Write out Val with type Ty into Buffer starting at Offset.\n bool visit(const APValue &Val, QualType Ty, CharUnits Offset) {\n case APValue::AddrLabelDiff: {\n Info.FFDiag(BCE->getBeginLoc(), diag::note_constexpr_bit_cast_unsupported_type) << Ty;"},{p,7095,"/// Write an BitCastBuffer into an APValue.\nclass BufferToAPValueConverter {\n // Emit an unsupported bit_cast type error. Sema refuses to build a bit_cast\n // with an invalid type, so anything left is a deficiency on our part (FIXME).\n // Ideally this will be unreachable.\n std::nullopt_t unsupportedType(QualType Ty) {\n Info.FFDiag(BCE->getBeginLoc(), diag::note_constexpr_bit_cast_unsupported_type) << Ty;"}} | ||
}, | }, | ||
["note_constexpr_body_previous_return"]={ | ["note_constexpr_body_previous_return"]={ | ||
Line 1,497: | Line 1,497: | ||
[c]=o, | [c]=o, | ||
[m]={fb,1317436288,mb}, | [m]={fb,1317436288,mb}, | ||
[n]={{q, | [n]={{q,2403,"/// Check the body for the given constexpr function declaration only contains\n/// the permitted types of statement. C++11 [dcl.constexpr]p3,p4.\n///\n/// \\return true if the body is OK, false if we have found or diagnosed a\n/// problem.\nstatic bool CheckConstexprFunctionBody(Sema &SemaRef, const FunctionDecl *Dcl, Stmt *Body, Sema::CheckConstexprKind Kind) {\n if (const CXXConstructorDecl *Constructor = dyn_cast<CXXConstructorDecl>(Dcl)) {\n } else {\n if (ReturnStmts.empty()) {\n } else if (ReturnStmts.size() > 1) {\n case Sema::CheckConstexprKind::Diagnose:\n for (unsigned I = 0; I < ReturnStmts.size() - 1; ++I)\n SemaRef.Diag(ReturnStmts[I], diag::note_constexpr_body_previous_return);"}} | ||
}, | }, | ||
["note_constexpr_call_here"]={ | ["note_constexpr_call_here"]={ | ||
Line 1,509: | Line 1,509: | ||
[c]=a, | [c]=a, | ||
[m]={"f6f003af6a91",1324062367,"C++11 constexpr: Add note stacks containing backtraces if constant evaluation"}, | [m]={"f6f003af6a91",1324062367,"C++11 constexpr: Add note stacks containing backtraces if constant evaluation"}, | ||
[n]={{"clang/lib/AST/Interp/State.cpp", | [n]={{"clang/lib/AST/Interp/State.cpp",158,"void State::addCallStack(unsigned Limit) {\n for (const Frame *F = Top; F != Bottom; F = F->getCaller(), ++CallIdx) {\n addDiag(CallLocation, diag::note_constexpr_call_here) << Out.str();"}} | ||
}, | }, | ||
["note_constexpr_call_limit_exceeded"]={ | ["note_constexpr_call_limit_exceeded"]={ | ||
Line 1,521: | Line 1,521: | ||
[c]=a, | [c]=a, | ||
[m]={"b228a86fcfd1",1329272293,"Implement DR1454. This allows all intermediate results in constant expressions"}, | [m]={"b228a86fcfd1",1329272293,"Implement DR1454. This allows all intermediate results in constant expressions"}, | ||
[n]={{p, | [n]={{p,1013,"/// EvalInfo - This is a private struct used by the evaluator to capture\n/// information about a subexpression as it is folded. It retains information\n/// about the AST context, but also maintains information about the folded\n/// expression.\n///\n/// If an expression could be evaluated, it is still possible it is not a C\n/// \"integer constant expression\" or constant expression. If not, this struct\n/// captures information about how and why not.\n///\n/// One bit of information passed *into* the request for constant folding\n/// indicates whether the subexpression is \"evaluated\" or not according to C\n/// rules. For example, the RHS of (0 && foo()) is not evaluated. We can\n/// evaluate the expression regardless of what the RHS is, but C only allows\n/// certain things in certain situations.\nclass EvalInfo : public interp::State {\n bool CheckCallLimit(SourceLocation Loc) {\n if (NextCallIndex == 0) {\n FFDiag(Loc, diag::note_constexpr_call_limit_exceeded);"}} | ||
}, | }, | ||
["note_constexpr_calls_suppressed"]={ | ["note_constexpr_calls_suppressed"]={ | ||
Line 1,533: | Line 1,533: | ||
[c]=a, | [c]=a, | ||
[m]={"f6f003af6a91",1324062367,"C++11 constexpr: Add note stacks containing backtraces if constant evaluation"}, | [m]={"f6f003af6a91",1324062367,"C++11 constexpr: Add note stacks containing backtraces if constant evaluation"}, | ||
[n]={{"clang/lib/AST/Interp/State.cpp", | [n]={{"clang/lib/AST/Interp/State.cpp",139,"void State::addCallStack(unsigned Limit) {\n for (const Frame *F = Top; F != Bottom; F = F->getCaller(), ++CallIdx) {\n // Skip this call?\n if (CallIdx >= SkipStart && CallIdx < SkipEnd) {\n if (CallIdx == SkipStart) {\n addDiag(CallLocation, diag::note_constexpr_calls_suppressed) << unsigned(ActiveCalls - Limit);"}} | ||
}, | }, | ||
["note_constexpr_compare_virtual_mem_ptr"]={ | ["note_constexpr_compare_virtual_mem_ptr"]={ | ||
Line 1,545: | Line 1,545: | ||
[c]=a, | [c]=a, | ||
[m]={"7bb0067c06ef",1328060564,"constexpr: add support for comparisons of pointer-to-members."}, | [m]={"7bb0067c06ef",1328060564,"constexpr: add support for comparisons of pointer-to-members."}, | ||
[n]={{p, | [n]={{p,13246,"template <class SuccessCB, class AfterCB> static bool EvaluateComparisonBinaryOperator(EvalInfo &Info, const BinaryOperator *E, SuccessCB &&Success, AfterCB &&DoAfter) {\n if (LHSTy->isMemberPointerType()) {\n // Otherwise if either is a pointer to a virtual member function, the\n // result is unspecified.\n if (const CXXMethodDecl *MD = dyn_cast<CXXMethodDecl>(LHSValue.getDecl()))\n if (MD->isVirtual())\n Info.CCEDiag(E, diag::note_constexpr_compare_virtual_mem_ptr) << MD;"},{p,13249,"template <class SuccessCB, class AfterCB> static bool EvaluateComparisonBinaryOperator(EvalInfo &Info, const BinaryOperator *E, SuccessCB &&Success, AfterCB &&DoAfter) {\n if (LHSTy->isMemberPointerType()) {\n if (const CXXMethodDecl *MD = dyn_cast<CXXMethodDecl>(RHSValue.getDecl()))\n if (MD->isVirtual())\n Info.CCEDiag(E, diag::note_constexpr_compare_virtual_mem_ptr) << MD;"}} | ||
}, | }, | ||
["note_constexpr_conditional_never_const"]={ | ["note_constexpr_conditional_never_const"]={ | ||
Line 1,557: | Line 1,557: | ||
[c]=a, | [c]=a, | ||
[m]={"17100bad0ac1",1329360394,"constexpr tidyups:"}, | [m]={"17100bad0ac1",1329360394,"constexpr tidyups:"}, | ||
[n]={{p, | [n]={{p,7429,"template <class Derived> class ExprEvaluatorBase : public ConstStmtVisitor<Derived, bool> {\n // Check whether a conditional operator with a non-constant condition is a\n // potential constant expression. If neither arm is a potential constant\n // expression, then the conditional operator is not either.\n template <typename ConditionalOperator> void CheckPotentialConstantConditional(const ConditionalOperator *E) {\n Error(E, diag::note_constexpr_conditional_never_const);"}} | ||
}, | }, | ||
["note_constexpr_construct_complex_elem"]={ | ["note_constexpr_construct_complex_elem"]={ | ||
Line 1,569: | Line 1,569: | ||
[c]=a, | [c]=a, | ||
[m]={"b542602c5f35",1570063175,"For P0784R7: support placement new-expressions in constant evaluation."}, | [m]={"b542602c5f35",1570063175,"For P0784R7: support placement new-expressions in constant evaluation."}, | ||
[n]={{p, | [n]={{p,9717,"bool PointerExprEvaluator::VisitCXXNewExpr(const CXXNewExpr *E) {\n if (IsPlacement) {\n struct FindObjectHandler {\n bool found(APSInt &Value, QualType SubobjType) {\n Info.FFDiag(E, diag::note_constexpr_construct_complex_elem);"},{p,9721,"bool PointerExprEvaluator::VisitCXXNewExpr(const CXXNewExpr *E) {\n if (IsPlacement) {\n struct FindObjectHandler {\n bool found(APFloat &Value, QualType SubobjType) {\n Info.FFDiag(E, diag::note_constexpr_construct_complex_elem);"}} | ||
}, | }, | ||
["note_constexpr_ctor_missing_init"]={ | ["note_constexpr_ctor_missing_init"]={ | ||
Line 1,581: | Line 1,581: | ||
[c]=o, | [c]=o, | ||
[m]={fb,1317436288,mb}, | [m]={fb,1317436288,mb}, | ||
[n]={{q, | [n]={{q,2049,"/// Check that the given field is initialized within a constexpr constructor.\n///\n/// \\param Dcl The constexpr constructor being checked.\n/// \\param Field The field being checked. This may be a member of an anonymous\n/// struct or union nested within the class being checked.\n/// \\param Inits All declarations, including anonymous struct/union members and\n/// indirect members, for which any initialization was provided.\n/// \\param Diagnosed Whether we\'ve emitted the error message yet. Used to attach\n/// multiple notes for different members to the same error.\n/// \\param Kind Whether we\'re diagnosing a constructor as written or determining\n/// whether the formal requirements are satisfied.\n/// \\return \\c false if we\'re checking for validity and the constructor does\n/// not satisfy the requirements on a constexpr constructor.\nstatic bool CheckConstexprCtorInitializer(Sema &SemaRef, const FunctionDecl *Dcl, FieldDecl *Field, llvm::SmallSet<Decl *, 16> &Inits, bool &Diagnosed, Sema::CheckConstexprKind Kind) {\n if (!Inits.count(Field)) {\n if (Kind == Sema::CheckConstexprKind::Diagnose) {\n SemaRef.Diag(Field->getLocation(), diag::note_constexpr_ctor_missing_init);"}} | ||
}, | }, | ||
["note_constexpr_deallocate_null"]={ | ["note_constexpr_deallocate_null"]={ | ||
Line 1,593: | Line 1,593: | ||
[c]=a, | [c]=a, | ||
[m]={"a892b0015ed6",1615331091,"PR49465: Disallow constant evaluation of a call to operator delete(nullptr)."}, | [m]={"a892b0015ed6",1615331091,"PR49465: Disallow constant evaluation of a call to operator delete(nullptr)."}, | ||
[n]={{p, | [n]={{p,6858,"// Perform a call to \'operator delete\' or \'__builtin_operator_delete\'.\nbool HandleOperatorDeleteCall(EvalInfo &Info, const CallExpr *E) {\n // Deleting a null pointer would have no effect, but it\'s not permitted by\n // std::allocator<T>::deallocate\'s contract.\n if (Pointer.isNullPointer()) {\n Info.CCEDiag(E->getExprLoc(), diag::note_constexpr_deallocate_null);"}} | ||
}, | }, | ||
["note_constexpr_delete_base_nonvirt_dtor"]={ | ["note_constexpr_delete_base_nonvirt_dtor"]={ | ||
Line 1,605: | Line 1,605: | ||
[c]=a, | [c]=a, | ||
[m]={M,1569547607,J}, | [m]={M,1569547607,J}, | ||
[n]={{p, | [n]={{p,15029,"bool VoidExprEvaluator::VisitCXXDeleteExpr(const CXXDeleteExpr *E) {\n // For the non-array case, the designator must be empty if the static type\n // does not have a virtual destructor.\n if (!E->isArrayForm() && Pointer.Designator.Entries.size() != 0 && !hasVirtualDestructor(Arg->getType()->getPointeeType())) {\n Info.FFDiag(E, diag::note_constexpr_delete_base_nonvirt_dtor) << Arg->getType()->getPointeeType() << AllocType;"}} | ||
}, | }, | ||
["note_constexpr_delete_not_heap_alloc"]={ | ["note_constexpr_delete_not_heap_alloc"]={ | ||
Line 1,617: | Line 1,617: | ||
[c]=a, | [c]=a, | ||
[m]={M,1569547607,J}, | [m]={M,1569547607,J}, | ||
[n]={{p, | [n]={{p,6796,"/// Check that the given object is a suitable pointer to a heap allocation that\n/// still exists and is of the right kind for the purpose of a deletion.\n///\n/// On success, returns the heap allocation to deallocate. On failure, produces\n/// a diagnostic and returns std::nullopt.\nstatic std::optional<DynAlloc *> CheckDeleteKind(EvalInfo &Info, const Expr *E, const LValue &Pointer, DynAlloc::Kind DeallocKind) {\n if (!DA) {\n Info.FFDiag(E, diag::note_constexpr_delete_not_heap_alloc) << PointerAsString();"}} | ||
}, | }, | ||
["note_constexpr_delete_subobject"]={ | ["note_constexpr_delete_subobject"]={ | ||
Line 1,629: | Line 1,629: | ||
[c]=a, | [c]=a, | ||
[m]={M,1569547607,J}, | [m]={M,1569547607,J}, | ||
[n]={{p, | [n]={{p,6826,"/// Check that the given object is a suitable pointer to a heap allocation that\n/// still exists and is of the right kind for the purpose of a deletion.\n///\n/// On success, returns the heap allocation to deallocate. On failure, produces\n/// a diagnostic and returns std::nullopt.\nstatic std::optional<DynAlloc *> CheckDeleteKind(EvalInfo &Info, const Expr *E, const LValue &Pointer, DynAlloc::Kind DeallocKind) {\n if (Subobject) {\n Info.FFDiag(E, diag::note_constexpr_delete_subobject) << PointerAsString() << Pointer.Designator.isOnePastTheEnd();"}} | ||
}, | }, | ||
["note_constexpr_depth_limit_exceeded"]={ | ["note_constexpr_depth_limit_exceeded"]={ | ||
Line 1,641: | Line 1,641: | ||
[c]=a, | [c]=a, | ||
[m]={Bb,1323758398,Eb}, | [m]={Bb,1323758398,Eb}, | ||
[n]={{p, | [n]={{p,1018,"/// EvalInfo - This is a private struct used by the evaluator to capture\n/// information about a subexpression as it is folded. It retains information\n/// about the AST context, but also maintains information about the folded\n/// expression.\n///\n/// If an expression could be evaluated, it is still possible it is not a C\n/// \"integer constant expression\" or constant expression. If not, this struct\n/// captures information about how and why not.\n///\n/// One bit of information passed *into* the request for constant folding\n/// indicates whether the subexpression is \"evaluated\" or not according to C\n/// rules. For example, the RHS of (0 && foo()) is not evaluated. We can\n/// evaluate the expression regardless of what the RHS is, but C only allows\n/// certain things in certain situations.\nclass EvalInfo : public interp::State {\n bool CheckCallLimit(SourceLocation Loc) {\n FFDiag(Loc, diag::note_constexpr_depth_limit_exceeded) << getLangOpts().ConstexprCallDepth;"},{w,348,"bool CheckCallDepth(InterpState &S, CodePtr OpPC) {\n if ((S.Current->getDepth() + 1) > S.getLangOpts().ConstexprCallDepth) {\n S.FFDiag(S.Current->getSource(OpPC), diag::note_constexpr_depth_limit_exceeded) << S.getLangOpts().ConstexprCallDepth;"}} | ||
}, | }, | ||
["note_constexpr_destroy_complex_elem"]={ | ["note_constexpr_destroy_complex_elem"]={ | ||
Line 1,653: | Line 1,653: | ||
[c]=a, | [c]=a, | ||
[m]={"61422f96653f",1569615876,"For P0784R7: add support for explicit destructor calls and"}, | [m]={"61422f96653f",1569615876,"For P0784R7: add support for explicit destructor calls and"}, | ||
[n]={{p, | [n]={{p,6671,"struct DestroyObjectHandler {\n bool found(APSInt &Value, QualType SubobjType) {\n Info.FFDiag(E, diag::note_constexpr_destroy_complex_elem);"},{p,6675,"struct DestroyObjectHandler {\n bool found(APFloat &Value, QualType SubobjType) {\n Info.FFDiag(E, diag::note_constexpr_destroy_complex_elem);"}} | ||
}, | }, | ||
["note_constexpr_destroy_out_of_lifetime"]={ | ["note_constexpr_destroy_out_of_lifetime"]={ | ||
Line 1,665: | Line 1,665: | ||
[c]=a, | [c]=a, | ||
[m]={M,1569547607,J}, | [m]={M,1569547607,J}, | ||
[n]={{p, | [n]={{p,6500,"static bool HandleDestructionImpl(EvalInfo &Info, SourceLocation CallLoc, const LValue &This, APValue &Value, QualType T) {\n // Objects can only be destroyed while they\'re within their lifetimes.\n // FIXME: We have no representation for whether an object of type nullptr_t\n // is in its lifetime; it usually doesn\'t matter. Perhaps we should model it\n // as indeterminate instead?\n if (Value.isAbsent() && !T->isNullPtrType()) {\n Info.FFDiag(CallLoc, diag::note_constexpr_destroy_out_of_lifetime) << Printable.getAsString(Info.Ctx, Info.Ctx.getLValueReferenceType(T));"}} | ||
}, | }, | ||
["note_constexpr_double_delete"]={ | ["note_constexpr_double_delete"]={ | ||
Line 1,677: | Line 1,677: | ||
[c]=a, | [c]=a, | ||
[m]={M,1569547607,J}, | [m]={M,1569547607,J}, | ||
[n]={{p, | [n]={{p,6805,"/// Check that the given object is a suitable pointer to a heap allocation that\n/// still exists and is of the right kind for the purpose of a deletion.\n///\n/// On success, returns the heap allocation to deallocate. On failure, produces\n/// a diagnostic and returns std::nullopt.\nstatic std::optional<DynAlloc *> CheckDeleteKind(EvalInfo &Info, const Expr *E, const LValue &Pointer, DynAlloc::Kind DeallocKind) {\n if (!Alloc) {\n Info.FFDiag(E, diag::note_constexpr_double_delete);"},{p,15055,"bool VoidExprEvaluator::VisitCXXDeleteExpr(const CXXDeleteExpr *E) {\n if (!Info.HeapAllocs.erase(Pointer.Base.dyn_cast<DynamicAllocLValue>())) {\n Info.FFDiag(E, diag::note_constexpr_double_delete);"}} | ||
}, | }, | ||
["note_constexpr_double_destroy"]={ | ["note_constexpr_double_destroy"]={ | ||
Line 1,689: | Line 1,689: | ||
[c]=a, | [c]=a, | ||
[m]={M,1569547607,J}, | [m]={M,1569547607,J}, | ||
[n]={{p, | [n]={{p,6598,"static bool HandleDestructionImpl(EvalInfo &Info, SourceLocation CallLoc, const LValue &This, APValue &Value, QualType T) {\n if (!EvalObj.DidInsert) {\n Info.FFDiag(CallLoc, diag::note_constexpr_double_destroy);"}} | ||
}, | }, | ||
["note_constexpr_dtor_subobject"]={ | ["note_constexpr_dtor_subobject"]={ | ||
Line 1,701: | Line 1,701: | ||
[c]=o, | [c]=o, | ||
[m]={Ab,1567434909,Cb}, | [m]={Ab,1567434909,Cb}, | ||
[n]={{q, | [n]={{q,1700,"/// Determine whether a destructor cannot be constexpr due to\nstatic bool CheckConstexprDestructorSubobjects(Sema &SemaRef, const CXXDestructorDecl *DD, Sema::CheckConstexprKind Kind) {\n auto Check = [&](SourceLocation Loc, QualType T, const FieldDecl *FD) {\n if (Kind == Sema::CheckConstexprKind::Diagnose) {\n SemaRef.Diag(Loc, diag::note_constexpr_dtor_subobject) << !FD << (FD ? FD->getDeclName() : DeclarationName()) << T;"}} | ||
}, | }, | ||
["note_constexpr_dynamic_alloc"]={ | ["note_constexpr_dynamic_alloc"]={ | ||
Line 1,713: | Line 1,713: | ||
[c]=a, | [c]=a, | ||
[m]={M,1569547607,J}, | [m]={M,1569547607,J}, | ||
[n]={{p, | [n]={{p,2234,"/// Check that this reference or pointer core constant expression is a valid\n/// value for an address or reference constant expression. Return true if we\n/// can fold this expression, whether or not it\'s a constant expression.\nstatic bool CheckLValueConstantExpression(EvalInfo &Info, SourceLocation Loc, QualType Type, const LValue &LVal, ConstantExprKind Kind, CheckedTemporaries &CheckedTemps) {\n if (Base.is<DynamicAllocLValue>()) {\n Info.FFDiag(Loc, diag::note_constexpr_dynamic_alloc) << IsReferenceType << !Designator.Entries.empty();"}} | ||
}, | }, | ||
["note_constexpr_dynamic_alloc_here"]={ | ["note_constexpr_dynamic_alloc_here"]={ | ||
Line 1,725: | Line 1,725: | ||
[c]=a, | [c]=a, | ||
[m]={M,1569547607,J}, | [m]={M,1569547607,J}, | ||
[n]={{p, | [n]={{p,2130,"static void NoteLValueLocation(EvalInfo &Info, APValue::LValueBase Base) {\n if (VD)\n else if (const Expr *E = Base.dyn_cast<const Expr *>())\n else if (DynamicAllocLValue DA = Base.dyn_cast<DynamicAllocLValue>()) {\n // FIXME: Produce a note for dangling pointers too.\n if (std::optional<DynAlloc *> Alloc = Info.lookupDynamicAlloc(DA))\n Info.Note((*Alloc)->AllocExpr->getExprLoc(), diag::note_constexpr_dynamic_alloc_here);"}} | ||
}, | }, | ||
["note_constexpr_dynamic_cast_to_reference_failed"]={ | ["note_constexpr_dynamic_cast_to_reference_failed"]={ | ||
Line 1,737: | Line 1,737: | ||
[c]=a, | [c]=a, | ||
[m]={"7bd54ab58665",1557951741,"[c++20] For P1327R1: support dynamic_cast in constant expression"}, | [m]={"7bd54ab58665",1557951741,"[c++20] For P1327R1: support dynamic_cast in constant expression"}, | ||
[n]={{p, | [n]={{p,5926,"/// Apply the given dynamic cast operation on the provided lvalue.\n///\n/// This implements the hard case of dynamic_cast, requiring a \"runtime check\"\n/// to find a suitable target subobject.\nstatic bool HandleDynamicCast(EvalInfo &Info, const ExplicitCastExpr *E, LValue &Ptr) {\n auto RuntimeCheckFailed = [&](CXXBasePaths *Paths) {\n Info.FFDiag(E, diag::note_constexpr_dynamic_cast_to_reference_failed) << DiagKind << Ptr.Designator.getType(Info.Ctx) << Info.Ctx.getRecordType(DynType->Type) << E->getType().getUnqualifiedType();"}} | ||
}, | }, | ||
["note_constexpr_dynamic_rounding"]={ | ["note_constexpr_dynamic_rounding"]={ | ||
Line 1,749: | Line 1,749: | ||
[c]=a, | [c]=a, | ||
[m]={"6314f412a83d",1600326607,"[FPEnv] Evaluate constant expressions under non-default rounding modes"}, | [m]={"6314f412a83d",1600326607,"[FPEnv] Evaluate constant expressions under non-default rounding modes"}, | ||
[n]={{p, | [n]={{p,2625,"/// Check if the given evaluation result is allowed for constant evaluation.\nstatic bool checkFloatingPointResult(EvalInfo &Info, const Expr *E, APFloat::opStatus St) {\n if ((St & APFloat::opInexact) && FPO.getRoundingMode() == llvm::RoundingMode::Dynamic) {\n Info.FFDiag(E, diag::note_constexpr_dynamic_rounding);"},{w,480,"bool CheckFloatResult(InterpState &S, CodePtr OpPC, APFloat::opStatus Status) {\n if ((Status & APFloat::opInexact) && FPO.getRoundingMode() == llvm::RoundingMode::Dynamic) {\n S.FFDiag(E, diag::note_constexpr_dynamic_rounding);"}} | ||
}, | }, | ||
["note_constexpr_float_arithmetic"]={ | ["note_constexpr_float_arithmetic"]={ | ||
Line 1,761: | Line 1,761: | ||
[c]=a, | [c]=a, | ||
[m]={"c8042323e1b2",1328075592,"constexpr: overflow checking for integral and floating-point arithmetic."}, | [m]={"c8042323e1b2",1328075592,"constexpr: overflow checking for integral and floating-point arithmetic."}, | ||
[n]={{p, | [n]={{p,2917,"/// Perform the given binary floating-point operation, in-place, on LHS.\nstatic bool handleFloatFloatBinOp(EvalInfo &Info, const BinaryOperator *E, APFloat &LHS, BinaryOperatorKind Opcode, const APFloat &RHS) {\n // [expr.pre]p4:\n // If during the evaluation of an expression, the result is not\n // mathematically defined [...], the behavior is undefined.\n // FIXME: C++ rules require us to not conform to IEEE 754 here.\n if (LHS.isNaN()) {\n Info.CCEDiag(E, diag::note_constexpr_float_arithmetic) << LHS.isNaN();"}} | ||
}, | }, | ||
["note_constexpr_float_arithmetic_strict"]={ | ["note_constexpr_float_arithmetic_strict"]={ | ||
Line 1,773: | Line 1,773: | ||
[c]=a, | [c]=a, | ||
[m]={"2e204e23911b",1601401476,"[clang] Enable support for #pragma STDC FENV_ACCESS"}, | [m]={"2e204e23911b",1601401476,"[clang] Enable support for #pragma STDC FENV_ACCESS"}, | ||
[n]={{p, | [n]={{p,2633,"/// Check if the given evaluation result is allowed for constant evaluation.\nstatic bool checkFloatingPointResult(EvalInfo &Info, const Expr *E, APFloat::opStatus St) {\n if ((St != APFloat::opOK) && (FPO.getRoundingMode() == llvm::RoundingMode::Dynamic || FPO.getExceptionMode() != LangOptions::FPE_Ignore || FPO.getAllowFEnvAccess())) {\n Info.FFDiag(E, diag::note_constexpr_float_arithmetic_strict);"},{p,13037,"template <class SuccessCB, class AfterCB> static bool EvaluateComparisonBinaryOperator(EvalInfo &Info, const BinaryOperator *E, SuccessCB &&Success, AfterCB &&DoAfter) {\n if (LHSTy->isRealFloatingType() && RHSTy->isRealFloatingType()) {\n if (!Info.InConstantContext && APFloatCmpResult == APFloat::cmpUnordered && E->getFPFeaturesInEffect(Info.Ctx.getLangOpts()).isFPConstrained()) {\n Info.FFDiag(E, diag::note_constexpr_float_arithmetic_strict);"},{w,488,"bool CheckFloatResult(InterpState &S, CodePtr OpPC, APFloat::opStatus Status) {\n if ((Status != APFloat::opOK) && (FPO.getRoundingMode() == llvm::RoundingMode::Dynamic || FPO.getExceptionMode() != LangOptions::FPE_Ignore || FPO.getAllowFEnvAccess())) {\n S.FFDiag(E, diag::note_constexpr_float_arithmetic_strict);"}} | ||
}, | }, | ||
["note_constexpr_function_param_value_unknown"]={ | ["note_constexpr_function_param_value_unknown"]={ | ||
Line 1,785: | Line 1,785: | ||
[c]=a, | [c]=a, | ||
[m]={"00068c452a59",1594250761,"Improve diagnostics for constant evaluation that fails because a"}, | [m]={"00068c452a59",1594250761,"Improve diagnostics for constant evaluation that fails because a"}, | ||
[n]={{p, | [n]={{p,3323,"/// Try to evaluate the initializer for a variable declaration.\n///\n/// \\param Info Information about the ongoing evaluation.\n/// \\param E An expression to be used when printing diagnostics.\n/// \\param VD The variable whose initializer should be obtained.\n/// \\param Version The version of the variable within the frame.\n/// \\param Frame The frame in which the variable was created. Must be null\n/// if this variable is not local to the evaluation.\n/// \\param Result Filled in with a pointer to the value of the variable.\nstatic bool evaluateVarDeclInit(EvalInfo &Info, const Expr *E, const VarDecl *VD, CallStackFrame *Frame, unsigned Version, APValue *&Result) {\n if (isa<ParmVarDecl>(VD)) {\n // Assume parameters of a potential constant expression are usable in\n // constant expressions.\n if (!Info.checkingPotentialConstantExpression() || !Info.CurrentCall->Callee || !Info.CurrentCall->Callee->Equals(VD->getDeclContext())) {\n if (Info.getLangOpts().CPlusPlus11) {\n Info.FFDiag(E, diag::note_constexpr_function_param_value_unknown) << VD;"}} | ||
}, | }, | ||
["note_constexpr_heap_alloc_limit_exceeded"]={ | ["note_constexpr_heap_alloc_limit_exceeded"]={ | ||
Line 1,797: | Line 1,797: | ||
[c]=a, | [c]=a, | ||
[m]={M,1569547607,J}, | [m]={M,1569547607,J}, | ||
[n]={{p, | [n]={{p,1905,"APValue *EvalInfo::createHeapAlloc(const Expr *E, QualType T, LValue &LV) {\n if (NumHeapAllocs > DynamicAllocLValue::getMaxIndex()) {\n FFDiag(E, diag::note_constexpr_heap_alloc_limit_exceeded);"}} | ||
}, | }, | ||
["note_constexpr_inherited_ctor_call_here"]={ | ["note_constexpr_inherited_ctor_call_here"]={ | ||
Line 1,809: | Line 1,809: | ||
[c]=a, | [c]=a, | ||
[m]={"5179eb78210a",1467140637,"P0136R1, DR1573, DR1645, DR1715, DR1736, DR1903, DR1941, DR1959, DR1991:"}, | [m]={"5179eb78210a",1467140637,"P0136R1, DR1573, DR1645, DR1715, DR1736, DR1903, DR1941, DR1959, DR1991:"}, | ||
[n]={{"clang/lib/AST/Interp/State.cpp", | [n]={{"clang/lib/AST/Interp/State.cpp",150,"void State::addCallStack(unsigned Limit) {\n for (const Frame *F = Top; F != Bottom; F = F->getCaller(), ++CallIdx) {\n // Use a different note for an inheriting constructor, because from the\n // user\'s perspective it\'s not really a function at all.\n if (const auto *CD = dyn_cast_if_present<CXXConstructorDecl>(F->getCallee()); CD && CD->isInheritingConstructor()) {\n addDiag(CallLocation, diag::note_constexpr_inherited_ctor_call_here) << CD->getParent();"}} | ||
}, | }, | ||
["note_constexpr_invalid_alignment"]={ | ["note_constexpr_invalid_alignment"]={ | ||
Line 1,821: | Line 1,821: | ||
[c]=a, | [c]=a, | ||
[m]={"8c387cbea76b",1578602886,"Add builtins for aligning and checking alignment of pointers and integers"}, | [m]={"8c387cbea76b",1578602886,"Add builtins for aligning and checking alignment of pointers and integers"}, | ||
[n]={{p, | [n]={{p,9143,"/// Evaluate the value of the alignment argument to __builtin_align_{up,down},\n/// __builtin_is_aligned and __builtin_assume_aligned.\nstatic bool getAlignmentArgument(const Expr *E, QualType ForType, EvalInfo &Info, APSInt &Alignment) {\n if (Alignment < 0 || !Alignment.isPowerOf2()) {\n Info.FFDiag(E, diag::note_constexpr_invalid_alignment) << Alignment;"}} | ||
}, | }, | ||
["note_constexpr_invalid_cast"]={ | ["note_constexpr_invalid_cast"]={ | ||
Line 1,833: | Line 1,833: | ||
[c]=a, | [c]=a, | ||
[m]={"6d6ecc34f841",1323693976,"Implement C++11 constant expression cast restrictions."}, | [m]={"6d6ecc34f841",1323693976,"Implement C++11 constant expression cast restrictions."}, | ||
[n]={{p, | [n]={{p,7536,"template <class Derived> class ExprEvaluatorBase : public ConstStmtVisitor<Derived, bool> {\n bool VisitCXXReinterpretCastExpr(const CXXReinterpretCastExpr *E) {\n CCEDiag(E, diag::note_constexpr_invalid_cast) << 0;"},{p,7541,"template <class Derived> class ExprEvaluatorBase : public ConstStmtVisitor<Derived, bool> {\n bool VisitCXXDynamicCastExpr(const CXXDynamicCastExpr *E) {\n if (!Info.Ctx.getLangOpts().CPlusPlus20)\n CCEDiag(E, diag::note_constexpr_invalid_cast) << 1;"},{p,8247,"class LValueExprEvaluator : public LValueExprEvaluatorBase<LValueExprEvaluator> {\n bool VisitCastExpr(const CastExpr *E) {\n case CK_LValueBitCast:\n this->CCEDiag(E, diag::note_constexpr_invalid_cast) << 2 << Info.Ctx.getLangOpts().CPlusPlus;"},{p,8976,"bool PointerExprEvaluator::VisitCastExpr(const CastExpr *E) {\n case CK_AddressSpaceConversion:\n // Bitcasts to cv void* are static_casts, not reinterpret_casts, so are\n // permitted in constant expressions in C++11. Bitcasts from cv void* are\n // also static_casts, but we disallow them as a resolution to DR1312.\n if (!E->getType()->isVoidPointerType()) {\n // 1. We\'ll allow it in std::allocator::allocate, and anything which that\n // calls.\n // 2. HACK 2022-03-28: Work around an issue with libstdc++\'s\n // <source_location> header. Fixed in GCC 12 and later (2022-04-??).\n // We\'ll allow it in the body of std::source_location::current. GCC\'s\n // implementation had a parameter of type `void*`, and casts from\n // that back to `const __impl*` in its body.\n if (VoidPtrCastMaybeOK && (Info.getStdAllocatorCaller(\"allocate\") || IsDeclSourceLocationCurrent(Info.CurrentCall->Callee) || Info.getLangOpts().CPlusPlus26)) {\n } else {\n if (SubExpr->getType()->isVoidPointerType()) {\n if (HasValidResult)\n else\n CCEDiag(E, diag::note_constexpr_invalid_cast) << 3 << SubExpr->getType();"},{p,8979,"bool PointerExprEvaluator::VisitCastExpr(const CastExpr *E) {\n case CK_AddressSpaceConversion:\n // Bitcasts to cv void* are static_casts, not reinterpret_casts, so are\n // permitted in constant expressions in C++11. Bitcasts from cv void* are\n // also static_casts, but we disallow them as a resolution to DR1312.\n if (!E->getType()->isVoidPointerType()) {\n // 1. We\'ll allow it in std::allocator::allocate, and anything which that\n // calls.\n // 2. HACK 2022-03-28: Work around an issue with libstdc++\'s\n // <source_location> header. Fixed in GCC 12 and later (2022-04-??).\n // We\'ll allow it in the body of std::source_location::current. GCC\'s\n // implementation had a parameter of type `void*`, and casts from\n // that back to `const __impl*` in its body.\n if (VoidPtrCastMaybeOK && (Info.getStdAllocatorCaller(\"allocate\") || IsDeclSourceLocationCurrent(Info.CurrentCall->Callee) || Info.getLangOpts().CPlusPlus26)) {\n } else {\n if (SubExpr->getType()->isVoidPointerType()) {\n } else\n CCEDiag(E, diag::note_constexpr_invalid_cast) << 2 << Info.Ctx.getLangOpts().CPlusPlus;"},{p,9018,"bool PointerExprEvaluator::VisitCastExpr(const CastExpr *E) {\n case CK_IntegralToPointer: {\n CCEDiag(E, diag::note_constexpr_invalid_cast) << 2 << Info.Ctx.getLangOpts().CPlusPlus;"},{p,13795,"/// HandleCast - This is used to evaluate implicit or explicit casts where the\n/// result type is integer.\nbool IntExprEvaluator::VisitCastExpr(const CastExpr *E) {\n case CK_PointerToIntegral: {\n CCEDiag(E, diag::note_constexpr_invalid_cast) << 2 << Info.Ctx.getLangOpts().CPlusPlus;"}} | ||
}, | }, | ||
["note_constexpr_invalid_downcast"]={ | ["note_constexpr_invalid_downcast"]={ | ||
Line 1,845: | Line 1,845: | ||
[c]=a, | [c]=a, | ||
[m]={"a8105bc9cecb",1325867940,"C++11 generalized constant expressions: implement checking and diagnostics for"}, | [m]={"a8105bc9cecb",1325867940,"C++11 generalized constant expressions: implement checking and diagnostics for"}, | ||
[n]={{p, | [n]={{p,4800,"/// HandleBaseToDerivedCast - Apply the given base-to-derived cast operation on\n/// the provided lvalue, which currently refers to the base object.\nstatic bool HandleBaseToDerivedCast(EvalInfo &Info, const CastExpr *E, LValue &Result) {\n // Check this cast lands within the final derived-to-base subobject path.\n if (D.MostDerivedPathLength + E->path_size() > D.Entries.size()) {\n Info.CCEDiag(E, diag::note_constexpr_invalid_downcast) << D.MostDerivedType << TargetQT;"},{p,4815,"/// HandleBaseToDerivedCast - Apply the given base-to-derived cast operation on\n/// the provided lvalue, which currently refers to the base object.\nstatic bool HandleBaseToDerivedCast(EvalInfo &Info, const CastExpr *E, LValue &Result) {\n if (FinalType->getCanonicalDecl() != TargetType->getCanonicalDecl()) {\n Info.CCEDiag(E, diag::note_constexpr_invalid_downcast) << D.MostDerivedType << TargetQT;"}} | ||
}, | }, | ||
["note_constexpr_invalid_function"]={ | ["note_constexpr_invalid_function"]={ | ||
Line 1,857: | Line 1,857: | ||
[c]=a, | [c]=a, | ||
[m]={Bb,1323758398,Eb}, | [m]={Bb,1323758398,Eb}, | ||
[n]={{p, | [n]={{p,5557,"/// CheckTrivialDefaultConstructor - Check whether a constructor is a trivial\n/// default constructor. If so, we\'ll fold it whether or not it\'s marked as\n/// constexpr. If it is marked as constexpr, we will never implicitly define it,\n/// so we need special handling.\nstatic bool CheckTrivialDefaultConstructor(EvalInfo &Info, SourceLocation Loc, const CXXConstructorDecl *CD, bool IsValueInitialization) {\n // Value-initialization does not call a trivial default constructor, so such a\n // call is a core constant expression whether or not the constructor is\n // constexpr.\n if (!CD->isConstexpr() && !IsValueInitialization) {\n if (Info.getLangOpts().CPlusPlus11) {\n Info.CCEDiag(Loc, diag::note_constexpr_invalid_function, 1) << /*IsConstexpr*/ 0 << /*IsConstructor*/ 1 << CD;"},{p,5622,"/// CheckConstexprFunction - Check that a function can be called in a constant\n/// expression.\nstatic bool CheckConstexprFunction(EvalInfo &Info, SourceLocation CallLoc, const FunctionDecl *Declaration, const FunctionDecl *Definition, const Stmt *Body) {\n if (Info.getLangOpts().CPlusPlus11) {\n // FIXME: If DiagDecl is an implicitly-declared special member function\n // or an inheriting constructor, we should be much more explicit about why\n // it\'s not constexpr.\n if (CD && CD->isInheritingConstructor())\n else\n Info.FFDiag(CallLoc, diag::note_constexpr_invalid_function, 1) << DiagDecl->isConstexpr() << (bool)CD << DiagDecl;"},{p,9300,"bool PointerExprEvaluator::VisitBuiltinCallExpr(const CallExpr *E, unsigned BuiltinOp) {\n case Builtin::BIwmemchr:\n if (Info.getLangOpts().CPlusPlus11)\n Info.CCEDiag(E, diag::note_constexpr_invalid_function) << /*isConstexpr*/ 0 << /*isConstructor*/ 0 << (\"\'\" + Info.Ctx.BuiltinInfo.getName(BuiltinOp) + \"\'\").str();"},{p,9408,"bool PointerExprEvaluator::VisitBuiltinCallExpr(const CallExpr *E, unsigned BuiltinOp) {\n case Builtin::BIwmemmove:\n if (Info.getLangOpts().CPlusPlus11)\n Info.CCEDiag(E, diag::note_constexpr_invalid_function) << /*isConstexpr*/ 0 << /*isConstructor*/ 0 << (\"\'\" + Info.Ctx.BuiltinInfo.getName(BuiltinOp) + \"\'\").str();"},{p,12285,"bool IntExprEvaluator::VisitBuiltinCallExpr(const CallExpr *E, unsigned BuiltinOp) {\n case Builtin::BIwcslen:\n // A call to strlen is not a constant expression.\n if (Info.getLangOpts().CPlusPlus11)\n Info.CCEDiag(E, diag::note_constexpr_invalid_function) << /*isConstexpr*/ 0 << /*isConstructor*/ 0 << (\"\'\" + Info.Ctx.BuiltinInfo.getName(BuiltinOp) + \"\'\").str();"},{p,12310,"bool IntExprEvaluator::VisitBuiltinCallExpr(const CallExpr *E, unsigned BuiltinOp) {\n case Builtin::BIwmemcmp:\n // A call to strlen is not a constant expression.\n if (Info.getLangOpts().CPlusPlus11)\n Info.CCEDiag(E, diag::note_constexpr_invalid_function) << /*isConstexpr*/ 0 << /*isConstructor*/ 0 << (\"\'\" + Info.Ctx.BuiltinInfo.getName(BuiltinOp) + \"\'\").str();"},{w,333,"bool CheckCallable(InterpState &S, CodePtr OpPC, const Function *F) {\n if (!F->isConstexpr()) {\n if (S.getLangOpts().CPlusPlus11) {\n // FIXME: If DiagDecl is an implicitly-declared special member function\n // or an inheriting constructor, we should be much more explicit about why\n // it\'s not constexpr.\n if (CD && CD->isInheritingConstructor())\n else\n S.FFDiag(Loc, diag::note_constexpr_invalid_function, 1) << DiagDecl->isConstexpr() << (bool)CD << DiagDecl;"}} | ||
}, | }, | ||
["note_constexpr_invalid_inhctor"]={ | ["note_constexpr_invalid_inhctor"]={ | ||
Line 1,869: | Line 1,869: | ||
[c]=a, | [c]=a, | ||
[m]={"5179eb78210a",1467140637,"P0136R1, DR1573, DR1645, DR1715, DR1736, DR1903, DR1941, DR1959, DR1991:"}, | [m]={"5179eb78210a",1467140637,"P0136R1, DR1573, DR1645, DR1715, DR1736, DR1903, DR1941, DR1959, DR1991:"}, | ||
[n]={{p, | [n]={{p,5619,"/// CheckConstexprFunction - Check that a function can be called in a constant\n/// expression.\nstatic bool CheckConstexprFunction(EvalInfo &Info, SourceLocation CallLoc, const FunctionDecl *Declaration, const FunctionDecl *Definition, const Stmt *Body) {\n if (Info.getLangOpts().CPlusPlus11) {\n // FIXME: If DiagDecl is an implicitly-declared special member function\n // or an inheriting constructor, we should be much more explicit about why\n // it\'s not constexpr.\n if (CD && CD->isInheritingConstructor())\n Info.FFDiag(CallLoc, diag::note_constexpr_invalid_inhctor, 1) << CD->getInheritedConstructor().getConstructor()->getParent();"},{w,330,"bool CheckCallable(InterpState &S, CodePtr OpPC, const Function *F) {\n if (!F->isConstexpr()) {\n if (S.getLangOpts().CPlusPlus11) {\n // FIXME: If DiagDecl is an implicitly-declared special member function\n // or an inheriting constructor, we should be much more explicit about why\n // it\'s not constexpr.\n if (CD && CD->isInheritingConstructor())\n S.FFDiag(Loc, diag::note_constexpr_invalid_inhctor, 1) << CD->getInheritedConstructor().getConstructor()->getParent();"}} | ||
}, | }, | ||
["note_constexpr_invalid_template_arg"]={ | ["note_constexpr_invalid_template_arg"]={ | ||
Line 1,881: | Line 1,881: | ||
[c]=a, | [c]=a, | ||
[m]={"7b3515880c22",1603602504,"For P0732R2, P1907R1: ensure that template parameter objects don\'t refer"}, | [m]={"7b3515880c22",1603602504,"For P0732R2, P1907R1: ensure that template parameter objects don\'t refer"}, | ||
[n]={{p, | [n]={{p,2187,"/// Check that this reference or pointer core constant expression is a valid\n/// value for an address or reference constant expression. Return true if we\n/// can fold this expression, whether or not it\'s a constant expression.\nstatic bool CheckLValueConstantExpression(EvalInfo &Info, SourceLocation Loc, QualType Type, const LValue &LVal, ConstantExprKind Kind, CheckedTemporaries &CheckedTemps) {\n // Additional restrictions apply in a template argument. We only enforce the\n // C++20 restrictions here; additional syntactic and semantic restrictions\n // are applied elsewhere.\n if (isTemplateArgument(Kind)) {\n if (InvalidBaseKind != -1) {\n Info.FFDiag(Loc, diag::note_constexpr_invalid_template_arg) << IsReferenceType << !Designator.Entries.empty() << InvalidBaseKind << Ident;"},{P,5989,"/// EvaluateConvertedConstantExpression - Evaluate an Expression\n/// That is a converted constant expression\n/// (which was built with BuildConvertedConstantExpression)\nstatic ExprResult EvaluateConvertedConstantExpression(Sema &S, Expr *E, QualType T, APValue &Value, Sema::CCEKind CCE, bool RequireInt, const APValue &PreNarrowingValue) {\n } else if (!Notes.empty() && Notes[0].second.getDiagID() == diag::note_constexpr_invalid_template_arg) {"}} | ||
}, | }, | ||
["note_constexpr_invalid_void_star_cast"]={ | ["note_constexpr_invalid_void_star_cast"]={ | ||
Line 1,893: | Line 1,893: | ||
[c]=a, | [c]=a, | ||
[m]={lb,1662843785,kb}, | [m]={lb,1662843785,kb}, | ||
[n]={{p, | [n]={{p,8971,"bool PointerExprEvaluator::VisitCastExpr(const CastExpr *E) {\n case CK_AddressSpaceConversion:\n // Bitcasts to cv void* are static_casts, not reinterpret_casts, so are\n // permitted in constant expressions in C++11. Bitcasts from cv void* are\n // also static_casts, but we disallow them as a resolution to DR1312.\n if (!E->getType()->isVoidPointerType()) {\n // 1. We\'ll allow it in std::allocator::allocate, and anything which that\n // calls.\n // 2. HACK 2022-03-28: Work around an issue with libstdc++\'s\n // <source_location> header. Fixed in GCC 12 and later (2022-04-??).\n // We\'ll allow it in the body of std::source_location::current. GCC\'s\n // implementation had a parameter of type `void*`, and casts from\n // that back to `const __impl*` in its body.\n if (VoidPtrCastMaybeOK && (Info.getStdAllocatorCaller(\"allocate\") || IsDeclSourceLocationCurrent(Info.CurrentCall->Callee) || Info.getLangOpts().CPlusPlus26)) {\n } else {\n if (SubExpr->getType()->isVoidPointerType()) {\n if (HasValidResult)\n CCEDiag(E, diag::note_constexpr_invalid_void_star_cast) << SubExpr->getType() << Info.getLangOpts().CPlusPlus26 << Result.Designator.getType(Info.Ctx).getCanonicalType() << E->getType()->getPointeeType();"}} | ||
}, | }, | ||
["note_constexpr_large_shift"]={ | ["note_constexpr_large_shift"]={ | ||
Line 1,905: | Line 1,905: | ||
[c]=a, | [c]=a, | ||
[m]={"fe800031ec14",1327982900,"constexpr: catch a collection of integral undefined behaviors:"}, | [m]={"fe800031ec14",1327982900,"constexpr: catch a collection of integral undefined behaviors:"}, | ||
[n]={{p, | [n]={{p,2834,"/// Perform the given binary integer operation.\nstatic bool handleIntIntBinOp(EvalInfo &Info, const Expr *E, const APSInt &LHS, BinaryOperatorKind Opcode, APSInt RHS, APSInt &Result) {\n shift_left:\n if (SA != RHS) {\n Info.CCEDiag(E, diag::note_constexpr_large_shift) << RHS << E->getType() << LHS.getBitWidth();"},{p,2867,"/// Perform the given binary integer operation.\nstatic bool handleIntIntBinOp(EvalInfo &Info, const Expr *E, const APSInt &LHS, BinaryOperatorKind Opcode, APSInt RHS, APSInt &Result) {\n shift_right:\n if (SA != RHS)\n Info.CCEDiag(E, diag::note_constexpr_large_shift) << RHS << E->getType() << LHS.getBitWidth();"},{p,14046,"bool FixedPointExprEvaluator::VisitBinaryOperator(const BinaryOperator *E) {\n case BO_Shr: {\n // Embedded-C 4.1.6.2.2:\n // The right operand must be nonnegative and less than the total number\n // of (nonpadding) bits of the fixed-point operand ...\n if (RHSVal.isNegative())\n else if (Amt != RHSVal)\n Info.CCEDiag(E, diag::note_constexpr_large_shift) << RHSVal << E->getType() << ShiftBW;"}} | ||
}, | }, | ||
["note_constexpr_lifetime_ended"]={ | ["note_constexpr_lifetime_ended"]={ | ||
Line 1,917: | Line 1,917: | ||
[c]=a, | [c]=a, | ||
[m]={"b228a86fcfd1",1329272293,"Implement DR1454. This allows all intermediate results in constant expressions"}, | [m]={"b228a86fcfd1",1329272293,"Implement DR1454. This allows all intermediate results in constant expressions"}, | ||
[n]={{p, | [n]={{p,4019,"/// Find the complete object to which an LValue refers.\nstatic CompleteObject findCompleteObject(EvalInfo &Info, const Expr *E, AccessKinds AK, const LValue &LVal, QualType LValType) {\n if (LVal.getLValueCallIndex()) {\n if (!Frame) {\n Info.FFDiag(E, diag::note_constexpr_lifetime_ended, 1) << AK << LVal.Base.is<const ValueDecl *>();"},{w,164,"bool CheckLive(InterpState &S, CodePtr OpPC, const Pointer &Ptr, AccessKinds AK) {\n if (!Ptr.isLive()) {\n S.FFDiag(Src, diag::note_constexpr_lifetime_ended, 1) << AK << !IsTemp;"}} | ||
}, | }, | ||
["note_constexpr_literal_comparison"]={ | ["note_constexpr_literal_comparison"]={ | ||
Line 1,929: | Line 1,929: | ||
[c]=a, | [c]=a, | ||
[m]={lb,1662843785,kb}, | [m]={lb,1662843785,kb}, | ||
[n]={{p, | [n]={{p,13096,"template <class SuccessCB, class AfterCB> static bool EvaluateComparisonBinaryOperator(EvalInfo &Info, const BinaryOperator *E, SuccessCB &&Success, AfterCB &&DoAfter) {\n if (LHSTy->isPointerType() && RHSTy->isPointerType()) {\n // Reject differing bases from the normal codepath; we special-case\n // comparisons to null.\n if (!HasSameBase(LHSValue, RHSValue)) {\n // It\'s implementation-defined whether distinct literals will have\n // distinct addresses. In clang, the result of such a comparison is\n // unspecified, so it is not a constant expression. However, we do know\n // that the address of a literal will be non-null.\n if ((IsLiteralLValue(LHSValue) || IsLiteralLValue(RHSValue)) && LHSValue.Base && RHSValue.Base)\n return DiagComparison(diag::note_constexpr_literal_comparison);"}} | ||
}, | }, | ||
["note_constexpr_lshift_discards"]={ | ["note_constexpr_lshift_discards"]={ | ||
Line 1,941: | Line 1,941: | ||
[c]=a, | [c]=a, | ||
[m]={"da7c4ba1af98",1328681693,"Implement the agreed resolution to DR1457: a signed left shift of a 1 bit into"}, | [m]={"da7c4ba1af98",1328681693,"Implement the agreed resolution to DR1457: a signed left shift of a 1 bit into"}, | ||
[n]={{p, | [n]={{p,2844,"/// Perform the given binary integer operation.\nstatic bool handleIntIntBinOp(EvalInfo &Info, const Expr *E, const APSInt &LHS, BinaryOperatorKind Opcode, APSInt RHS, APSInt &Result) {\n shift_left:\n if (SA != RHS) {\n } else if (LHS.isSigned() && !Info.getLangOpts().CPlusPlus20) {\n // C++11 [expr.shift]p2: A signed left shift must have a non-negative\n // operand, and must not overflow the corresponding unsigned type.\n // C++2a [expr.shift]p2: E1 << E2 is the unique value congruent to\n // E1 x 2^E2 module 2^N.\n if (LHS.isNegative())\n else if (LHS.countl_zero() < SA)\n Info.CCEDiag(E, diag::note_constexpr_lshift_discards);"}} | ||
}, | }, | ||
["note_constexpr_lshift_of_negative"]={ | ["note_constexpr_lshift_of_negative"]={ | ||
Line 1,953: | Line 1,953: | ||
[c]=a, | [c]=a, | ||
[m]={"fe800031ec14",1327982900,"constexpr: catch a collection of integral undefined behaviors:"}, | [m]={"fe800031ec14",1327982900,"constexpr: catch a collection of integral undefined behaviors:"}, | ||
[n]={{p, | [n]={{p,2842,"/// Perform the given binary integer operation.\nstatic bool handleIntIntBinOp(EvalInfo &Info, const Expr *E, const APSInt &LHS, BinaryOperatorKind Opcode, APSInt RHS, APSInt &Result) {\n shift_left:\n if (SA != RHS) {\n } else if (LHS.isSigned() && !Info.getLangOpts().CPlusPlus20) {\n // C++11 [expr.shift]p2: A signed left shift must have a non-negative\n // operand, and must not overflow the corresponding unsigned type.\n // C++2a [expr.shift]p2: E1 << E2 is the unique value congruent to\n // E1 x 2^E2 module 2^N.\n if (LHS.isNegative())\n Info.CCEDiag(E, diag::note_constexpr_lshift_of_negative) << LHS;"}} | ||
}, | }, | ||
["note_constexpr_ltor_incomplete_type"]={ | ["note_constexpr_ltor_incomplete_type"]={ | ||
Line 1,965: | Line 1,965: | ||
[c]=a, | [c]=a, | ||
[m]={"147b743602e4",1544633623,"[ExprConstant] Improve memchr/memcmp for type mismatch and multibyte element types"}, | [m]={"147b743602e4",1544633623,"[ExprConstant] Improve memchr/memcmp for type mismatch and multibyte element types"}, | ||
[n]={{p, | [n]={{p,9340,"bool PointerExprEvaluator::VisitBuiltinCallExpr(const CallExpr *E, unsigned BuiltinOp) {\n case Builtin::BI__builtin_wmemchr: {\n // Pointers to const void may point to objects of incomplete type.\n if (IsRawByte && CharTy->isIncompleteType()) {\n Info.FFDiag(E, diag::note_constexpr_ltor_incomplete_type) << CharTy;"}} | ||
}, | }, | ||
["note_constexpr_ltor_non_const_int"]={ | ["note_constexpr_ltor_non_const_int"]={ | ||
Line 1,977: | Line 1,977: | ||
[c]=a, | [c]=a, | ||
[m]={"f2b681b4d819",1324443886,"constexpr: diagnostic improvements for invalid lvalue-to-rvalue conversions in"}, | [m]={"f2b681b4d819",1324443886,"constexpr: diagnostic improvements for invalid lvalue-to-rvalue conversions in"}, | ||
[n]={{p, | [n]={{p,4129,"/// Find the complete object to which an LValue refers.\nstatic CompleteObject findCompleteObject(EvalInfo &Info, const Expr *E, AccessKinds AK, const LValue &LVal, QualType LValType) {\n if (Info.getLangOpts().CPlusPlus14 && LVal.Base == Info.EvaluatingDecl && lifetimeStartedInEvaluation(Info, LVal.Base)) {\n } else if (const ValueDecl *D = LVal.Base.dyn_cast<const ValueDecl *>()) {\n // Unless we\'re looking at a local variable or argument in a constexpr call,\n // the variable we\'re reading must be const.\n if (!Frame) {\n if (IsAccess && isa<ParmVarDecl>(VD)) {\n } else if (Info.getLangOpts().CPlusPlus14 && lifetimeStartedInEvaluation(Info, LVal.Base)) {\n } else if (isModification(AK)) {\n } else if (VD->isConstexpr()) {\n } else if (BaseType->isIntegralOrEnumerationType()) {\n if (!IsConstant) {\n if (Info.getLangOpts().CPlusPlus) {\n Info.FFDiag(E, diag::note_constexpr_ltor_non_const_int, 1) << VD;"}} | ||
}, | }, | ||
["note_constexpr_ltor_non_constexpr"]={ | ["note_constexpr_ltor_non_constexpr"]={ | ||
Line 1,989: | Line 1,989: | ||
[c]=a, | [c]=a, | ||
[m]={"f2b681b4d819",1324443886,"constexpr: diagnostic improvements for invalid lvalue-to-rvalue conversions in"}, | [m]={"f2b681b4d819",1324443886,"constexpr: diagnostic improvements for invalid lvalue-to-rvalue conversions in"}, | ||
[n]={{p, | [n]={{p,3357,"/// Try to evaluate the initializer for a variable declaration.\n///\n/// \\param Info Information about the ongoing evaluation.\n/// \\param E An expression to be used when printing diagnostics.\n/// \\param VD The variable whose initializer should be obtained.\n/// \\param Version The version of the variable within the frame.\n/// \\param Frame The frame in which the variable was created. Must be null\n/// if this variable is not local to the evaluation.\n/// \\param Result Filled in with a pointer to the value of the variable.\nstatic bool evaluateVarDeclInit(EvalInfo &Info, const Expr *E, const VarDecl *VD, CallStackFrame *Frame, unsigned Version, APValue *&Result) {\n if (Init->isValueDependent()) {\n if (!Info.checkingPotentialConstantExpression()) {\n Info.FFDiag(E, Info.getLangOpts().CPlusPlus11 ? diag::note_constexpr_ltor_non_constexpr : diag::note_constexpr_ltor_non_integral, 1) << VD << VD->getType();"},{p,4147,"/// Find the complete object to which an LValue refers.\nstatic CompleteObject findCompleteObject(EvalInfo &Info, const Expr *E, AccessKinds AK, const LValue &LVal, QualType LValType) {\n if (Info.getLangOpts().CPlusPlus14 && LVal.Base == Info.EvaluatingDecl && lifetimeStartedInEvaluation(Info, LVal.Base)) {\n } else if (const ValueDecl *D = LVal.Base.dyn_cast<const ValueDecl *>()) {\n // Unless we\'re looking at a local variable or argument in a constexpr call,\n // the variable we\'re reading must be const.\n if (!Frame) {\n if (IsAccess && isa<ParmVarDecl>(VD)) {\n } else if (Info.getLangOpts().CPlusPlus14 && lifetimeStartedInEvaluation(Info, LVal.Base)) {\n } else if (isModification(AK)) {\n } else if (VD->isConstexpr()) {\n } else if (BaseType->isIntegralOrEnumerationType()) {\n } else if (!IsAccess) {\n } else if (IsConstant && Info.checkingPotentialConstantExpression() && BaseType->isLiteralType(Info.Ctx) && !VD->hasDefinition()) {\n } else if (IsConstant) {\n // Keep evaluating to see what we can do. In particular, we support\n // folding of const floating-point types, in order to make static const\n // data members of such types (supported as an extension) more useful.\n if (Info.getLangOpts().CPlusPlus) {\n Info.CCEDiag(E, Info.getLangOpts().CPlusPlus11 ? diag::note_constexpr_ltor_non_constexpr : diag::note_constexpr_ltor_non_integral, 1) << VD << BaseType;"},{p,4158,"/// Find the complete object to which an LValue refers.\nstatic CompleteObject findCompleteObject(EvalInfo &Info, const Expr *E, AccessKinds AK, const LValue &LVal, QualType LValType) {\n if (Info.getLangOpts().CPlusPlus14 && LVal.Base == Info.EvaluatingDecl && lifetimeStartedInEvaluation(Info, LVal.Base)) {\n } else if (const ValueDecl *D = LVal.Base.dyn_cast<const ValueDecl *>()) {\n // Unless we\'re looking at a local variable or argument in a constexpr call,\n // the variable we\'re reading must be const.\n if (!Frame) {\n if (IsAccess && isa<ParmVarDecl>(VD)) {\n } else if (Info.getLangOpts().CPlusPlus14 && lifetimeStartedInEvaluation(Info, LVal.Base)) {\n } else if (isModification(AK)) {\n } else if (VD->isConstexpr()) {\n } else if (BaseType->isIntegralOrEnumerationType()) {\n } else if (!IsAccess) {\n } else if (IsConstant && Info.checkingPotentialConstantExpression() && BaseType->isLiteralType(Info.Ctx) && !VD->hasDefinition()) {\n } else if (IsConstant) {\n } else {\n // Never allow reading a non-const value.\n if (Info.getLangOpts().CPlusPlus) {\n Info.FFDiag(E, Info.getLangOpts().CPlusPlus11 ? diag::note_constexpr_ltor_non_constexpr : diag::note_constexpr_ltor_non_integral, 1) << VD << BaseType;"},{w,133,"bool CheckExtern(InterpState &S, CodePtr OpPC, const Pointer &Ptr) {\n if (!S.checkingPotentialConstantExpression()) {\n S.FFDiag(Loc, diag::note_constexpr_ltor_non_constexpr, 1) << VD;"}} | ||
}, | }, | ||
["note_constexpr_ltor_non_integral"]={ | ["note_constexpr_ltor_non_integral"]={ | ||
Line 2,001: | Line 2,001: | ||
[c]=a, | [c]=a, | ||
[m]={"00068c452a59",1594250761,"Improve diagnostics for constant evaluation that fails because a"}, | [m]={"00068c452a59",1594250761,"Improve diagnostics for constant evaluation that fails because a"}, | ||
[n]={{p, | [n]={{p,3358,"/// Try to evaluate the initializer for a variable declaration.\n///\n/// \\param Info Information about the ongoing evaluation.\n/// \\param E An expression to be used when printing diagnostics.\n/// \\param VD The variable whose initializer should be obtained.\n/// \\param Version The version of the variable within the frame.\n/// \\param Frame The frame in which the variable was created. Must be null\n/// if this variable is not local to the evaluation.\n/// \\param Result Filled in with a pointer to the value of the variable.\nstatic bool evaluateVarDeclInit(EvalInfo &Info, const Expr *E, const VarDecl *VD, CallStackFrame *Frame, unsigned Version, APValue *&Result) {\n if (Init->isValueDependent()) {\n if (!Info.checkingPotentialConstantExpression()) {\n Info.FFDiag(E, Info.getLangOpts().CPlusPlus11 ? diag::note_constexpr_ltor_non_constexpr : diag::note_constexpr_ltor_non_integral, 1) << VD << VD->getType();"},{p,4148,"/// Find the complete object to which an LValue refers.\nstatic CompleteObject findCompleteObject(EvalInfo &Info, const Expr *E, AccessKinds AK, const LValue &LVal, QualType LValType) {\n if (Info.getLangOpts().CPlusPlus14 && LVal.Base == Info.EvaluatingDecl && lifetimeStartedInEvaluation(Info, LVal.Base)) {\n } else if (const ValueDecl *D = LVal.Base.dyn_cast<const ValueDecl *>()) {\n // Unless we\'re looking at a local variable or argument in a constexpr call,\n // the variable we\'re reading must be const.\n if (!Frame) {\n if (IsAccess && isa<ParmVarDecl>(VD)) {\n } else if (Info.getLangOpts().CPlusPlus14 && lifetimeStartedInEvaluation(Info, LVal.Base)) {\n } else if (isModification(AK)) {\n } else if (VD->isConstexpr()) {\n } else if (BaseType->isIntegralOrEnumerationType()) {\n } else if (!IsAccess) {\n } else if (IsConstant && Info.checkingPotentialConstantExpression() && BaseType->isLiteralType(Info.Ctx) && !VD->hasDefinition()) {\n } else if (IsConstant) {\n // Keep evaluating to see what we can do. In particular, we support\n // folding of const floating-point types, in order to make static const\n // data members of such types (supported as an extension) more useful.\n if (Info.getLangOpts().CPlusPlus) {\n Info.CCEDiag(E, Info.getLangOpts().CPlusPlus11 ? diag::note_constexpr_ltor_non_constexpr : diag::note_constexpr_ltor_non_integral, 1) << VD << BaseType;"},{p,4159,"/// Find the complete object to which an LValue refers.\nstatic CompleteObject findCompleteObject(EvalInfo &Info, const Expr *E, AccessKinds AK, const LValue &LVal, QualType LValType) {\n if (Info.getLangOpts().CPlusPlus14 && LVal.Base == Info.EvaluatingDecl && lifetimeStartedInEvaluation(Info, LVal.Base)) {\n } else if (const ValueDecl *D = LVal.Base.dyn_cast<const ValueDecl *>()) {\n // Unless we\'re looking at a local variable or argument in a constexpr call,\n // the variable we\'re reading must be const.\n if (!Frame) {\n if (IsAccess && isa<ParmVarDecl>(VD)) {\n } else if (Info.getLangOpts().CPlusPlus14 && lifetimeStartedInEvaluation(Info, LVal.Base)) {\n } else if (isModification(AK)) {\n } else if (VD->isConstexpr()) {\n } else if (BaseType->isIntegralOrEnumerationType()) {\n } else if (!IsAccess) {\n } else if (IsConstant && Info.checkingPotentialConstantExpression() && BaseType->isLiteralType(Info.Ctx) && !VD->hasDefinition()) {\n } else if (IsConstant) {\n } else {\n // Never allow reading a non-const value.\n if (Info.getLangOpts().CPlusPlus) {\n Info.FFDiag(E, Info.getLangOpts().CPlusPlus11 ? diag::note_constexpr_ltor_non_constexpr : diag::note_constexpr_ltor_non_integral, 1) << VD << BaseType;"},{p,8367,"bool LValueExprEvaluator::VisitVarDecl(const Expr *E, const VarDecl *VD) {\n if (!Info.getLangOpts().CPlusPlus11) {\n Info.CCEDiag(E, diag::note_constexpr_ltor_non_integral, 1) << VD << VD->getType();"}} | ||
}, | }, | ||
["note_constexpr_mem_pointer_weak_comparison"]={ | ["note_constexpr_mem_pointer_weak_comparison"]={ | ||
Line 2,013: | Line 2,013: | ||
[c]=a, | [c]=a, | ||
[m]={lb,1662843785,kb}, | [m]={lb,1662843785,kb}, | ||
[n]={{p, | [n]={{p,13224,"template <class SuccessCB, class AfterCB> static bool EvaluateComparisonBinaryOperator(EvalInfo &Info, const BinaryOperator *E, SuccessCB &&Success, AfterCB &&DoAfter) {\n if (LHSTy->isMemberPointerType()) {\n // If either operand is a pointer to a weak function, the comparison is not\n // constant.\n if (LHSValue.getDecl() && LHSValue.getDecl()->isWeak()) {\n Info.FFDiag(E, diag::note_constexpr_mem_pointer_weak_comparison) << LHSValue.getDecl();"},{p,13229,"template <class SuccessCB, class AfterCB> static bool EvaluateComparisonBinaryOperator(EvalInfo &Info, const BinaryOperator *E, SuccessCB &&Success, AfterCB &&DoAfter) {\n if (LHSTy->isMemberPointerType()) {\n if (RHSValue.getDecl() && RHSValue.getDecl()->isWeak()) {\n Info.FFDiag(E, diag::note_constexpr_mem_pointer_weak_comparison) << RHSValue.getDecl();"}} | ||
}, | }, | ||
["note_constexpr_memchr_unsupported"]={ | ["note_constexpr_memchr_unsupported"]={ | ||
Line 2,025: | Line 2,025: | ||
[c]=a, | [c]=a, | ||
[m]={fc,1579695612,nc}, | [m]={fc,1579695612,nc}, | ||
[n]={{p, | [n]={{p,9346,"bool PointerExprEvaluator::VisitBuiltinCallExpr(const CallExpr *E, unsigned BuiltinOp) {\n case Builtin::BI__builtin_wmemchr: {\n // Give up on byte-oriented matching against multibyte elements.\n // FIXME: We can compare the bytes in the correct order.\n if (IsRawByte && !isOneByteCharacterType(CharTy)) {\n Info.FFDiag(E, diag::note_constexpr_memchr_unsupported) << (\"\'\" + Info.Ctx.BuiltinInfo.getName(BuiltinOp) + \"\'\").str() << CharTy;"}} | ||
}, | }, | ||
["note_constexpr_memcmp_unsupported"]={ | ["note_constexpr_memcmp_unsupported"]={ | ||
Line 2,037: | Line 2,037: | ||
[c]=a, | [c]=a, | ||
[m]={fc,1579695612,nc}, | [m]={fc,1579695612,nc}, | ||
[n]={{p, | [n]={{p,12366,"bool IntExprEvaluator::VisitBuiltinCallExpr(const CallExpr *E, unsigned BuiltinOp) {\n case Builtin::BI__builtin_wmemcmp: {\n // For memcmp, allow comparing any arrays of \'[[un]signed] char\' or\n // \'char8_t\', but no other types.\n if (IsRawByte && !(isOneByteCharacterType(CharTy1) && isOneByteCharacterType(CharTy2))) {\n Info.FFDiag(E, diag::note_constexpr_memcmp_unsupported) << (\"\'\" + Info.Ctx.BuiltinInfo.getName(BuiltinOp) + \"\'\").str() << CharTy1 << CharTy2;"}} | ||
}, | }, | ||
["note_constexpr_memcpy_incomplete_type"]={ | ["note_constexpr_memcpy_incomplete_type"]={ | ||
Line 2,049: | Line 2,049: | ||
[c]=a, | [c]=a, | ||
[m]={"ed083f2c1f56",1538645144,"[constexpr] Fix ICE when memcpy() is given a pointer to an incomplete array"}, | [m]={"ed083f2c1f56",1538645144,"[constexpr] Fix ICE when memcpy() is given a pointer to an incomplete array"}, | ||
[n]={{p, | [n]={{p,9471,"bool PointerExprEvaluator::VisitBuiltinCallExpr(const CallExpr *E, unsigned BuiltinOp) {\n case Builtin::BI__builtin_wmemmove: {\n if (T->isIncompleteType()) {\n Info.FFDiag(E, diag::note_constexpr_memcpy_incomplete_type) << Move << T;"}} | ||
}, | }, | ||
["note_constexpr_memcpy_nontrivial"]={ | ["note_constexpr_memcpy_nontrivial"]={ | ||
Line 2,061: | Line 2,061: | ||
[c]=a, | [c]=a, | ||
[m]={"96beffba15bc",1533080109,"[constexpr] Support for constant evaluation of __builtin_memcpy and"}, | [m]={"96beffba15bc",1533080109,"[constexpr] Support for constant evaluation of __builtin_memcpy and"}, | ||
[n]={{p, | [n]={{p,9475,"bool PointerExprEvaluator::VisitBuiltinCallExpr(const CallExpr *E, unsigned BuiltinOp) {\n case Builtin::BI__builtin_wmemmove: {\n if (!T.isTriviallyCopyableType(Info.Ctx)) {\n Info.FFDiag(E, diag::note_constexpr_memcpy_nontrivial) << Move << T;"}} | ||
}, | }, | ||
["note_constexpr_memcpy_null"]={ | ["note_constexpr_memcpy_null"]={ | ||
Line 2,073: | Line 2,073: | ||
[c]=a, | [c]=a, | ||
[m]={"128719c4fe7c",1536878853,"Fix crash on call to __builtin_memcpy with a null pointer to an"}, | [m]={"128719c4fe7c",1536878853,"Fix crash on call to __builtin_memcpy with a null pointer to an"}, | ||
[n]={{p, | [n]={{p,9452,"bool PointerExprEvaluator::VisitBuiltinCallExpr(const CallExpr *E, unsigned BuiltinOp) {\n case Builtin::BI__builtin_wmemmove: {\n // Otherwise, if either of the operands is null, we can\'t proceed. Don\'t\n // try to determine the type of the copied objects, because there aren\'t\n // any.\n if (!Src.Base || !Dest.Base) {\n Info.FFDiag(E, diag::note_constexpr_memcpy_null) << Move << WChar << !!Src.Base << Val.getAsString(Info.Ctx, E->getArg(0)->getType());"}} | ||
}, | }, | ||
["note_constexpr_memcpy_overlap"]={ | ["note_constexpr_memcpy_overlap"]={ | ||
Line 2,085: | Line 2,085: | ||
[c]=a, | [c]=a, | ||
[m]={"96beffba15bc",1533080109,"[constexpr] Support for constant evaluation of __builtin_memcpy and"}, | [m]={"96beffba15bc",1533080109,"[constexpr] Support for constant evaluation of __builtin_memcpy and"}, | ||
[n]={{p, | [n]={{p,9515,"bool PointerExprEvaluator::VisitBuiltinCallExpr(const CallExpr *E, unsigned BuiltinOp) {\n case Builtin::BI__builtin_wmemmove: {\n if (HasSameBase(Src, Dest)) {\n if (DestOffset >= SrcOffset && DestOffset - SrcOffset < NBytes) {\n // Dest is inside the source region.\n if (!Move) {\n Info.FFDiag(E, diag::note_constexpr_memcpy_overlap) << WChar;"},{p,9526,"bool PointerExprEvaluator::VisitBuiltinCallExpr(const CallExpr *E, unsigned BuiltinOp) {\n case Builtin::BI__builtin_wmemmove: {\n if (HasSameBase(Src, Dest)) {\n if (DestOffset >= SrcOffset && DestOffset - SrcOffset < NBytes) {\n } else if (!Move && SrcOffset >= DestOffset && SrcOffset - DestOffset < NBytes) {\n Info.FFDiag(E, diag::note_constexpr_memcpy_overlap) << WChar;"}} | ||
}, | }, | ||
["note_constexpr_memcpy_type_pun"]={ | ["note_constexpr_memcpy_type_pun"]={ | ||
Line 2,097: | Line 2,097: | ||
[c]=a, | [c]=a, | ||
[m]={"96beffba15bc",1533080109,"[constexpr] Support for constant evaluation of __builtin_memcpy and"}, | [m]={"96beffba15bc",1533080109,"[constexpr] Support for constant evaluation of __builtin_memcpy and"}, | ||
[n]={{p, | [n]={{p,9467,"bool PointerExprEvaluator::VisitBuiltinCallExpr(const CallExpr *E, unsigned BuiltinOp) {\n case Builtin::BI__builtin_wmemmove: {\n if (!Info.Ctx.hasSameUnqualifiedType(T, SrcT)) {\n Info.FFDiag(E, diag::note_constexpr_memcpy_type_pun) << Move << SrcT << T;"}} | ||
}, | }, | ||
["note_constexpr_memcpy_unsupported"]={ | ["note_constexpr_memcpy_unsupported"]={ | ||
Line 2,109: | Line 2,109: | ||
[c]=a, | [c]=a, | ||
[m]={"96beffba15bc",1533080109,"[constexpr] Support for constant evaluation of __builtin_memcpy and"}, | [m]={"96beffba15bc",1533080109,"[constexpr] Support for constant evaluation of __builtin_memcpy and"}, | ||
[n]={{p, | [n]={{p,9486,"bool PointerExprEvaluator::VisitBuiltinCallExpr(const CallExpr *E, unsigned BuiltinOp) {\n case Builtin::BI__builtin_wmemmove: {\n if (!WChar) {\n if (Remainder) {\n Info.FFDiag(E, diag::note_constexpr_memcpy_unsupported) << Move << WChar << 0 << T << toString(OrigN, 10, /*Signed*/ false) << (unsigned)TSize;"},{p,9499,"bool PointerExprEvaluator::VisitBuiltinCallExpr(const CallExpr *E, unsigned BuiltinOp) {\n case Builtin::BI__builtin_wmemmove: {\n if (N.ugt(RemainingSrcSize) || N.ugt(RemainingDestSize)) {\n Info.FFDiag(E, diag::note_constexpr_memcpy_unsupported) << Move << WChar << (N.ugt(RemainingSrcSize) ? 1 : 2) << T << toString(N, 10, /*Signed*/ false);"}} | ||
}, | }, | ||
["note_constexpr_memory_leak"]={ | ["note_constexpr_memory_leak"]={ | ||
Line 2,121: | Line 2,121: | ||
[c]=a, | [c]=a, | ||
[m]={M,1569547607,J}, | [m]={M,1569547607,J}, | ||
[n]={{p, | [n]={{p,2502,"/// Enforce C++2a [expr.const]/4.17, which disallows new-expressions unless\n/// \"the allocated storage is deallocated within the evaluation\".\nstatic bool CheckMemoryLeaks(EvalInfo &Info) {\n if (!Info.HeapAllocs.empty()) {\n Info.CCEDiag(Info.HeapAllocs.begin()->second.AllocExpr, diag::note_constexpr_memory_leak) << unsigned(Info.HeapAllocs.size() - 1);"}} | ||
}, | }, | ||
["note_constexpr_modify_const_type"]={ | ["note_constexpr_modify_const_type"]={ | ||
Line 2,133: | Line 2,133: | ||
[c]=a, | [c]=a, | ||
[m]={xb,1366986990,sb}, | [m]={xb,1366986990,sb}, | ||
[n]={{p, | [n]={{p,3896,"struct ModifySubobjectHandler {\n bool checkConst(QualType QT) {\n // Assigning to a const object has undefined behavior.\n if (QT.isConstQualified()) {\n Info.FFDiag(E, diag::note_constexpr_modify_const_type) << QT;"},{p,4385,"struct CompoundAssignSubobjectHandler {\n bool checkConst(QualType QT) {\n // Assigning to a const object has undefined behavior.\n if (QT.isConstQualified()) {\n Info.FFDiag(E, diag::note_constexpr_modify_const_type) << QT;"},{p,4527,"struct IncDecSubobjectHandler {\n bool checkConst(QualType QT) {\n // Assigning to a const object has undefined behavior.\n if (QT.isConstQualified()) {\n Info.FFDiag(E, diag::note_constexpr_modify_const_type) << QT;"},{w,219,"bool CheckConst(InterpState &S, CodePtr OpPC, const Pointer &Ptr) {\n S.FFDiag(Loc, diag::note_constexpr_modify_const_type) << Ty;"}} | ||
}, | }, | ||
["note_constexpr_modify_global"]={ | ["note_constexpr_modify_global"]={ | ||
Line 2,145: | Line 2,145: | ||
[c]=a, | [c]=a, | ||
[m]={xb,1366986990,sb}, | [m]={xb,1366986990,sb}, | ||
[n]={{p, | [n]={{p,4055,"/// Find the complete object to which an LValue refers.\nstatic CompleteObject findCompleteObject(EvalInfo &Info, const Expr *E, AccessKinds AK, const LValue &LVal, QualType LValType) {\n if (Info.getLangOpts().CPlusPlus14 && LVal.Base == Info.EvaluatingDecl && lifetimeStartedInEvaluation(Info, LVal.Base)) {\n } else if (const ValueDecl *D = LVal.Base.dyn_cast<const ValueDecl *>()) {\n // Allow reading from a GUID declaration.\n if (auto *GD = dyn_cast<MSGuidDecl>(D)) {\n if (isModification(AK)) {\n Info.FFDiag(E, diag::note_constexpr_modify_global);"},{p,4070,"/// Find the complete object to which an LValue refers.\nstatic CompleteObject findCompleteObject(EvalInfo &Info, const Expr *E, AccessKinds AK, const LValue &LVal, QualType LValType) {\n if (Info.getLangOpts().CPlusPlus14 && LVal.Base == Info.EvaluatingDecl && lifetimeStartedInEvaluation(Info, LVal.Base)) {\n } else if (const ValueDecl *D = LVal.Base.dyn_cast<const ValueDecl *>()) {\n // Allow reading the APValue from an UnnamedGlobalConstantDecl.\n if (auto *GCD = dyn_cast<UnnamedGlobalConstantDecl>(D)) {\n if (isModification(AK)) {\n Info.FFDiag(E, diag::note_constexpr_modify_global);"},{p,4080,"/// Find the complete object to which an LValue refers.\nstatic CompleteObject findCompleteObject(EvalInfo &Info, const Expr *E, AccessKinds AK, const LValue &LVal, QualType LValType) {\n if (Info.getLangOpts().CPlusPlus14 && LVal.Base == Info.EvaluatingDecl && lifetimeStartedInEvaluation(Info, LVal.Base)) {\n } else if (const ValueDecl *D = LVal.Base.dyn_cast<const ValueDecl *>()) {\n // Allow reading from template parameter objects.\n if (auto *TPO = dyn_cast<TemplateParamObjectDecl>(D)) {\n if (isModification(AK)) {\n Info.FFDiag(E, diag::note_constexpr_modify_global);"},{p,4120,"/// Find the complete object to which an LValue refers.\nstatic CompleteObject findCompleteObject(EvalInfo &Info, const Expr *E, AccessKinds AK, const LValue &LVal, QualType LValType) {\n if (Info.getLangOpts().CPlusPlus14 && LVal.Base == Info.EvaluatingDecl && lifetimeStartedInEvaluation(Info, LVal.Base)) {\n } else if (const ValueDecl *D = LVal.Base.dyn_cast<const ValueDecl *>()) {\n // Unless we\'re looking at a local variable or argument in a constexpr call,\n // the variable we\'re reading must be const.\n if (!Frame) {\n if (IsAccess && isa<ParmVarDecl>(VD)) {\n } else if (Info.getLangOpts().CPlusPlus14 && lifetimeStartedInEvaluation(Info, LVal.Base)) {\n } else if (isModification(AK)) {\n Info.FFDiag(E, diag::note_constexpr_modify_global);"},{w,117,"static bool CheckGlobal(InterpState &S, CodePtr OpPC, const Pointer &Ptr) {\n if (auto ID = Ptr.getDeclID()) {\n S.FFDiag(S.Current->getLocation(OpPC), diag::note_constexpr_modify_global);"}} | ||
}, | }, | ||
["note_constexpr_negative_shift"]={ | ["note_constexpr_negative_shift"]={ | ||
Line 2,157: | Line 2,157: | ||
[c]=a, | [c]=a, | ||
[m]={"fe800031ec14",1327982900,"constexpr: catch a collection of integral undefined behaviors:"}, | [m]={"fe800031ec14",1327982900,"constexpr: catch a collection of integral undefined behaviors:"}, | ||
[n]={{p, | [n]={{p,2825,"/// Perform the given binary integer operation.\nstatic bool handleIntIntBinOp(EvalInfo &Info, const Expr *E, const APSInt &LHS, BinaryOperatorKind Opcode, APSInt RHS, APSInt &Result) {\n case BO_Shl: {\n if (Info.getLangOpts().OpenCL)\n else if (RHS.isSigned() && RHS.isNegative()) {\n Info.CCEDiag(E, diag::note_constexpr_negative_shift) << RHS;"},{p,2858,"/// Perform the given binary integer operation.\nstatic bool handleIntIntBinOp(EvalInfo &Info, const Expr *E, const APSInt &LHS, BinaryOperatorKind Opcode, APSInt RHS, APSInt &Result) {\n case BO_Shr: {\n if (Info.getLangOpts().OpenCL)\n else if (RHS.isSigned() && RHS.isNegative()) {\n Info.CCEDiag(E, diag::note_constexpr_negative_shift) << RHS;"},{p,14044,"bool FixedPointExprEvaluator::VisitBinaryOperator(const BinaryOperator *E) {\n case BO_Shr: {\n // Embedded-C 4.1.6.2.2:\n // The right operand must be nonnegative and less than the total number\n // of (nonpadding) bits of the fixed-point operand ...\n if (RHSVal.isNegative())\n Info.CCEDiag(E, diag::note_constexpr_negative_shift) << RHSVal;"}} | ||
}, | }, | ||
["note_constexpr_new"]={ | ["note_constexpr_new"]={ | ||
Line 2,169: | Line 2,169: | ||
[c]=a, | [c]=a, | ||
[m]={M,1569547607,J}, | [m]={M,1569547607,J}, | ||
[n]={{p, | [n]={{p,6716,"/// Perform a call to \'perator new\' or to `__builtin_operator_new\'.\nstatic bool HandleOperatorNewCall(EvalInfo &Info, const CallExpr *E, LValue &Result) {\n if (!Caller) {\n Info.FFDiag(E->getExprLoc(), Info.getLangOpts().CPlusPlus20 ? diag::note_constexpr_new_untyped : diag::note_constexpr_new);"},{p,9563,"bool PointerExprEvaluator::VisitCXXNewExpr(const CXXNewExpr *E) {\n if (!Info.getLangOpts().CPlusPlus20)\n Info.CCEDiag(E, diag::note_constexpr_new);"},{p,15015,"bool VoidExprEvaluator::VisitCXXDeleteExpr(const CXXDeleteExpr *E) {\n // Deleting a null pointer has no effect.\n if (Pointer.isNullPointer()) {\n // This is the only case where we need to produce an extension warning:\n // the only other way we can succeed is if we find a dynamic allocation,\n // and we will have warned when we allocated it in that case.\n if (!Info.getLangOpts().CPlusPlus20)\n Info.CCEDiag(E, diag::note_constexpr_new);"}} | ||
}, | }, | ||
["note_constexpr_new_delete_mismatch"]={ | ["note_constexpr_new_delete_mismatch"]={ | ||
Line 2,181: | Line 2,181: | ||
[c]=a, | [c]=a, | ||
[m]={M,1569547607,J}, | [m]={M,1569547607,J}, | ||
[n]={{p, | [n]={{p,6811,"/// Check that the given object is a suitable pointer to a heap allocation that\n/// still exists and is of the right kind for the purpose of a deletion.\n///\n/// On success, returns the heap allocation to deallocate. On failure, produces\n/// a diagnostic and returns std::nullopt.\nstatic std::optional<DynAlloc *> CheckDeleteKind(EvalInfo &Info, const Expr *E, const LValue &Pointer, DynAlloc::Kind DeallocKind) {\n if (DeallocKind != (*Alloc)->getKind()) {\n Info.FFDiag(E, diag::note_constexpr_new_delete_mismatch) << DeallocKind << (*Alloc)->getKind() << AllocType;"}} | ||
}, | }, | ||
["note_constexpr_new_negative"]={ | ["note_constexpr_new_negative"]={ | ||
Line 2,193: | Line 2,193: | ||
[c]=a, | [c]=a, | ||
[m]={M,1569547607,J}, | [m]={M,1569547607,J}, | ||
[n]={{p, | [n]={{p,9633,"bool PointerExprEvaluator::VisitCXXNewExpr(const CXXNewExpr *E) {\n if (std::optional<const Expr *> ArraySize = E->getArraySize()) {\n // C++ [expr.new]p9:\n // The expression is erroneous if:\n // -- [...] its value before converting to size_t [or] applying the\n // second standard conversion sequence is less than zero\n if (ArrayBound.isSigned() && ArrayBound.isNegative()) {\n Info.FFDiag(*ArraySize, diag::note_constexpr_new_negative) << ArrayBound << (*ArraySize)->getSourceRange();"}} | ||
}, | }, | ||
["note_constexpr_new_non_replaceable"]={ | ["note_constexpr_new_non_replaceable"]={ | ||
Line 2,205: | Line 2,205: | ||
[c]=a, | [c]=a, | ||
[m]={M,1569547607,J}, | [m]={M,1569547607,J}, | ||
[n]={{p, | [n]={{p,9583,"bool PointerExprEvaluator::VisitCXXNewExpr(const CXXNewExpr *E) {\n if (OperatorNew->isReservedGlobalPlacementOperator() && Info.CurrentCall->isStdFunction() && !E->isArray()) {\n } else if (!OperatorNew->isReplaceableGlobalAllocationFunction()) {\n Info.FFDiag(E, diag::note_constexpr_new_non_replaceable) << isa<CXXMethodDecl>(OperatorNew) << OperatorNew;"},{p,14996,"bool VoidExprEvaluator::VisitCXXDeleteExpr(const CXXDeleteExpr *E) {\n if (!OperatorDelete->isReplaceableGlobalAllocationFunction()) {\n Info.FFDiag(E, diag::note_constexpr_new_non_replaceable) << isa<CXXMethodDecl>(OperatorDelete) << OperatorDelete;"},{p,15040,"bool VoidExprEvaluator::VisitCXXDeleteExpr(const CXXDeleteExpr *E) {\n // For a class type with a virtual destructor, the selected operator delete\n // is the one looked up when building the destructor.\n if (!E->isArrayForm() && !E->isGlobalDelete()) {\n if (VirtualDelete && !VirtualDelete->isReplaceableGlobalAllocationFunction()) {\n Info.FFDiag(E, diag::note_constexpr_new_non_replaceable) << isa<CXXMethodDecl>(VirtualDelete) << VirtualDelete;"}} | ||
}, | }, | ||
["note_constexpr_new_not_complete_object_type"]={ | ["note_constexpr_new_not_complete_object_type"]={ | ||
Line 2,217: | Line 2,217: | ||
[c]=a, | [c]=a, | ||
[m]={"19ad5239713c",1570063173,"For P0784R7: allow direct calls to operator new / operator delete from"}, | [m]={"19ad5239713c",1570063173,"For P0784R7: allow direct calls to operator new / operator delete from"}, | ||
[n]={{p, | [n]={{p,6723,"/// Perform a call to \'perator new\' or to `__builtin_operator_new\'.\nstatic bool HandleOperatorNewCall(EvalInfo &Info, const CallExpr *E, LValue &Result) {\n if (ElemType->isIncompleteType() || ElemType->isFunctionType()) {\n Info.FFDiag(E->getExprLoc(), diag::note_constexpr_new_not_complete_object_type) << (ElemType->isIncompleteType() ? 0 : 1) << ElemType;"}} | ||
}, | }, | ||
["note_constexpr_new_placement"]={ | ["note_constexpr_new_placement"]={ | ||
Line 2,229: | Line 2,229: | ||
[c]=a, | [c]=a, | ||
[m]={M,1569547607,J}, | [m]={M,1569547607,J}, | ||
[n]={{p, | [n]={{p,9599,"bool PointerExprEvaluator::VisitCXXNewExpr(const CXXNewExpr *E) {\n if (OperatorNew->isReservedGlobalPlacementOperator() && Info.CurrentCall->isStdFunction() && !E->isArray()) {\n } else if (!OperatorNew->isReplaceableGlobalAllocationFunction()) {\n } else if (E->getNumPlacementArgs()) {\n // The only new-placement list we support is of the form (std::nothrow).\n //\n // FIXME: There is no restriction on this, but it\'s not clear that any\n // other form makes any sense. We get here for cases such as:\n //\n // new (std::align_val_t{N}) X(int)\n //\n // (which should presumably be valid only if N is a multiple of\n // alignof(int), and in any case can\'t be deallocated unless N is\n // alignof(X) and X has new-extended alignment).\n if (E->getNumPlacementArgs() != 1 || !E->getPlacementArg(0)->getType()->isNothrowT())\n return Error(E, diag::note_constexpr_new_placement);"}} | ||
}, | }, | ||
["note_constexpr_new_too_large"]={ | ["note_constexpr_new_too_large"]={ | ||
Line 2,241: | Line 2,241: | ||
[c]=a, | [c]=a, | ||
[m]={M,1569547607,J}, | [m]={M,1569547607,J}, | ||
[n]={{p, | [n]={{p,6756,"/// Perform a call to \'perator new\' or to `__builtin_operator_new\'.\nstatic bool HandleOperatorNewCall(EvalInfo &Info, const CallExpr *E, LValue &Result) {\n if (ByteSize.getActiveBits() > ConstantArrayType::getMaxSizeBits(Info.Ctx)) {\n Info.FFDiag(E, diag::note_constexpr_new_too_large) << APSInt(Size, true);"},{p,9646,"bool PointerExprEvaluator::VisitCXXNewExpr(const CXXNewExpr *E) {\n if (std::optional<const Expr *> ArraySize = E->getArraySize()) {\n // -- its value is such that the size of the allocated object would\n // exceed the implementation-defined limit\n if (ConstantArrayType::getNumAddressingBits(Info.Ctx, AllocType, ArrayBound) > ConstantArrayType::getMaxSizeBits(Info.Ctx)) {\n Info.FFDiag(*ArraySize, diag::note_constexpr_new_too_large) << ArrayBound << (*ArraySize)->getSourceRange();"}} | ||
}, | }, | ||
["note_constexpr_new_too_small"]={ | ["note_constexpr_new_too_small"]={ | ||
Line 2,253: | Line 2,253: | ||
[c]=a, | [c]=a, | ||
[m]={M,1569547607,J}, | [m]={M,1569547607,J}, | ||
[n]={{p, | [n]={{p,9673,"bool PointerExprEvaluator::VisitCXXNewExpr(const CXXNewExpr *E) {\n if (std::optional<const Expr *> ArraySize = E->getArraySize()) {\n // -- the new-initializer is a braced-init-list and the number of\n // array elements for which initializers are provided [...]\n // exceeds the number of elements to initialize\n if (!Init) {\n } else if (isa<CXXScalarValueInitExpr>(Init) || isa<ImplicitValueInitExpr>(Init)) {\n } else if (auto *CCE = dyn_cast<CXXConstructExpr>(Init)) {\n } else {\n if (InitBound.ugt(AllocBound)) {\n Info.FFDiag(*ArraySize, diag::note_constexpr_new_too_small) << toString(AllocBound, 10, /*Signed=*/false) << toString(InitBound, 10, /*Signed=*/false) << (*ArraySize)->getSourceRange();"}} | ||
}, | }, | ||
["note_constexpr_new_untyped"]={ | ["note_constexpr_new_untyped"]={ | ||
Line 2,265: | Line 2,265: | ||
[c]=a, | [c]=a, | ||
[m]={"19ad5239713c",1570063173,"For P0784R7: allow direct calls to operator new / operator delete from"}, | [m]={"19ad5239713c",1570063173,"For P0784R7: allow direct calls to operator new / operator delete from"}, | ||
[n]={{p, | [n]={{p,6715,"/// Perform a call to \'perator new\' or to `__builtin_operator_new\'.\nstatic bool HandleOperatorNewCall(EvalInfo &Info, const CallExpr *E, LValue &Result) {\n if (!Caller) {\n Info.FFDiag(E->getExprLoc(), Info.getLangOpts().CPlusPlus20 ? diag::note_constexpr_new_untyped : diag::note_constexpr_new);"}} | ||
}, | }, | ||
["note_constexpr_no_return"]={ | ["note_constexpr_no_return"]={ | ||
Line 2,277: | Line 2,277: | ||
[c]=a, | [c]=a, | ||
[m]={"d9f663b510c4",1366644711,"C++1y constexpr extensions, round 1: Allow most forms of declaration and"}, | [m]={"d9f663b510c4",1366644711,"C++1y constexpr extensions, round 1: Allow most forms of declaration and"}, | ||
[n]={{p, | [n]={{p,6258,"/// Evaluate a function call.\nstatic bool HandleFunctionCall(SourceLocation CallLoc, const FunctionDecl *Callee, const LValue *This, const Expr *E, ArrayRef<const Expr *> Args, CallRef Call, const Stmt *Body, EvalInfo &Info, APValue &Result, const LValue *ResultSlot) {\n if (ESR == ESR_Succeeded) {\n Info.FFDiag(Callee->getEndLoc(), diag::note_constexpr_no_return);"}} | ||
}, | }, | ||
["note_constexpr_non_global"]={ | ["note_constexpr_non_global"]={ | ||
Line 2,289: | Line 2,289: | ||
[c]=a, | [c]=a, | ||
[m]={Bb,1323758398,Eb}, | [m]={Bb,1323758398,Eb}, | ||
[n]={{p, | [n]={{p,2207,"/// Check that this reference or pointer core constant expression is a valid\n/// value for an address or reference constant expression. Return true if we\n/// can fold this expression, whether or not it\'s a constant expression.\nstatic bool CheckLValueConstantExpression(EvalInfo &Info, SourceLocation Loc, QualType Type, const LValue &LVal, ConstantExprKind Kind, CheckedTemporaries &CheckedTemps) {\n // Check that the object is a global. Note that the fake \'this\' object we\n // manufacture when checking potential constant expressions is conservatively\n // assumed to be global here.\n if (!IsGlobalLValue(Base)) {\n if (Info.getLangOpts().CPlusPlus11) {\n Info.FFDiag(Loc, diag::note_constexpr_non_global, 1) << IsReferenceType << !Designator.Entries.empty() << !!BaseVD << BaseVD;"}} | ||
}, | }, | ||
["note_constexpr_nonliteral"]={ | ["note_constexpr_nonliteral"]={ | ||
Line 2,301: | Line 2,301: | ||
[c]=a, | [c]=a, | ||
[m]={Bb,1323758398,Eb}, | [m]={Bb,1323758398,Eb}, | ||
[n]={{p, | [n]={{p,2369,"/// Check that this core constant expression is of literal type, and if not,\n/// produce an appropriate diagnostic.\nstatic bool CheckLiteralType(EvalInfo &Info, const Expr *E, const LValue *This = nullptr) {\n // Prvalue constant expressions must be of literal types.\n if (Info.getLangOpts().CPlusPlus11)\n Info.FFDiag(E, diag::note_constexpr_nonliteral) << E->getType();"},{p,4671,"/// Build an lvalue for the object argument of a member function call.\nstatic bool EvaluateObjectArgument(EvalInfo &Info, const Expr *Object, LValue &This) {\n Info.FFDiag(Object, diag::note_constexpr_nonliteral) << Object->getType();"},{p,15127,"static bool Evaluate(APValue &Result, EvalInfo &Info, const Expr *E) {\n if (E->isGLValue() || T->isFunctionType()) {\n } else if (T->isVectorType()) {\n } else if (T->isIntegralOrEnumerationType()) {\n } else if (T->hasPointerRepresentation()) {\n } else if (T->isRealFloatingType()) {\n } else if (T->isAnyComplexType()) {\n } else if (T->isFixedPointType()) {\n } else if (T->isMemberPointerType()) {\n } else if (T->isArrayType()) {\n } else if (T->isRecordType()) {\n } else if (T->isVoidType()) {\n if (!Info.getLangOpts().CPlusPlus11)\n Info.CCEDiag(E, diag::note_constexpr_nonliteral) << E->getType();"},{p,15145,"static bool Evaluate(APValue &Result, EvalInfo &Info, const Expr *E) {\n if (E->isGLValue() || T->isFunctionType()) {\n } else if (T->isVectorType()) {\n } else if (T->isIntegralOrEnumerationType()) {\n } else if (T->hasPointerRepresentation()) {\n } else if (T->isRealFloatingType()) {\n } else if (T->isAnyComplexType()) {\n } else if (T->isFixedPointType()) {\n } else if (T->isMemberPointerType()) {\n } else if (T->isArrayType()) {\n } else if (T->isRecordType()) {\n } else if (T->isVoidType()) {\n } else if (T->isAtomicType()) {\n } else if (Info.getLangOpts().CPlusPlus11) {\n Info.FFDiag(E, diag::note_constexpr_nonliteral) << E->getType();"}} | ||
}, | }, | ||
["note_constexpr_not_static"]={ | ["note_constexpr_not_static"]={ | ||
Line 2,313: | Line 2,313: | ||
[c]=a, | [c]=a, | ||
[m]={"0fd3d379e26d",1597104144,"Improve diagnostic for an expression that\'s not constant because it uses"}, | [m]={"0fd3d379e26d",1597104144,"Improve diagnostic for an expression that\'s not constant because it uses"}, | ||
[n]={{p, | [n]={{p,2217,"/// Check that this reference or pointer core constant expression is a valid\n/// value for an address or reference constant expression. Return true if we\n/// can fold this expression, whether or not it\'s a constant expression.\nstatic bool CheckLValueConstantExpression(EvalInfo &Info, SourceLocation Loc, QualType Type, const LValue &LVal, ConstantExprKind Kind, CheckedTemporaries &CheckedTemps) {\n // Check that the object is a global. Note that the fake \'this\' object we\n // manufacture when checking potential constant expressions is conservatively\n // assumed to be global here.\n if (!IsGlobalLValue(Base)) {\n if (Info.getLangOpts().CPlusPlus11) {\n if (VarD && VarD->isConstexpr()) {\n Info.Note(VarD->getLocation(), diag::note_constexpr_not_static) << VarD << FixItHint::CreateInsertion(VarD->getBeginLoc(), \"static \");"}} | ||
}, | }, | ||
["note_constexpr_null_callee"]={ | ["note_constexpr_null_callee"]={ | ||
Line 2,325: | Line 2,325: | ||
[c]=a, | [c]=a, | ||
[m]={lb,1662843785,kb}, | [m]={lb,1662843785,kb}, | ||
[n]={{p, | [n]={{p,7719,"template <class Derived> class ExprEvaluatorBase : public ConstStmtVisitor<Derived, bool> {\n bool handleCallExpr(const CallExpr *E, APValue &Result, const LValue *ResultSlot) {\n // Extract function decl and \'this\' pointer from the callee.\n if (CalleeType->isSpecificBuiltinType(BuiltinType::BoundMember)) {\n } else if (CalleeType->isFunctionPointerType()) {\n if (CalleeLV.isNullPointer()) {\n Info.FFDiag(Callee, diag::note_constexpr_null_callee) << const_cast<Expr *>(Callee);"}} | ||
}, | }, | ||
["note_constexpr_null_subobject"]={ | ["note_constexpr_null_subobject"]={ | ||
Line 2,337: | Line 2,337: | ||
[c]=a, | [c]=a, | ||
[m]={"a8105bc9cecb",1325867940,"C++11 generalized constant expressions: implement checking and diagnostics for"}, | [m]={"a8105bc9cecb",1325867940,"C++11 generalized constant expressions: implement checking and diagnostics for"}, | ||
[n]={{p, | [n]={{p,1647,"#endif\n bool checkNullPointer(EvalInfo &Info, const Expr *E, CheckSubobjectKind CSK) {\n return checkNullPointerDiagnosingWith([&Info, E, CSK] { Info.CCEDiag(E, diag::note_constexpr_null_subobject) << CSK; });"},{w,153,"bool CheckLive(InterpState &S, CodePtr OpPC, const Pointer &Ptr, AccessKinds AK) {\n if (Ptr.isZero()) {\n if (Ptr.isField())\n S.FFDiag(Src, diag::note_constexpr_null_subobject) << CSK_Field;"},{w,182,"bool CheckNull(InterpState &S, CodePtr OpPC, const Pointer &Ptr, CheckSubobjectKind CSK) {\n S.FFDiag(Loc, diag::note_constexpr_null_subobject) << CSK;"}} | ||
}, | }, | ||
["note_constexpr_operator_new_bad_size"]={ | ["note_constexpr_operator_new_bad_size"]={ | ||
Line 2,349: | Line 2,349: | ||
[c]=a, | [c]=a, | ||
[m]={"19ad5239713c",1570063173,"For P0784R7: allow direct calls to operator new / operator delete from"}, | [m]={"19ad5239713c",1570063173,"For P0784R7: allow direct calls to operator new / operator delete from"}, | ||
[n]={{p, | [n]={{p,6745,"/// Perform a call to \'perator new\' or to `__builtin_operator_new\'.\nstatic bool HandleOperatorNewCall(EvalInfo &Info, const CallExpr *E, LValue &Result) {\n if (Remainder != 0) {\n Info.FFDiag(E->getExprLoc(), diag::note_constexpr_operator_new_bad_size) << ByteSize << APSInt(ElemSizeAP, true) << ElemType;"}} | ||
}, | }, | ||
["note_constexpr_overflow"]={ | ["note_constexpr_overflow"]={ | ||
Line 2,361: | Line 2,361: | ||
[c]=a, | [c]=a, | ||
[m]={Bb,1323758398,Eb}, | [m]={Bb,1323758398,Eb}, | ||
[n]={{p, | [n]={{p,2579,"template <typename T> static bool HandleOverflow(EvalInfo &Info, const Expr *E, const T &SrcValue, QualType DestType) {\n Info.CCEDiag(E, diag::note_constexpr_overflow) << SrcValue << DestType;"},{"clang/lib/AST/Interp/InterpState.cpp",45,"bool InterpState::reportOverflow(const Expr *E, const llvm::APSInt &Value) {\n CCEDiag(E, diag::note_constexpr_overflow) << Value << Type;"}} | ||
}, | }, | ||
["note_constexpr_past_end"]={ | ["note_constexpr_past_end"]={ | ||
Line 2,373: | Line 2,373: | ||
[c]=a, | [c]=a, | ||
[m]={Bb,1323758398,Eb}, | [m]={Bb,1323758398,Eb}, | ||
[n]={{p, | [n]={{p,2316,"/// Check that this reference or pointer core constant expression is a valid\n/// value for an address or reference constant expression. Return true if we\n/// can fold this expression, whether or not it\'s a constant expression.\nstatic bool CheckLValueConstantExpression(EvalInfo &Info, SourceLocation Loc, QualType Type, const LValue &LVal, ConstantExprKind Kind, CheckedTemporaries &CheckedTemps) {\n // Does this refer one past the end of some object?\n if (!Designator.Invalid && Designator.isOnePastTheEnd()) {\n Info.FFDiag(Loc, diag::note_constexpr_past_end, 1) << !Designator.Entries.empty() << !!BaseVD << BaseVD;"}} | ||
}, | }, | ||
["note_constexpr_past_end_subobject"]={ | ["note_constexpr_past_end_subobject"]={ | ||
Line 2,385: | Line 2,385: | ||
[c]=a, | [c]=a, | ||
[m]={"a8105bc9cecb",1325867940,"C++11 generalized constant expressions: implement checking and diagnostics for"}, | [m]={"a8105bc9cecb",1325867940,"C++11 generalized constant expressions: implement checking and diagnostics for"}, | ||
[n]={{p, | [n]={{p,1411,"bool SubobjectDesignator::checkSubobject(EvalInfo &Info, const Expr *E, CheckSubobjectKind CSK) {\n if (isOnePastTheEnd()) {\n Info.CCEDiag(E, diag::note_constexpr_past_end_subobject) << CSK;"},{w,200,"bool CheckRange(InterpState &S, CodePtr OpPC, const Pointer &Ptr, CheckSubobjectKind CSK) {\n S.FFDiag(Loc, diag::note_constexpr_past_end_subobject) << CSK;"}} | ||
}, | }, | ||
["note_constexpr_placement_new_wrong_type"]={ | ["note_constexpr_placement_new_wrong_type"]={ | ||
Line 2,397: | Line 2,397: | ||
[c]=a, | [c]=a, | ||
[m]={"b542602c5f35",1570063175,"For P0784R7: support placement new-expressions in constant evaluation."}, | [m]={"b542602c5f35",1570063175,"For P0784R7: support placement new-expressions in constant evaluation."}, | ||
[n]={{p, | [n]={{p,9709,"bool PointerExprEvaluator::VisitCXXNewExpr(const CXXNewExpr *E) {\n if (IsPlacement) {\n struct FindObjectHandler {\n bool found(APValue &Subobj, QualType SubobjType) {\n // FIXME: Reject the cases where [basic.life]p8 would not permit the\n // old name of the object to be used to name the new object.\n if (!Info.Ctx.hasSameUnqualifiedType(SubobjType, AllocType)) {\n Info.FFDiag(E, diag::note_constexpr_placement_new_wrong_type) << SubobjType << AllocType;"}} | ||
}, | }, | ||
["note_constexpr_pointer_comparison_base_classes"]={ | ["note_constexpr_pointer_comparison_base_classes"]={ | ||
Line 2,409: | Line 2,409: | ||
[c]=a, | [c]=a, | ||
[m]={"84f6dcf2b52c",1328145417,"constexpr:"}, | [m]={"84f6dcf2b52c",1328145417,"constexpr:"}, | ||
[n]={{p, | [n]={{p,13160,"template <class SuccessCB, class AfterCB> static bool EvaluateComparisonBinaryOperator(EvalInfo &Info, const BinaryOperator *E, SuccessCB &&Success, AfterCB &&DoAfter) {\n if (LHSTy->isPointerType() && RHSTy->isPointerType()) {\n // C++11 [expr.rel]p2:\n // - If two pointers point to non-static data members of the same object,\n // or to subobjects or array elements fo such members, recursively, the\n // pointer to the later declared member compares greater provided the\n // two members have the same access control and provided their class is\n // not a union.\n // [...]\n // - Otherwise pointer comparisons are unspecified.\n if (!LHSDesignator.Invalid && !RHSDesignator.Invalid && IsRelational) {\n // At the point where the designators diverge, the comparison has a\n // specified value if:\n // - we are comparing array indices\n // - we are comparing fields of a union, or fields with the same access\n // Otherwise, the result is unspecified and thus the comparison is not a\n // constant expression.\n if (!WasArrayIndex && Mismatch < LHSDesignator.Entries.size() && Mismatch < RHSDesignator.Entries.size()) {\n if (!LF && !RF)\n Info.CCEDiag(E, diag::note_constexpr_pointer_comparison_base_classes);"}} | ||
}, | }, | ||
["note_constexpr_pointer_comparison_base_field"]={ | ["note_constexpr_pointer_comparison_base_field"]={ | ||
Line 2,421: | Line 2,421: | ||
[c]=a, | [c]=a, | ||
[m]={"84f6dcf2b52c",1328145417,"constexpr:"}, | [m]={"84f6dcf2b52c",1328145417,"constexpr:"}, | ||
[n]={{p, | [n]={{p,13162,"template <class SuccessCB, class AfterCB> static bool EvaluateComparisonBinaryOperator(EvalInfo &Info, const BinaryOperator *E, SuccessCB &&Success, AfterCB &&DoAfter) {\n if (LHSTy->isPointerType() && RHSTy->isPointerType()) {\n // C++11 [expr.rel]p2:\n // - If two pointers point to non-static data members of the same object,\n // or to subobjects or array elements fo such members, recursively, the\n // pointer to the later declared member compares greater provided the\n // two members have the same access control and provided their class is\n // not a union.\n // [...]\n // - Otherwise pointer comparisons are unspecified.\n if (!LHSDesignator.Invalid && !RHSDesignator.Invalid && IsRelational) {\n // At the point where the designators diverge, the comparison has a\n // specified value if:\n // - we are comparing array indices\n // - we are comparing fields of a union, or fields with the same access\n // Otherwise, the result is unspecified and thus the comparison is not a\n // constant expression.\n if (!WasArrayIndex && Mismatch < LHSDesignator.Entries.size() && Mismatch < RHSDesignator.Entries.size()) {\n if (!LF && !RF)\n else if (!LF)\n Info.CCEDiag(E, diag::note_constexpr_pointer_comparison_base_field) << getAsBaseClass(LHSDesignator.Entries[Mismatch]) << RF->getParent() << RF;"},{p,13166,"template <class SuccessCB, class AfterCB> static bool EvaluateComparisonBinaryOperator(EvalInfo &Info, const BinaryOperator *E, SuccessCB &&Success, AfterCB &&DoAfter) {\n if (LHSTy->isPointerType() && RHSTy->isPointerType()) {\n // C++11 [expr.rel]p2:\n // - If two pointers point to non-static data members of the same object,\n // or to subobjects or array elements fo such members, recursively, the\n // pointer to the later declared member compares greater provided the\n // two members have the same access control and provided their class is\n // not a union.\n // [...]\n // - Otherwise pointer comparisons are unspecified.\n if (!LHSDesignator.Invalid && !RHSDesignator.Invalid && IsRelational) {\n // At the point where the designators diverge, the comparison has a\n // specified value if:\n // - we are comparing array indices\n // - we are comparing fields of a union, or fields with the same access\n // Otherwise, the result is unspecified and thus the comparison is not a\n // constant expression.\n if (!WasArrayIndex && Mismatch < LHSDesignator.Entries.size() && Mismatch < RHSDesignator.Entries.size()) {\n if (!LF && !RF)\n else if (!LF)\n else if (!RF)\n Info.CCEDiag(E, diag::note_constexpr_pointer_comparison_base_field) << getAsBaseClass(RHSDesignator.Entries[Mismatch]) << LF->getParent() << LF;"}} | ||
}, | }, | ||
["note_constexpr_pointer_comparison_differing_access"]={ | ["note_constexpr_pointer_comparison_differing_access"]={ | ||
Line 2,433: | Line 2,433: | ||
[c]=a, | [c]=a, | ||
[m]={"84f6dcf2b52c",1328145417,"constexpr:"}, | [m]={"84f6dcf2b52c",1328145417,"constexpr:"}, | ||
[n]={{p, | [n]={{p,13172,"template <class SuccessCB, class AfterCB> static bool EvaluateComparisonBinaryOperator(EvalInfo &Info, const BinaryOperator *E, SuccessCB &&Success, AfterCB &&DoAfter) {\n if (LHSTy->isPointerType() && RHSTy->isPointerType()) {\n // C++11 [expr.rel]p2:\n // - If two pointers point to non-static data members of the same object,\n // or to subobjects or array elements fo such members, recursively, the\n // pointer to the later declared member compares greater provided the\n // two members have the same access control and provided their class is\n // not a union.\n // [...]\n // - Otherwise pointer comparisons are unspecified.\n if (!LHSDesignator.Invalid && !RHSDesignator.Invalid && IsRelational) {\n // At the point where the designators diverge, the comparison has a\n // specified value if:\n // - we are comparing array indices\n // - we are comparing fields of a union, or fields with the same access\n // Otherwise, the result is unspecified and thus the comparison is not a\n // constant expression.\n if (!WasArrayIndex && Mismatch < LHSDesignator.Entries.size() && Mismatch < RHSDesignator.Entries.size()) {\n if (!LF && !RF)\n else if (!LF)\n else if (!RF)\n else if (!LF->getParent()->isUnion() && LF->getAccess() != RF->getAccess())\n Info.CCEDiag(E, diag::note_constexpr_pointer_comparison_differing_access) << LF << LF->getAccess() << RF << RF->getAccess() << LF->getParent();"}} | ||
}, | }, | ||
["note_constexpr_pointer_comparison_past_end"]={ | ["note_constexpr_pointer_comparison_past_end"]={ | ||
Line 2,445: | Line 2,445: | ||
[c]=a, | [c]=a, | ||
[m]={lb,1662843785,kb}, | [m]={lb,1662843785,kb}, | ||
[n]={{p, | [n]={{p,13106,"template <class SuccessCB, class AfterCB> static bool EvaluateComparisonBinaryOperator(EvalInfo &Info, const BinaryOperator *E, SuccessCB &&Success, AfterCB &&DoAfter) {\n if (LHSTy->isPointerType() && RHSTy->isPointerType()) {\n // Reject differing bases from the normal codepath; we special-case\n // comparisons to null.\n if (!HasSameBase(LHSValue, RHSValue)) {\n // We can\'t compare the address of the start of one object with the\n // past-the-end address of another object, per C++ DR1652.\n if (LHSValue.Base && LHSValue.Offset.isZero() && isOnePastTheEndOfCompleteObject(Info.Ctx, RHSValue))\n return DiagComparison(diag::note_constexpr_pointer_comparison_past_end, true);"},{p,13110,"template <class SuccessCB, class AfterCB> static bool EvaluateComparisonBinaryOperator(EvalInfo &Info, const BinaryOperator *E, SuccessCB &&Success, AfterCB &&DoAfter) {\n if (LHSTy->isPointerType() && RHSTy->isPointerType()) {\n // Reject differing bases from the normal codepath; we special-case\n // comparisons to null.\n if (!HasSameBase(LHSValue, RHSValue)) {\n if (RHSValue.Base && RHSValue.Offset.isZero() && isOnePastTheEndOfCompleteObject(Info.Ctx, LHSValue))\n return DiagComparison(diag::note_constexpr_pointer_comparison_past_end, false);"}} | ||
}, | }, | ||
["note_constexpr_pointer_comparison_unspecified"]={ | ["note_constexpr_pointer_comparison_unspecified"]={ | ||
Line 2,457: | Line 2,457: | ||
[c]=a, | [c]=a, | ||
[m]={"4e9f1379b9cd",1576544926,"If constant evaluation fails due to an unspecified pointer comparison,"}, | [m]={"4e9f1379b9cd",1576544926,"If constant evaluation fails due to an unspecified pointer comparison,"}, | ||
[n]={{p, | [n]={{p,13080,"template <class SuccessCB, class AfterCB> static bool EvaluateComparisonBinaryOperator(EvalInfo &Info, const BinaryOperator *E, SuccessCB &&Success, AfterCB &&DoAfter) {\n if (LHSTy->isPointerType() && RHSTy->isPointerType()) {\n // Reject differing bases from the normal codepath; we special-case\n // comparisons to null.\n if (!HasSameBase(LHSValue, RHSValue)) {\n // Inequalities and subtractions between unrelated pointers have\n // unspecified or undefined behavior.\n if (!IsEquality)\n return DiagComparison(diag::note_constexpr_pointer_comparison_unspecified);"}} | ||
}, | }, | ||
["note_constexpr_pointer_comparison_zero_sized"]={ | ["note_constexpr_pointer_comparison_zero_sized"]={ | ||
Line 2,469: | Line 2,469: | ||
[c]=a, | [c]=a, | ||
[m]={lb,1662843785,kb}, | [m]={lb,1662843785,kb}, | ||
[n]={{p, | [n]={{p,13117,"template <class SuccessCB, class AfterCB> static bool EvaluateComparisonBinaryOperator(EvalInfo &Info, const BinaryOperator *E, SuccessCB &&Success, AfterCB &&DoAfter) {\n if (LHSTy->isPointerType() && RHSTy->isPointerType()) {\n // Reject differing bases from the normal codepath; we special-case\n // comparisons to null.\n if (!HasSameBase(LHSValue, RHSValue)) {\n // We can\'t tell whether an object is at the same address as another\n // zero sized object.\n if ((RHSValue.Base && isZeroSized(LHSValue)) || (LHSValue.Base && isZeroSized(RHSValue)))\n return DiagComparison(diag::note_constexpr_pointer_comparison_zero_sized);"}} | ||
}, | }, | ||
["note_constexpr_pointer_constant_comparison"]={ | ["note_constexpr_pointer_constant_comparison"]={ | ||
Line 2,481: | Line 2,481: | ||
[c]=a, | [c]=a, | ||
[m]={lb,1662843785,kb}, | [m]={lb,1662843785,kb}, | ||
[n]={{p, | [n]={{p,13088,"template <class SuccessCB, class AfterCB> static bool EvaluateComparisonBinaryOperator(EvalInfo &Info, const BinaryOperator *E, SuccessCB &&Success, AfterCB &&DoAfter) {\n if (LHSTy->isPointerType() && RHSTy->isPointerType()) {\n // Reject differing bases from the normal codepath; we special-case\n // comparisons to null.\n if (!HasSameBase(LHSValue, RHSValue)) {\n // A constant address may compare equal to the address of a symbol.\n // The one exception is that address of an object cannot compare equal\n // to a null pointer constant.\n // TODO: Should we restrict this to actual null pointers, and exclude the\n // case of zero cast to pointer type?\n if ((!LHSValue.Base && !LHSValue.Offset.isZero()) || (!RHSValue.Base && !RHSValue.Offset.isZero()))\n return DiagComparison(diag::note_constexpr_pointer_constant_comparison, !RHSValue.Base);"}} | ||
}, | }, | ||
["note_constexpr_pointer_subtraction_not_same_array"]={ | ["note_constexpr_pointer_subtraction_not_same_array"]={ | ||
Line 2,493: | Line 2,493: | ||
[c]=a, | [c]=a, | ||
[m]={"84f6dcf2b52c",1328145417,"constexpr:"}, | [m]={"84f6dcf2b52c",1328145417,"constexpr:"}, | ||
[n]={{p, | [n]={{p,13410,"bool IntExprEvaluator::VisitBinaryOperator(const BinaryOperator *E) {\n if (LHSTy->isPointerType() && RHSTy->isPointerType() && E->getOpcode() == BO_Sub) {\n // C++11 [expr.add]p6:\n // Unless both pointers point to elements of the same array object, or\n // one past the last element of the array object, the behavior is\n // undefined.\n if (!LHSDesignator.Invalid && !RHSDesignator.Invalid && !AreElementsOfSameArray(getType(LHSValue.Base), LHSDesignator, RHSDesignator))\n Info.CCEDiag(E, diag::note_constexpr_pointer_subtraction_not_same_array);"}} | ||
}, | }, | ||
["note_constexpr_pointer_subtraction_zero_size"]={ | ["note_constexpr_pointer_subtraction_zero_size"]={ | ||
Line 2,505: | Line 2,505: | ||
[c]=a, | [c]=a, | ||
[m]={"84c6b3d293d9",1378848854,"PR5683: Issue a warning when subtracting pointers to types of zero size, and"}, | [m]={"84c6b3d293d9",1378848854,"PR5683: Issue a warning when subtracting pointers to types of zero size, and"}, | ||
[n]={{p, | [n]={{p,13423,"bool IntExprEvaluator::VisitBinaryOperator(const BinaryOperator *E) {\n if (LHSTy->isPointerType() && RHSTy->isPointerType() && E->getOpcode() == BO_Sub) {\n // As an extension, a type may have zero size (empty struct or union in\n // C, array of zero length). Pointer subtraction in such cases has\n // undefined behavior, so is not constant.\n if (ElementSize.isZero()) {\n Info.FFDiag(E, diag::note_constexpr_pointer_subtraction_zero_size) << ElementType;"}} | ||
}, | }, | ||
["note_constexpr_pointer_weak_comparison"]={ | ["note_constexpr_pointer_weak_comparison"]={ | ||
Line 2,517: | Line 2,517: | ||
[c]=a, | [c]=a, | ||
[m]={lb,1662843785,kb}, | [m]={lb,1662843785,kb}, | ||
[n]={{p, | [n]={{p,13100,"template <class SuccessCB, class AfterCB> static bool EvaluateComparisonBinaryOperator(EvalInfo &Info, const BinaryOperator *E, SuccessCB &&Success, AfterCB &&DoAfter) {\n if (LHSTy->isPointerType() && RHSTy->isPointerType()) {\n // Reject differing bases from the normal codepath; we special-case\n // comparisons to null.\n if (!HasSameBase(LHSValue, RHSValue)) {\n // We can\'t tell whether weak symbols will end up pointing to the same\n // object.\n if (IsWeakLValue(LHSValue) || IsWeakLValue(RHSValue))\n return DiagComparison(diag::note_constexpr_pointer_weak_comparison, !IsWeakLValue(LHSValue));"}} | ||
}, | }, | ||
["note_constexpr_polymorphic_unknown_dynamic_type"]={ | ["note_constexpr_polymorphic_unknown_dynamic_type"]={ | ||
Line 2,529: | Line 2,529: | ||
[c]=a, | [c]=a, | ||
[m]={"7bd54ab58665",1557951741,"[c++20] For P1327R1: support dynamic_cast in constant expression"}, | [m]={"7bd54ab58665",1557951741,"[c++20] For P1327R1: support dynamic_cast in constant expression"}, | ||
[n]={{p, | [n]={{p,5672,"/// Check that we can access the notional vptr of an object / determine its\n/// dynamic type.\nstatic bool checkDynamicType(EvalInfo &Info, const Expr *E, const LValue &This, AccessKinds AK, bool Polymorphic) {\n if (!Obj.Value) {\n // The object is not usable in constant expressions, so we can\'t inspect\n // its value to see if it\'s in-lifetime or what the active union members\n // are. We can still check for a one-past-the-end lvalue.\n if (This.Designator.isOnePastTheEnd() || This.Designator.isMostDerivedAnUnsizedArray()) {\n } else if (Polymorphic) {\n Info.FFDiag(E, diag::note_constexpr_polymorphic_unknown_dynamic_type) << AK << Val.getAsString(Info.Ctx, StarThisType);"}} | ||
}, | }, | ||
["note_constexpr_pseudo_destructor"]={ | ["note_constexpr_pseudo_destructor"]={ | ||
Line 2,541: | Line 2,541: | ||
[c]=a, | [c]=a, | ||
[m]={"61422f96653f",1569615876,"For P0784R7: add support for explicit destructor calls and"}, | [m]={"61422f96653f",1569615876,"For P0784R7: add support for explicit destructor calls and"}, | ||
[n]={{p, | [n]={{p,7705,"template <class Derived> class ExprEvaluatorBase : public ConstStmtVisitor<Derived, bool> {\n bool handleCallExpr(const CallExpr *E, APValue &Result, const LValue *ResultSlot) {\n // Extract function decl and \'this\' pointer from the callee.\n if (CalleeType->isSpecificBuiltinType(BuiltinType::BoundMember)) {\n if (const MemberExpr *ME = dyn_cast<MemberExpr>(Callee)) {\n } else if (const BinaryOperator *BE = dyn_cast<BinaryOperator>(Callee)) {\n } else if (const auto *PDE = dyn_cast<CXXPseudoDestructorExpr>(Callee)) {\n if (!Info.getLangOpts().CPlusPlus20)\n Info.CCEDiag(PDE, diag::note_constexpr_pseudo_destructor);"}} | ||
}, | }, | ||
["note_constexpr_pure_virtual_call"]={ | ["note_constexpr_pure_virtual_call"]={ | ||
Line 2,553: | Line 2,553: | ||
[c]=a, | [c]=a, | ||
[m]={"5c5be6b2f7fc",1557733330,"[c++20] P1064R0: Allow virtual function calls in constant expression"}, | [m]={"5c5be6b2f7fc",1557733330,"[c++20] P1064R0: Allow virtual function calls in constant expression"}, | ||
[n]={{p, | [n]={{p,5797,"/// Perform virtual dispatch.\nstatic const CXXMethodDecl *HandleVirtualDispatch(EvalInfo &Info, const Expr *E, LValue &This, const CXXMethodDecl *Found, llvm::SmallVectorImpl<QualType> &CovariantAdjustmentPath) {\n // C++2a [class.abstract]p6:\n // the effect of making a virtual call to a pure virtual function [...] is\n // undefined\n if (Callee->isPure()) {\n Info.FFDiag(E, diag::note_constexpr_pure_virtual_call, 1) << Callee;"},{w,378,"bool CheckPure(InterpState &S, CodePtr OpPC, const CXXMethodDecl *MD) {\n S.FFDiag(E, diag::note_constexpr_pure_virtual_call, 1) << MD;"}} | ||
}, | }, | ||
["note_constexpr_static_local"]={ | ["note_constexpr_static_local"]={ | ||
Line 2,565: | Line 2,565: | ||
[c]=a, | [c]=a, | ||
[m]={"683e83c56f98",1633469611,"[Clang][C++2b] P2242R3: Non-literal variables [...] in constexpr"}, | [m]={"683e83c56f98",1633469611,"[Clang][C++2b] P2242R3: Non-literal variables [...] in constexpr"}, | ||
[n]={{p, | [n]={{p,5090,"static bool CheckLocalVariableDeclaration(EvalInfo &Info, const VarDecl *VD) {\n // An expression E is a core constant expression unless the evaluation of E\n // would evaluate one of the following: [C++23] - a control flow that passes\n // through a declaration of a variable with static or thread storage duration\n // unless that variable is usable in constant expressions.\n if (VD->isLocalVarDecl() && VD->isStaticLocal() && !VD->isUsableInConstantExpressions(Info.Ctx)) {\n Info.CCEDiag(VD->getLocation(), diag::note_constexpr_static_local) << (VD->getTSCSpec() == TSCS_unspecified ? 0 : 1) << VD;"}} | ||
}, | }, | ||
["note_constexpr_step_limit_exceeded"]={ | ["note_constexpr_step_limit_exceeded"]={ | ||
Line 2,577: | Line 2,577: | ||
[c]=a, | [c]=a, | ||
[m]={"a3d3bd215bcd",1367979123,"C++1y: Add a step limit to constexpr evaluation, to catch runaway loops."}, | [m]={"a3d3bd215bcd",1367979123,"C++1y: Add a step limit to constexpr evaluation, to catch runaway loops."}, | ||
[n]={{p, | [n]={{p,1041,"/// EvalInfo - This is a private struct used by the evaluator to capture\n/// information about a subexpression as it is folded. It retains information\n/// about the AST context, but also maintains information about the folded\n/// expression.\n///\n/// If an expression could be evaluated, it is still possible it is not a C\n/// \"integer constant expression\" or constant expression. If not, this struct\n/// captures information about how and why not.\n///\n/// One bit of information passed *into* the request for constant folding\n/// indicates whether the subexpression is \"evaluated\" or not according to C\n/// rules. For example, the RHS of (0 && foo()) is not evaluated. We can\n/// evaluate the expression regardless of what the RHS is, but C only allows\n/// certain things in certain situations.\nclass EvalInfo : public interp::State {\n bool nextStep(const Stmt *S) {\n if (!StepsLeft) {\n FFDiag(S->getBeginLoc(), diag::note_constexpr_step_limit_exceeded);"}} | ||
}, | }, | ||
["note_constexpr_stmt_expr_unsupported"]={ | ["note_constexpr_stmt_expr_unsupported"]={ | ||
Line 2,589: | Line 2,589: | ||
[c]=a, | [c]=a, | ||
[m]={"51f0317e527d",1371697205,"PR16377: Allow evaluation of statement expressions in constant evaluation,"}, | [m]={"51f0317e527d",1371697205,"PR16377: Allow evaluation of statement expressions in constant evaluation,"}, | ||
[n]={{p, | [n]={{p,5077,"/// Evaluate a switch statement.\nstatic EvalStmtResult EvaluateSwitch(StmtResult &Result, EvalInfo &Info, const SwitchStmt *SS) {\n case ESR_CaseNotFound:\n Info.FFDiag(Found->getBeginLoc(), diag::note_constexpr_stmt_expr_unsupported);"},{p,8028,"template <class Derived> class ExprEvaluatorBase : public ConstStmtVisitor<Derived, bool> {\n bool VisitStmtExpr(const StmtExpr *E) {\n for (CompoundStmt::const_body_iterator BI = CS->body_begin(), BE = CS->body_end();\n if (BI + 1 == BE) {\n if (!FinalExpr) {\n Info.FFDiag((*BI)->getBeginLoc(), diag::note_constexpr_stmt_expr_unsupported);"},{p,8043,"template <class Derived> class ExprEvaluatorBase : public ConstStmtVisitor<Derived, bool> {\n bool VisitStmtExpr(const StmtExpr *E) {\n for (CompoundStmt::const_body_iterator BI = CS->body_begin(), BE = CS->body_end();\n if (ESR != ESR_Succeeded) {\n // FIXME: If the statement-expression terminated due to \'return\',\n // \'break\', or \'continue\', it would be nice to propagate that to\n // the outer statement evaluation rather than bailing out.\n if (ESR != ESR_Failed)\n Info.FFDiag((*BI)->getBeginLoc(), diag::note_constexpr_stmt_expr_unsupported);"}} | ||
}, | }, | ||
["note_constexpr_subobject_declared_here"]={ | ["note_constexpr_subobject_declared_here"]={ | ||
Line 2,601: | Line 2,601: | ||
[c]=a, | [c]=a, | ||
[m]={"31c69a3d6363",1558480520,"[c++20] P1330R0: permit simple-assignments that change the active member"}, | [m]={"31c69a3d6363",1558480520,"[c++20] P1330R0: permit simple-assignments that change the active member"}, | ||
[n]={{p, | [n]={{p,2387,"static bool CheckEvaluationResult(CheckEvaluationResultKind CERK, EvalInfo &Info, SourceLocation DiagLoc, QualType Type, const APValue &Value, ConstantExprKind Kind, const FieldDecl *SubobjectDecl, CheckedTemporaries &CheckedTemps) {\n if (!Value.hasValue()) {\n if (SubobjectDecl) {\n Info.Note(SubobjectDecl->getLocation(), diag::note_constexpr_subobject_declared_here);"},{w,389,"static void DiagnoseUninitializedSubobject(InterpState &S, const SourceInfo &SI, const FieldDecl *SubObjDecl) {\n S.Note(SubObjDecl->getLocation(), diag::note_constexpr_subobject_declared_here);"}} | ||
}, | }, | ||
["note_constexpr_temporary_here"]={ | ["note_constexpr_temporary_here"]={ | ||
Line 2,613: | Line 2,613: | ||
[c]=a, | [c]=a, | ||
[m]={Bb,1323758398,Eb}, | [m]={Bb,1323758398,Eb}, | ||
[n]={{p, | [n]={{p,2125,"static void NoteLValueLocation(EvalInfo &Info, APValue::LValueBase Base) {\n if (VD)\n else if (const Expr *E = Base.dyn_cast<const Expr *>())\n Info.Note(E->getExprLoc(), diag::note_constexpr_temporary_here);"},{p,4218,"/// Find the complete object to which an LValue refers.\nstatic CompleteObject findCompleteObject(EvalInfo &Info, const Expr *E, AccessKinds AK, const LValue &LVal, QualType LValType) {\n if (Info.getLangOpts().CPlusPlus14 && LVal.Base == Info.EvaluatingDecl && lifetimeStartedInEvaluation(Info, LVal.Base)) {\n } else if (const ValueDecl *D = LVal.Base.dyn_cast<const ValueDecl *>()) {\n } else if (DynamicAllocLValue DA = LVal.Base.dyn_cast<DynamicAllocLValue>()) {\n } else {\n if (!Frame) {\n if (const MaterializeTemporaryExpr *MTE = dyn_cast_or_null<MaterializeTemporaryExpr>(Base)) {\n // C++20 [expr.const]p4: [DR2126]\n // An object or reference is usable in constant expressions if it is\n // - a temporary object of non-volatile const-qualified literal type\n // whose lifetime is extended to that of a variable that is usable\n // in constant expressions\n //\n // C++20 [expr.const]p5:\n // an lvalue-to-rvalue conversion [is not allowed unless it applies to]\n // - a non-volatile glvalue that refers to an object that is usable\n // in constant expressions, or\n // - a non-volatile glvalue of literal type that refers to a\n // non-volatile object whose lifetime began within the evaluation\n // of E;\n //\n // C++11 misses the \'began within the evaluation of e\' check and\n // instead allows all temporaries, including things like:\n // int &&r = 1;\n // int x = ++r;\n // constexpr int k = r;\n // Therefore we use the C++14-onwards rules in C++11 too.\n //\n // Note that temporaries whose lifetimes began while evaluating a\n // variable\'s constructor are not usable while evaluating the\n // corresponding destructor, not even if they\'re of const-qualified\n // types.\n if (!MTE->isUsableInConstantExpressions(Info.Ctx) && !lifetimeStartedInEvaluation(Info, LVal.Base)) {\n Info.Note(MTE->getExprLoc(), diag::note_constexpr_temporary_here);"},{w,103,"static bool CheckTemporary(InterpState &S, CodePtr OpPC, const Pointer &Ptr, AccessKinds AK) {\n if (auto ID = Ptr.getDeclID()) {\n S.Note(Ptr.getDeclLoc(), diag::note_constexpr_temporary_here);"},{w,167,"bool CheckLive(InterpState &S, CodePtr OpPC, const Pointer &Ptr, AccessKinds AK) {\n if (!Ptr.isLive()) {\n if (IsTemp)\n S.Note(Ptr.getDeclLoc(), diag::note_constexpr_temporary_here);"}} | ||
}, | }, | ||
["note_constexpr_this"]={ | ["note_constexpr_this"]={ | ||
Line 2,625: | Line 2,625: | ||
[c]=a, | [c]=a, | ||
[m]={"22a5d61b5d39",1404712813,"Add an explicit diagnostic for the case where an expression is not a constant"}, | [m]={"22a5d61b5d39",1404712813,"Add an explicit diagnostic for the case where an expression is not a constant"}, | ||
[n]={{p, | [n]={{p,8809,"class PointerExprEvaluator : public ExprEvaluatorBase<PointerExprEvaluator> {\n bool VisitCXXThisExpr(const CXXThisExpr *E) {\n if (!Info.CurrentCall->This) {\n if (Info.getLangOpts().CPlusPlus11)\n Info.FFDiag(E, diag::note_constexpr_this) << E->isImplicit();"},{w,367,"bool CheckThis(InterpState &S, CodePtr OpPC, const Pointer &This) {\n if (S.getLangOpts().CPlusPlus11)\n S.FFDiag(Loc, diag::note_constexpr_this) << IsImplicit;"}} | ||
}, | }, | ||
["note_constexpr_typeid_polymorphic"]={ | ["note_constexpr_typeid_polymorphic"]={ | ||
Line 2,637: | Line 2,637: | ||
[c]=a, | [c]=a, | ||
[m]={"6e52514c5deb",1324988308,"constexpr: support for evaluation and codegen of typeid constants."}, | [m]={"6e52514c5deb",1324988308,"constexpr: support for evaluation and codegen of typeid constants."}, | ||
[n]={{p, | [n]={{p,8493,"bool LValueExprEvaluator::VisitCXXTypeidExpr(const CXXTypeidExpr *E) {\n if (!E->isPotentiallyEvaluated()) {\n } else {\n if (!Info.Ctx.getLangOpts().CPlusPlus20) {\n Info.CCEDiag(E, diag::note_constexpr_typeid_polymorphic) << E->getExprOperand()->getType() << E->getExprOperand()->getSourceRange();"}} | ||
}, | }, | ||
["note_constexpr_uninitialized"]={ | ["note_constexpr_uninitialized"]={ | ||
Line 2,649: | Line 2,649: | ||
[c]=a, | [c]=a, | ||
[m]={"1a90f5956d15",1371577911,"PR14503: Don\'t assert if a constexpr constructor temploid instantiates to a"}, | [m]={"1a90f5956d15",1371577911,"PR14503: Don\'t assert if a constexpr constructor temploid instantiates to a"}, | ||
[n]={{p, | [n]={{p,2384,"static bool CheckEvaluationResult(CheckEvaluationResultKind CERK, EvalInfo &Info, SourceLocation DiagLoc, QualType Type, const APValue &Value, ConstantExprKind Kind, const FieldDecl *SubobjectDecl, CheckedTemporaries &CheckedTemps) {\n if (!Value.hasValue()) {\n if (SubobjectDecl) {\n Info.FFDiag(DiagLoc, diag::note_constexpr_uninitialized) << /*(name)*/ 1 << SubobjectDecl;"},{p,2389,"static bool CheckEvaluationResult(CheckEvaluationResultKind CERK, EvalInfo &Info, SourceLocation DiagLoc, QualType Type, const APValue &Value, ConstantExprKind Kind, const FieldDecl *SubobjectDecl, CheckedTemporaries &CheckedTemps) {\n if (!Value.hasValue()) {\n if (SubobjectDecl) {\n } else {\n Info.FFDiag(DiagLoc, diag::note_constexpr_uninitialized) << /*of type*/ 0 << Type;"},{w,386,"static void DiagnoseUninitializedSubobject(InterpState &S, const SourceInfo &SI, const FieldDecl *SubObjDecl) {\n S.FFDiag(SI, diag::note_constexpr_uninitialized) << /*(name)*/ 1 << SubObjDecl;"}} | ||
}, | }, | ||
["note_constexpr_uninitialized_base"]={ | ["note_constexpr_uninitialized_base"]={ | ||
Line 2,661: | Line 2,661: | ||
[c]=a, | [c]=a, | ||
[m]={"8c5c652ed71b",1691496625,"[clang][ExprConstant] Fix crash on uninitialized base class subobject"}, | [m]={"8c5c652ed71b",1691496625,"[clang][ExprConstant] Fix crash on uninitialized base class subobject"}, | ||
[n]={{p, | [n]={{p,2430,"static bool CheckEvaluationResult(CheckEvaluationResultKind CERK, EvalInfo &Info, SourceLocation DiagLoc, QualType Type, const APValue &Value, ConstantExprKind Kind, const FieldDecl *SubobjectDecl, CheckedTemporaries &CheckedTemps) {\n if (Value.isStruct()) {\n if (const CXXRecordDecl *CD = dyn_cast<CXXRecordDecl>(RD)) {\n for (const CXXBaseSpecifier &BS : CD->bases()) {\n if (!BaseValue.hasValue()) {\n Info.FFDiag(TypeBeginLoc, diag::note_constexpr_uninitialized_base) << BS.getType() << SourceRange(TypeBeginLoc, BS.getEndLoc());"}} | ||
}, | }, | ||
["note_constexpr_union_member_change_during_init"]={ | ["note_constexpr_union_member_change_during_init"]={ | ||
Line 2,673: | Line 2,673: | ||
[c]=a, | [c]=a, | ||
[m]={fc,1579695612,nc}, | [m]={fc,1579695612,nc}, | ||
[n]={{p, | [n]={{p,5999,"struct StartLifetimeOfUnionMemberHandler {\n bool found(APValue &Subobj, QualType SubobjType) {\n if (declaresSameEntity(Subobj.getUnionField(), Field)) {\n } else if (DuringInit) {\n Info.FFDiag(LHSExpr, diag::note_constexpr_union_member_change_during_init);"}} | ||
}, | }, | ||
["note_constexpr_unsized_array_indexed"]={ | ["note_constexpr_unsized_array_indexed"]={ | ||
Line 2,685: | Line 2,685: | ||
[c]=a, | [c]=a, | ||
[m]={"2cd56048239f",1503971533,"Improve constant expression evaluation of arrays of unknown bound."}, | [m]={"2cd56048239f",1503971533,"Improve constant expression evaluation of arrays of unknown bound."}, | ||
[n]={{p, | [n]={{p,1424,"void SubobjectDesignator::diagnoseUnsizedArrayPointerArithmetic(EvalInfo &Info, const Expr *E) {\n Info.CCEDiag(E, diag::note_constexpr_unsized_array_indexed);"},{w,143,"bool CheckArray(InterpState &S, CodePtr OpPC, const Pointer &Ptr) {\n S.FFDiag(E, diag::note_constexpr_unsized_array_indexed);"}} | ||
}, | }, | ||
["note_constexpr_unsupported_destruction"]={ | ["note_constexpr_unsupported_destruction"]={ | ||
Line 2,697: | Line 2,697: | ||
[c]=a, | [c]=a, | ||
[m]={"457226e02a6e",1569210524,"For P0784R7: add support for constexpr destructors, and call them as"}, | [m]={"457226e02a6e",1569210524,"For P0784R7: add support for constexpr destructors, and call them as"}, | ||
[n]={{p, | [n]={{p,6540,"static bool HandleDestructionImpl(EvalInfo &Info, SourceLocation CallLoc, const LValue &This, APValue &Value, QualType T) {\n if (!RD) {\n if (T.isDestructedType()) {\n Info.FFDiag(CallLoc, diag::note_constexpr_unsupported_destruction) << T;"}} | ||
}, | }, | ||
["note_constexpr_unsupported_flexible_array"]={ | ["note_constexpr_unsupported_flexible_array"]={ | ||
Line 2,709: | Line 2,709: | ||
[c]=a, | [c]=a, | ||
[m]={qb,1643408541,rb}, | [m]={qb,1643408541,rb}, | ||
[n]={{p, | [n]={{p,10128,"bool RecordExprEvaluator::VisitCXXParenListOrInitListExpr(const Expr *ExprToVisit, ArrayRef<Expr *> Args) {\n // Initialize members.\n for (const auto *Field : RD->fields()) {\n if (Field->getType()->isIncompleteArrayType()) {\n if (auto *CAT = Info.Ctx.getAsConstantArrayType(Init->getType())) {\n if (!CAT->getSize().isZero()) {\n Info.FFDiag(Init, diag::note_constexpr_unsupported_flexible_array);"}} | ||
}, | }, | ||
["note_constexpr_unsupported_layout"]={ | ["note_constexpr_unsupported_layout"]={ | ||
Line 2,721: | Line 2,721: | ||
[c]=a, | [c]=a, | ||
[m]={fc,1579695612,nc}, | [m]={fc,1579695612,nc}, | ||
[n]={{p, | [n]={{p,4060,"/// Find the complete object to which an LValue refers.\nstatic CompleteObject findCompleteObject(EvalInfo &Info, const Expr *E, AccessKinds AK, const LValue &LVal, QualType LValType) {\n if (Info.getLangOpts().CPlusPlus14 && LVal.Base == Info.EvaluatingDecl && lifetimeStartedInEvaluation(Info, LVal.Base)) {\n } else if (const ValueDecl *D = LVal.Base.dyn_cast<const ValueDecl *>()) {\n // Allow reading from a GUID declaration.\n if (auto *GD = dyn_cast<MSGuidDecl>(D)) {\n if (V.isAbsent()) {\n Info.FFDiag(E, diag::note_constexpr_unsupported_layout) << GD->getType();"},{p,10239,"bool RecordExprEvaluator::VisitCXXStdInitializerListExpr(const CXXStdInitializerListExpr *E) {\n auto InvalidType = [&] {\n Info.FFDiag(E, diag::note_constexpr_unsupported_layout) << E->getType();"}} | ||
}, | }, | ||
["note_constexpr_unsupported_temporary_nontrivial_dtor"]={ | ["note_constexpr_unsupported_temporary_nontrivial_dtor"]={ | ||
Line 2,733: | Line 2,733: | ||
[c]=a, | [c]=a, | ||
[m]={"2e204e23911b",1601401476,"[clang] Enable support for #pragma STDC FENV_ACCESS"}, | [m]={"2e204e23911b",1601401476,"[clang] Enable support for #pragma STDC FENV_ACCESS"}, | ||
[n]={{p, | [n]={{p,2288,"/// Check that this reference or pointer core constant expression is a valid\n/// value for an address or reference constant expression. Return true if we\n/// can fold this expression, whether or not it\'s a constant expression.\nstatic bool CheckLValueConstantExpression(EvalInfo &Info, SourceLocation Loc, QualType Type, const LValue &LVal, ConstantExprKind Kind, CheckedTemporaries &CheckedTemps) {\n if (BaseVD) {\n } else if (const auto *MTE = dyn_cast_or_null<MaterializeTemporaryExpr>(BaseE)) {\n if (CheckedTemps.insert(MTE).second) {\n if (TempType.isDestructedType()) {\n Info.FFDiag(MTE->getExprLoc(), diag::note_constexpr_unsupported_temporary_nontrivial_dtor) << TempType;"}} | ||
}, | }, | ||
["note_constexpr_unsupported_unsized_array"]={ | ["note_constexpr_unsupported_unsized_array"]={ | ||
Line 2,745: | Line 2,745: | ||
[c]=a, | [c]=a, | ||
[m]={"2cd56048239f",1503971533,"Improve constant expression evaluation of arrays of unknown bound."}, | [m]={"2cd56048239f",1503971533,"Improve constant expression evaluation of arrays of unknown bound."}, | ||
[n]={{p, | [n]={{p,1672,"#endif\n void addUnsizedArray(EvalInfo &Info, const Expr *E, QualType ElemTy) {\n if (!Designator.Entries.empty()) {\n Info.CCEDiag(E, diag::note_constexpr_unsupported_unsized_array);"}} | ||
}, | }, | ||
["note_constexpr_use_uninit_reference"]={ | ["note_constexpr_use_uninit_reference"]={ | ||
Line 2,757: | Line 2,757: | ||
[c]=a, | [c]=a, | ||
[m]={"08d6a2cc7a58",1374649917,"C++1y: track object lifetime during constexpr evaluation, and don\'t allow"}, | [m]={"08d6a2cc7a58",1374649917,"C++1y: track object lifetime during constexpr evaluation, and don\'t allow"}, | ||
[n]={{p, | [n]={{p,8379,"bool LValueExprEvaluator::VisitVarDecl(const Expr *E, const VarDecl *VD) {\n if (!V->hasValue()) {\n // FIXME: Is it possible for V to be indeterminate here? If so, we should\n // adjust the diagnostic to say that.\n if (!Info.checkingPotentialConstantExpression())\n Info.FFDiag(E, diag::note_constexpr_use_uninit_reference);"}} | ||
}, | }, | ||
["note_constexpr_var_init_non_constant"]={ | ["note_constexpr_var_init_non_constant"]={ | ||
Line 2,769: | Line 2,769: | ||
[c]=a, | [c]=a, | ||
[m]={"d0b4dd656d11",1324275561,"constexpr handling improvements. Produce detailed diagnostics when a \'constexpr\'"}, | [m]={"d0b4dd656d11",1324275561,"constexpr handling improvements. Produce detailed diagnostics when a \'constexpr\'"}, | ||
[n]={{p, | [n]={{p,3368,"/// Try to evaluate the initializer for a variable declaration.\n///\n/// \\param Info Information about the ongoing evaluation.\n/// \\param E An expression to be used when printing diagnostics.\n/// \\param VD The variable whose initializer should be obtained.\n/// \\param Version The version of the variable within the frame.\n/// \\param Frame The frame in which the variable was created. Must be null\n/// if this variable is not local to the evaluation.\n/// \\param Result Filled in with a pointer to the value of the variable.\nstatic bool evaluateVarDeclInit(EvalInfo &Info, const Expr *E, const VarDecl *VD, CallStackFrame *Frame, unsigned Version, APValue *&Result) {\n // Check that we can fold the initializer. In C++, we will have already done\n // this in the cases where it matters for conformance.\n if (!VD->evaluateValue()) {\n Info.FFDiag(E, diag::note_constexpr_var_init_non_constant, 1) << VD;"},{p,3386,"/// Try to evaluate the initializer for a variable declaration.\n///\n/// \\param Info Information about the ongoing evaluation.\n/// \\param E An expression to be used when printing diagnostics.\n/// \\param VD The variable whose initializer should be obtained.\n/// \\param Version The version of the variable within the frame.\n/// \\param Frame The frame in which the variable was created. Must be null\n/// if this variable is not local to the evaluation.\n/// \\param Result Filled in with a pointer to the value of the variable.\nstatic bool evaluateVarDeclInit(EvalInfo &Info, const Expr *E, const VarDecl *VD, CallStackFrame *Frame, unsigned Version, APValue *&Result) {\n // Check that the variable is actually usable in constant expressions. For a\n // const integral variable or a reference, we might have a non-constant\n // initializer that we can nonetheless evaluate the initializer for. Such\n // variables are not usable in constant expressions. In C++98, the\n // initializer also syntactically needs to be an ICE.\n //\n // FIXME: We don\'t diagnose cases that aren\'t potentially usable in constant\n // expressions here; doing so would regress diagnostics for things like\n // reading from a volatile constexpr variable.\n if ((Info.getLangOpts().CPlusPlus && !VD->hasConstantInitialization() && VD->mightBeUsableInConstantExpressions(Info.Ctx)) || ((Info.getLangOpts().CPlusPlus || Info.getLangOpts().OpenCL) && !Info.getLangOpts().CPlusPlus11 && !VD->hasICEInitializer(Info.Ctx))) {\n Info.CCEDiag(E, diag::note_constexpr_var_init_non_constant, 1) << VD;"}} | ||
}, | }, | ||
["note_constexpr_var_init_unknown"]={ | ["note_constexpr_var_init_unknown"]={ | ||
Line 2,781: | Line 2,781: | ||
[c]=a, | [c]=a, | ||
[m]={"00068c452a59",1594250761,"Improve diagnostics for constant evaluation that fails because a"}, | [m]={"00068c452a59",1594250761,"Improve diagnostics for constant evaluation that fails because a"}, | ||
[n]={{p, | [n]={{p,3341,"/// Try to evaluate the initializer for a variable declaration.\n///\n/// \\param Info Information about the ongoing evaluation.\n/// \\param E An expression to be used when printing diagnostics.\n/// \\param VD The variable whose initializer should be obtained.\n/// \\param Version The version of the variable within the frame.\n/// \\param Frame The frame in which the variable was created. Must be null\n/// if this variable is not local to the evaluation.\n/// \\param Result Filled in with a pointer to the value of the variable.\nstatic bool evaluateVarDeclInit(EvalInfo &Info, const Expr *E, const VarDecl *VD, CallStackFrame *Frame, unsigned Version, APValue *&Result) {\n if (!Init) {\n // Don\'t diagnose during potential constant expression checking; an\n // initializer might be added later.\n if (!Info.checkingPotentialConstantExpression()) {\n Info.FFDiag(E, diag::note_constexpr_var_init_unknown, 1) << VD;"}} | ||
}, | }, | ||
["note_constexpr_var_init_weak"]={ | ["note_constexpr_var_init_weak"]={ | ||
Line 2,793: | Line 2,793: | ||
[c]=a, | [c]=a, | ||
[m]={"00068c452a59",1594250761,"Improve diagnostics for constant evaluation that fails because a"}, | [m]={"00068c452a59",1594250761,"Improve diagnostics for constant evaluation that fails because a"}, | ||
[n]={{p, | [n]={{p,3393,"/// Try to evaluate the initializer for a variable declaration.\n///\n/// \\param Info Information about the ongoing evaluation.\n/// \\param E An expression to be used when printing diagnostics.\n/// \\param VD The variable whose initializer should be obtained.\n/// \\param Version The version of the variable within the frame.\n/// \\param Frame The frame in which the variable was created. Must be null\n/// if this variable is not local to the evaluation.\n/// \\param Result Filled in with a pointer to the value of the variable.\nstatic bool evaluateVarDeclInit(EvalInfo &Info, const Expr *E, const VarDecl *VD, CallStackFrame *Frame, unsigned Version, APValue *&Result) {\n // Never use the initializer of a weak variable, not even for constant\n // folding. We can\'t be sure that this is the definition that will be used.\n if (VD->isWeak()) {\n Info.FFDiag(E, diag::note_constexpr_var_init_weak) << VD;"}} | ||
}, | }, | ||
["note_constexpr_virtual_base"]={ | ["note_constexpr_virtual_base"]={ | ||
Line 2,805: | Line 2,805: | ||
[c]=a, | [c]=a, | ||
[m]={"3607ffee5cca",1329105243,"Update constexpr implementation to match CWG\'s chosen approach for core issues"}, | [m]={"3607ffee5cca",1329105243,"Update constexpr implementation to match CWG\'s chosen approach for core issues"}, | ||
[n]={{p, | [n]={{p,6274,"/// Evaluate a constructor call.\nstatic bool HandleConstructorCall(const Expr *E, const LValue &This, CallRef Call, const CXXConstructorDecl *Definition, EvalInfo &Info, APValue &Result) {\n if (RD->getNumVBases()) {\n Info.FFDiag(CallLoc, diag::note_constexpr_virtual_base) << RD;"},{p,6549,"static bool HandleDestructionImpl(EvalInfo &Info, SourceLocation CallLoc, const LValue &This, APValue &Value, QualType T) {\n if (RD->getNumVBases()) {\n Info.FFDiag(CallLoc, diag::note_constexpr_virtual_base) << RD;"},{p,9974,"bool RecordExprEvaluator::ZeroInitialization(const Expr *E, QualType T) {\n if (isa<CXXRecordDecl>(RD) && cast<CXXRecordDecl>(RD)->getNumVBases()) {\n Info.FFDiag(E, diag::note_constexpr_virtual_base) << RD;"}} | ||
}, | }, | ||
["note_constexpr_virtual_base_here"]={ | ["note_constexpr_virtual_base_here"]={ | ||
Line 2,817: | Line 2,817: | ||
[c]=o, | [c]=o, | ||
[m]={fb,1317436288,mb}, | [m]={fb,1317436288,mb}, | ||
[n]={{q, | [n]={{q,1793,"// Check whether a function declaration satisfies the requirements of a\n// constexpr function definition or a constexpr constructor definition. If so,\n// return true. If not, produce appropriate diagnostics (unless asked not to by\n// Kind) and return false.\n//\n// This implements C++11 [dcl.constexpr]p3,4, as amended by DR1360.\nbool Sema::CheckConstexprFunctionDefinition(const FunctionDecl *NewFD, CheckConstexprKind Kind) {\n if (MD && MD->isInstance()) {\n if (RD->getNumVBases()) {\n for (const auto &I : RD->vbases())\n Diag(I.getBeginLoc(), diag::note_constexpr_virtual_base_here) << I.getSourceRange();"},{B,9342,"/// Ensure that the type T is a literal type.\n///\n/// This routine checks whether the type @p T is a literal type. If @p T is an\n/// incomplete type, an attempt is made to complete it. If @p T is a literal\n/// type, or @p AllowIncompleteType is true and @p T is an incomplete type,\n/// returns false. Otherwise, this routine issues the diagnostic @p PD (giving\n/// it the type @p T), along with notes explaining why the type is not a\n/// literal type, and returns true.\n///\n/// @param Loc The location in the source that the non-literal type\n/// diagnostic should refer to.\n///\n/// @param T The type that this routine is examining for literalness.\n///\n/// @param Diagnoser Emits a diagnostic if T is not a literal type.\n///\n/// @returns @c true if @p T is not a literal type and a diagnostic was emitted,\n/// @c false otherwise.\nbool Sema::RequireLiteralType(SourceLocation Loc, QualType T, TypeDiagnoser &Diagnoser) {\n // If the class has virtual base classes, then it\'s not an aggregate, and\n // cannot have any constexpr constructors or a trivial default constructor,\n // so is non-literal. This is better to diagnose than the resulting absence\n // of constexpr constructors.\n if (RD->getNumVBases()) {\n for (const auto &I : RD->vbases())\n Diag(I.getBeginLoc(), diag::note_constexpr_virtual_base_here) << I.getSourceRange();"}} | ||
}, | }, | ||
["note_constexpr_virtual_call"]={ | ["note_constexpr_virtual_call"]={ | ||
Line 2,829: | Line 2,829: | ||
[c]=a, | [c]=a, | ||
[m]={"3607ffee5cca",1329105243,"Update constexpr implementation to match CWG\'s chosen approach for core issues"}, | [m]={"3607ffee5cca",1329105243,"Update constexpr implementation to match CWG\'s chosen approach for core issues"}, | ||
[n]={{p, | [n]={{p,5592,"/// CheckConstexprFunction - Check that a function can be called in a constant\n/// expression.\nstatic bool CheckConstexprFunction(EvalInfo &Info, SourceLocation CallLoc, const FunctionDecl *Declaration, const FunctionDecl *Definition, const Stmt *Body) {\n // DR1872: An instantiated virtual constexpr function can\'t be called in a\n // constant expression (prior to C++20). We can still constant-fold such a\n // call.\n if (!Info.Ctx.getLangOpts().CPlusPlus20 && isa<CXXMethodDecl>(Declaration) && cast<CXXMethodDecl>(Declaration)->isVirtual())\n Info.CCEDiag(CallLoc, diag::note_constexpr_virtual_call);"},{w,303,"bool CheckCallable(InterpState &S, CodePtr OpPC, const Function *F) {\n if (F->isVirtual() && !S.getLangOpts().CPlusPlus20) {\n S.CCEDiag(Loc, diag::note_constexpr_virtual_call);"}} | ||
}, | }, | ||
["note_constexpr_void_comparison"]={ | ["note_constexpr_void_comparison"]={ | ||
Line 2,841: | Line 2,841: | ||
[c]=a, | [c]=a, | ||
[m]={"de21b245c664",1327992090,"constexpr: the result of a relational operator between pointers to void is"}, | [m]={"de21b245c664",1327992090,"constexpr: the result of a relational operator between pointers to void is"}, | ||
[n]={{p, | [n]={{p,13135,"template <class SuccessCB, class AfterCB> static bool EvaluateComparisonBinaryOperator(EvalInfo &Info, const BinaryOperator *E, SuccessCB &&Success, AfterCB &&DoAfter) {\n if (LHSTy->isPointerType() && RHSTy->isPointerType()) {\n // C++11 [expr.rel]p3:\n // Pointers to void (after pointer conversions) can be compared, with a\n // result defined as follows: If both pointers represent the same\n // address or are both the null pointer value, the result is true if the\n // operator is <= or >= and false otherwise; otherwise the result is\n // unspecified.\n // We interpret this as applying to pointers to *cv* void.\n if (LHSTy->isVoidPointerType() && LHSOffset != RHSOffset && IsRelational)\n Info.CCEDiag(E, diag::note_constexpr_void_comparison);"}} | ||
}, | }, | ||
["note_constexpr_volatile_here"]={ | ["note_constexpr_volatile_here"]={ | ||
Line 2,853: | Line 2,853: | ||
[c]=a, | [c]=a, | ||
[m]={"c0fe5eb39c85",1557518732,"Fix handling of objects under construction during constant expression"}, | [m]={"c0fe5eb39c85",1557518732,"Fix handling of objects under construction during constant expression"}, | ||
[n]={{p, | [n]={{p,3721,"/// Find the designated sub-object of an rvalue.\ntemplate <typename SubobjectHandler> typename SubobjectHandler::result_type findSubobject(EvalInfo &Info, const Expr *E, const CompleteObject &Obj, const SubobjectDesignator &Sub, SubobjectHandler &handler) {\n // Walk the designator\'s path to find the subobject.\n for (unsigned I = 0, N = Sub.Entries.size(); /**/; ++I) {\n // If this is our last pass, check that the final object type is OK.\n if (I == N || (I == N - 1 && ObjType->isAnyComplexType())) {\n // Accesses to volatile objects are prohibited.\n if (ObjType.isVolatileQualified() && isFormalAccess(handler.AccessKind)) {\n if (Info.getLangOpts().CPlusPlus) {\n Info.Note(Loc, diag::note_constexpr_volatile_here) << DiagKind;"}} | ||
}, | }, | ||
["note_constinit_missing_here"]={ | ["note_constinit_missing_here"]={ | ||
Line 2,865: | Line 2,865: | ||
[c]=o, | [c]=o, | ||
[m]={Ab,1567434909,Cb}, | [m]={Ab,1567434909,Cb}, | ||
[n]={{t, | [n]={{t,3175,"static void diagnoseMissingConstinit(Sema &S, const VarDecl *InitDecl, const ConstInitAttr *CIAttr, bool AttrBeforeInit) {\n if (AttrBeforeInit) {\n } else {\n S.Diag(InitDecl->getLocation(), diag::note_constinit_missing_here) << CIAttr->isConstinit() << FixItHint::CreateInsertion(InsertLoc, SuitableSpelling);"}} | ||
}, | }, | ||
["note_constinit_specified_here"]={ | ["note_constinit_specified_here"]={ | ||
Line 2,877: | Line 2,877: | ||
[c]=o, | [c]=o, | ||
[m]={Ab,1567434909,Cb}, | [m]={Ab,1567434909,Cb}, | ||
[n]={{t, | [n]={{t,3167,"static void diagnoseMissingConstinit(Sema &S, const VarDecl *InitDecl, const ConstInitAttr *CIAttr, bool AttrBeforeInit) {\n if (AttrBeforeInit) {\n S.Diag(CIAttr->getLocation(), diag::note_constinit_specified_here);"}} | ||
}, | }, | ||
["note_constraint_normalization_here"]={ | ["note_constraint_normalization_here"]={ | ||
Line 2,889: | Line 2,889: | ||
[c]=o, | [c]=o, | ||
[m]={"349636d2bfc3",1575555459,"Implement VectorType conditional operator GNU extension."}, | [m]={"349636d2bfc3",1575555459,"Implement VectorType conditional operator GNU extension."}, | ||
[n]={{z, | [n]={{z,1059,"/// Prints the current instantiation stack through a series of\n/// notes.\nvoid Sema::PrintInstantiationStack() {\n for (SmallVectorImpl<CodeSynthesisContext>::reverse_iterator Active = CodeSynthesisContexts.rbegin(), ActiveEnd = CodeSynthesisContexts.rend(); Active != ActiveEnd; ++Active, ++InstantiationIdx) {\n case CodeSynthesisContext::ConstraintNormalization:\n Diags.Report(Active->PointOfInstantiation, diag::note_constraint_normalization_here) << cast<NamedDecl>(Active->Entity)->getName() << Active->InstantiationRange;"}} | ||
}, | }, | ||
["note_constraint_references_error"]={ | ["note_constraint_references_error"]={ | ||
Line 2,901: | Line 2,901: | ||
[c]=o, | [c]=o, | ||
[m]={db,1625925174,eb}, | [m]={db,1625925174,eb}, | ||
[n]={{O, | [n]={{O,250,"template <typename AtomicEvaluator> static ExprResult calculateConstraintSatisfaction(Sema &S, const Expr *ConstraintExpr, ConstraintSatisfaction &Satisfaction, AtomicEvaluator &&Evaluator) {\n // We don\'t have the ability to evaluate this, since it contains a\n // RecoveryExpr, so we want to fail overload resolution. Otherwise,\n // we\'d potentially pick up a different overload, and cause confusing\n // diagnostics. SO, add a failure detail that will cause us to make this\n // overload set not viable.\n if (SubstitutedAtomicExpr.get()->containsErrors()) {\n PartialDiagnostic Msg = S.PDiag(diag::note_constraint_references_error);"}} | ||
}, | }, | ||
["note_constraint_substitution_here"]={ | ["note_constraint_substitution_here"]={ | ||
Line 2,913: | Line 2,913: | ||
[c]=o, | [c]=o, | ||
[m]={Ab,1567434909,Cb}, | [m]={Ab,1567434909,Cb}, | ||
[n]={{z, | [n]={{z,1054,"/// Prints the current instantiation stack through a series of\n/// notes.\nvoid Sema::PrintInstantiationStack() {\n for (SmallVectorImpl<CodeSynthesisContext>::reverse_iterator Active = CodeSynthesisContexts.rbegin(), ActiveEnd = CodeSynthesisContexts.rend(); Active != ActiveEnd; ++Active, ++InstantiationIdx) {\n case CodeSynthesisContext::ConstraintSubstitution:\n Diags.Report(Active->PointOfInstantiation, diag::note_constraint_substitution_here) << Active->InstantiationRange;"}} | ||
}, | }, | ||
["note_conv_function_declared_at"]={ | ["note_conv_function_declared_at"]={ | ||
Line 2,925: | Line 2,925: | ||
[c]=o, | [c]=o, | ||
[m]={"01d96986d843",1480719628,"More diagnostic name fixups: w_ -> warn_, warning_ -> warn_, not_ -> note_."}, | [m]={"01d96986d843",1480719628,"More diagnostic name fixups: w_ -> warn_, warning_ -> warn_, not_ -> note_."}, | ||
[n]={{"clang/lib/Sema/SemaPseudoObject.cpp", | [n]={{"clang/lib/Sema/SemaPseudoObject.cpp",1117,"/// CheckSubscriptingKind - This routine decide what type\n/// of indexing represented by \"FromE\" is being done.\nSema::ObjCSubscriptKind Sema::CheckSubscriptingKind(Expr *FromE) {\n for (unsigned int i = 0; i < ConversionDecls.size(); i++)\n Diag(ConversionDecls[i]->getLocation(), diag::note_conv_function_declared_at);"}} | ||
}, | }, | ||
["note_convert_inline_to_static"]={ | ["note_convert_inline_to_static"]={ | ||
Line 2,937: | Line 2,937: | ||
[c]=o, | [c]=o, | ||
[m]={"2684c68ddc2f",1339784388,"Warn when a static variable is referenced in a non-static inline function."}, | [m]={"2684c68ddc2f",1339784388,"Warn when a static variable is referenced in a non-static inline function."}, | ||
[n]={{r, | [n]={{r,207,"void Sema::MaybeSuggestAddingStaticToDecl(const FunctionDecl *Cur) {\n // Suggest \"static\" on the function, if possible.\n if (!hasAnyExplicitStorageClass(First)) {\n Diag(DeclBegin, diag::note_convert_inline_to_static) << Cur << FixItHint::CreateInsertion(DeclBegin, \"static \");"}} | ||
}, | }, | ||
["note_coroutine_function_declare_noexcept"]={ | ["note_coroutine_function_declare_noexcept"]={ | ||
Line 2,949: | Line 2,949: | ||
[c]=Zb, | [c]=Zb, | ||
[m]={Y,1582847864,W}, | [m]={Y,1582847864,W}, | ||
[n]={{L, | [n]={{L,684,"bool Sema::checkFinalSuspendNoThrow(const Stmt *FinalSuspend) {\n for (const auto *D : SortedDecls) {\n Diag(D->getEndLoc(), diag::note_coroutine_function_declare_noexcept);"}} | ||
}, | }, | ||
["note_coroutine_promise_call_implicitly_required"]={ | ["note_coroutine_promise_call_implicitly_required"]={ | ||
Line 2,961: | Line 2,961: | ||
[c]=Zb, | [c]=Zb, | ||
[m]={"20f25cb6dfb3",1488843495,"[coroutines] Add DependentCoawaitExpr and fix re-building CoroutineBodyStmt."}, | [m]={"20f25cb6dfb3",1488843495,"[coroutines] Add DependentCoawaitExpr and fix re-building CoroutineBodyStmt."}, | ||
[n]={{L, | [n]={{L,409,"/// Build calls to await_ready, await_suspend, and await_resume for a co_await\n/// expression.\n/// The generated AST tries to clean up temporary objects as early as\n/// possible so that they don\'t live across suspension points if possible.\n/// Having temporary objects living across suspension points unnecessarily can\n/// lead to large frame size, and also lead to memory corruptions if the\n/// coroutine frame is destroyed after coming back from suspension. This is done\n/// by wrapping both the await_ready call and the await_suspend call with\n/// ExprWithCleanups. In the end of this function, we also need to explicitly\n/// set cleanup state so that the CoawaitExpr is also wrapped with an\n/// ExprWithCleanups to clean up the awaiter associated with the co_await\n/// expression.\nstatic ReadySuspendResumeResult buildCoawaitCalls(Sema &S, VarDecl *CoroPromise, SourceLocation Loc, Expr *E) {\n if (!AwaitReady->getType()->isDependentType()) {\n if (Conv.isInvalid()) {\n S.Diag(Loc, diag::note_coroutine_promise_call_implicitly_required) << AwaitReady->getDirectCallee() << E->getSourceRange();"},{L,450,"/// Build calls to await_ready, await_suspend, and await_resume for a co_await\n/// expression.\n/// The generated AST tries to clean up temporary objects as early as\n/// possible so that they don\'t live across suspension points if possible.\n/// Having temporary objects living across suspension points unnecessarily can\n/// lead to large frame size, and also lead to memory corruptions if the\n/// coroutine frame is destroyed after coming back from suspension. This is done\n/// by wrapping both the await_ready call and the await_suspend call with\n/// ExprWithCleanups. In the end of this function, we also need to explicitly\n/// set cleanup state so that the CoawaitExpr is also wrapped with an\n/// ExprWithCleanups to clean up the awaiter associated with the co_await\n/// expression.\nstatic ReadySuspendResumeResult buildCoawaitCalls(Sema &S, VarDecl *CoroPromise, SourceLocation Loc, Expr *E) {\n if (!AwaitSuspend->getType()->isDependentType()) {\n // Support for coroutine_handle returning await_suspend.\n if (Expr *TailCallSuspend = maybeTailCall(S, RetType, AwaitSuspend, Loc))\n else {\n // non-class prvalues always have cv-unqualified types\n if (RetType->isReferenceType() || (!RetType->isBooleanType() && !RetType->isVoidType())) {\n S.Diag(Loc, diag::note_coroutine_promise_call_implicitly_required) << AwaitSuspend->getDirectCallee();"},{L,1499,"bool CoroutineStmtBuilder::makeNewAndDeleteExpr() {\n if (RequiresNoThrowAlloc) {\n if (!FT->isNothrow(/*ResultIfDependent*/ false)) {\n S.Diag(Loc, diag::note_coroutine_promise_call_implicitly_required) << OperatorNew;"}} | ||
}, | }, | ||
["note_coroutine_promise_implicit_await_transform_required_here"]={ | ["note_coroutine_promise_implicit_await_transform_required_here"]={ | ||
Line 2,973: | Line 2,973: | ||
[c]=Zb, | [c]=Zb, | ||
[m]={"20f25cb6dfb3",1488843495,"[coroutines] Add DependentCoawaitExpr and fix re-building CoroutineBodyStmt."}, | [m]={"20f25cb6dfb3",1488843495,"[coroutines] Add DependentCoawaitExpr and fix re-building CoroutineBodyStmt."}, | ||
[n]={{L, | [n]={{L,859,"// Attempts to resolve and build a CoawaitExpr from \"raw\" inputs, bailing out to\n// DependentCoawaitExpr if needed.\nExprResult Sema::BuildUnresolvedCoawaitExpr(SourceLocation Loc, Expr *Operand, UnresolvedLookupExpr *Lookup) {\n if (lookupMember(*this, \"await_transform\", RD, Loc)) {\n if (R.isInvalid()) {\n Diag(Loc, diag::note_coroutine_promise_implicit_await_transform_required_here) << Operand->getSourceRange();"}} | ||
}, | }, | ||
["note_coroutine_promise_suspend_implicitly_required"]={ | ["note_coroutine_promise_suspend_implicitly_required"]={ | ||
Line 2,985: | Line 2,985: | ||
[c]=Zb, | [c]=Zb, | ||
[m]={"627a63cf5081",1492334399,"[coroutines] Fix building of new/delete expressions when get_return_object_on_allocation_failure() i..."}, | [m]={"627a63cf5081",1492334399,"[coroutines] Fix building of new/delete expressions when get_return_object_on_allocation_failure() i..."}, | ||
[n]={{L, | [n]={{L,719,"bool Sema::ActOnCoroutineBodyStart(Scope *SC, SourceLocation KWLoc, StringRef Keyword) {\n // Build the initial suspend point\n auto buildSuspends = [&](StringRef Name) mutable -> StmtResult {\n if (Suspend.isInvalid()) {\n Diag(Loc, diag::note_coroutine_promise_suspend_implicitly_required) << ((Name == \"initial_suspend\") ? 0 : 1);"}} | ||
}, | }, | ||
["note_covariant_thunk"]={ | ["note_covariant_thunk"]={ | ||
Line 2,997: | Line 2,997: | ||
[c]="VTable ABI Issue", | [c]="VTable ABI Issue", | ||
[m]={"70e6a00170a4",1430516145,"[MS ABI] Detect and diagnose vftables which cannot be created"}, | [m]={"70e6a00170a4",1430516145,"[MS ABI] Detect and diagnose vftables which cannot be created"}, | ||
[n]={{"clang/lib/AST/VTableBuilder.cpp", | [n]={{"clang/lib/AST/VTableBuilder.cpp",3555,"// We want to select the path which introduces the most covariant overrides. If\n// two paths introduce overrides which the other path doesn\'t contain, issue a\n// diagnostic.\nstatic const FullPathTy *selectBestPath(ASTContext &Context, const CXXRecordDecl *RD, const VPtrInfo &Info, std::list<FullPathTy> &FullPaths) {\n for (const FullPathTy &SpecificPath : FullPaths) {\n if (MissingOverrides.empty()) {\n } else {\n Diags.Report(CovariantMD->getLocation(), diag::note_covariant_thunk) << CovariantMD;"},{"clang/lib/AST/VTableBuilder.cpp",3557,"// We want to select the path which introduces the most covariant overrides. If\n// two paths introduce overrides which the other path doesn\'t contain, issue a\n// diagnostic.\nstatic const FullPathTy *selectBestPath(ASTContext &Context, const CXXRecordDecl *RD, const VPtrInfo &Info, std::list<FullPathTy> &FullPaths) {\n for (const FullPathTy &SpecificPath : FullPaths) {\n if (MissingOverrides.empty()) {\n } else {\n Diags.Report(ConflictMD->getLocation(), diag::note_covariant_thunk) << ConflictMD;"}} | ||
}, | }, | ||
["note_cuda_conflicting_device_function_declared_here"]={ | ["note_cuda_conflicting_device_function_declared_here"]={ | ||
Line 3,009: | Line 3,009: | ||
[c]=o, | [c]=o, | ||
[m]={"ba122ab42fe5",1459380621,"[CUDA] Make unattributed constexpr functions implicitly host+device."}, | [m]={"ba122ab42fe5",1459380621,"[CUDA] Make unattributed constexpr functions implicitly host+device."}, | ||
[n]={{"clang/lib/Sema/SemaCUDA.cpp", | [n]={{"clang/lib/Sema/SemaCUDA.cpp",700,"// With -fcuda-host-device-constexpr, an unattributed constexpr function is\n// treated as implicitly __host__ __device__, unless:\n// * it is a variadic function (device-side variadic functions are not\n// allowed), or\n// * a __device__ function with this signature was already declared, in which\n// case in which case we output an error, unless the __device__ decl is in a\n// system header, in which case we leave the constexpr function unattributed.\n//\n// In addition, all function decls are treated as __host__ __device__ when\n// ForceCUDAHostDeviceDepth > 0 (corresponding to code within a\n// #pragma clang force_cuda_host_device_begin/end\n// pair).\nvoid Sema::maybeAddCUDAHostDeviceAttrs(FunctionDecl *NewD, const LookupResult &Previous) {\n if (It != Previous.end()) {\n if (!getSourceManager().isInSystemHeader(Match->getLocation())) {\n Diag(Match->getLocation(), diag::note_cuda_conflicting_device_function_declared_here);"}} | ||
}, | }, | ||
["note_cuda_const_var_unpromoted"]={ | ["note_cuda_const_var_unpromoted"]={ | ||
Line 3,021: | Line 3,021: | ||
[c]=o, | [c]=o, | ||
[m]={Pb,1615397021,Ob}, | [m]={Pb,1615397021,Ob}, | ||
[n]={{r, | [n]={{r,19016,"/// Directly mark a variable odr-used. Given a choice, prefer to use\n/// MarkVariableReferenced since it does additional checks and then\n/// calls MarkVarDeclODRUsed.\n/// If the variable must be captured:\n/// - if FunctionScopeIndexToStopAt is null, capture it in the CurContext\n/// - else capture it in the DeclContext that maps to the\n/// *FunctionScopeIndexToStopAt on the FunctionScopeInfo stack.\nstatic void MarkVarDeclODRUsed(ValueDecl *V, SourceLocation Loc, Sema &SemaRef, const unsigned *const FunctionScopeIndexToStopAt = nullptr) {\n if (SemaRef.LangOpts.CUDA && Var->hasGlobalStorage()) {\n if (VarTarget == Sema::CVT_Host && (UserTarget == Sema::CFT_Device || UserTarget == Sema::CFT_HostDevice || UserTarget == Sema::CFT_Global)) {\n // Diagnose ODR-use of host global variables in device functions.\n // Reference of device global variables in host functions is allowed\n // through shadow variables therefore it is not diagnosed.\n if (SemaRef.LangOpts.CUDAIsDevice) {\n SemaRef.targetDiag(Var->getLocation(), Var->getType().isConstQualified() ? diag::note_cuda_const_var_unpromoted : diag::note_cuda_host_var);"}} | ||
}, | }, | ||
["note_cuda_device_builtin_surftex_cls_should_have_match_arg"]={ | ["note_cuda_device_builtin_surftex_cls_should_have_match_arg"]={ | ||
Line 3,033: | Line 3,033: | ||
[c]=o, | [c]=o, | ||
[m]={yb,1576908663,Db}, | [m]={yb,1576908663,Db}, | ||
[n]={{q, | [n]={{q,6348,"static void checkCUDADeviceBuiltinSurfaceClassTemplate(Sema &S, CXXRecordDecl *Class) {\n if (N > 0 && !isa<TemplateTypeParmDecl>(Params->getParam(0))) {\n S.Diag(TD->getLocation(), diag::note_cuda_device_builtin_surftex_cls_should_have_match_arg) << TD << /*1st*/ 0 << /*type*/ 0;"},{q,6356,"static void checkCUDADeviceBuiltinSurfaceClassTemplate(Sema &S, CXXRecordDecl *Class) {\n if (N > 1) {\n if (!NTTP || !NTTP->getType()->isIntegralOrEnumerationType()) {\n S.Diag(TD->getLocation(), diag::note_cuda_device_builtin_surftex_cls_should_have_match_arg) << TD << /*2nd*/ 1 << /*integer*/ 1;"},{q,6402,"static void checkCUDADeviceBuiltinTextureClassTemplate(Sema &S, CXXRecordDecl *Class) {\n if (N > 0 && !isa<TemplateTypeParmDecl>(Params->getParam(0))) {\n S.Diag(TD->getLocation(), diag::note_cuda_device_builtin_surftex_cls_should_have_match_arg) << TD << /*1st*/ 0 << /*type*/ 0;"},{q,6410,"static void checkCUDADeviceBuiltinTextureClassTemplate(Sema &S, CXXRecordDecl *Class) {\n if (N > 1) {\n if (!NTTP || !NTTP->getType()->isIntegralOrEnumerationType()) {\n S.Diag(TD->getLocation(), diag::note_cuda_device_builtin_surftex_cls_should_have_match_arg) << TD << /*2nd*/ 1 << /*integer*/ 1;"},{q,6419,"static void checkCUDADeviceBuiltinTextureClassTemplate(Sema &S, CXXRecordDecl *Class) {\n if (N > 2) {\n if (!NTTP || !NTTP->getType()->isIntegralOrEnumerationType()) {\n S.Diag(TD->getLocation(), diag::note_cuda_device_builtin_surftex_cls_should_have_match_arg) << TD << /*3rd*/ 2 << /*integer*/ 1;"}} | ||
}, | }, | ||
["note_cuda_device_builtin_surftex_cls_should_have_n_args"]={ | ["note_cuda_device_builtin_surftex_cls_should_have_n_args"]={ | ||
Line 3,045: | Line 3,045: | ||
[c]=o, | [c]=o, | ||
[m]={yb,1576908663,Db}, | [m]={yb,1576908663,Db}, | ||
[n]={{q, | [n]={{q,6342,"static void checkCUDADeviceBuiltinSurfaceClassTemplate(Sema &S, CXXRecordDecl *Class) {\n if (N != 2) {\n S.Diag(TD->getLocation(), diag::note_cuda_device_builtin_surftex_cls_should_have_n_args) << TD << 2;"},{q,6396,"static void checkCUDADeviceBuiltinTextureClassTemplate(Sema &S, CXXRecordDecl *Class) {\n if (N != 3) {\n S.Diag(TD->getLocation(), diag::note_cuda_device_builtin_surftex_cls_should_have_n_args) << TD << 3;"}} | ||
}, | }, | ||
["note_cuda_device_builtin_surftex_should_be_template_class"]={ | ["note_cuda_device_builtin_surftex_should_be_template_class"]={ | ||
Line 3,057: | Line 3,057: | ||
[c]=o, | [c]=o, | ||
[m]={yb,1576908663,Db}, | [m]={yb,1576908663,Db}, | ||
[n]={{q, | [n]={{q,6329,"static void checkCUDADeviceBuiltinSurfaceClassTemplate(Sema &S, CXXRecordDecl *Class) {\n if (!TD) {\n if (!SD) {\n S.Diag(Class->getLocation(), diag::note_cuda_device_builtin_surftex_should_be_template_class) << Class;"},{q,6383,"static void checkCUDADeviceBuiltinTextureClassTemplate(Sema &S, CXXRecordDecl *Class) {\n if (!TD) {\n if (!SD) {\n S.Diag(Class->getLocation(), diag::note_cuda_device_builtin_surftex_should_be_template_class) << Class;"}} | ||
}, | }, | ||
["note_cuda_host_var"]={ | ["note_cuda_host_var"]={ | ||
Line 3,069: | Line 3,069: | ||
[c]=o, | [c]=o, | ||
[m]={Pb,1615397021,Ob}, | [m]={Pb,1615397021,Ob}, | ||
[n]={{r, | [n]={{r,19079,"/// Directly mark a variable odr-used. Given a choice, prefer to use\n/// MarkVariableReferenced since it does additional checks and then\n/// calls MarkVarDeclODRUsed.\n/// If the variable must be captured:\n/// - if FunctionScopeIndexToStopAt is null, capture it in the CurContext\n/// - else capture it in the DeclContext that maps to the\n/// *FunctionScopeIndexToStopAt on the FunctionScopeInfo stack.\nstatic void MarkVarDeclODRUsed(ValueDecl *V, SourceLocation Loc, Sema &SemaRef, const unsigned *const FunctionScopeIndexToStopAt = nullptr) {\n if (SemaRef.LangOpts.CUDA && Var->hasGlobalStorage()) {\n if (VarTarget == Sema::CVT_Host && (UserTarget == Sema::CFT_Device || UserTarget == Sema::CFT_HostDevice || UserTarget == Sema::CFT_Global)) {\n // Diagnose ODR-use of host global variables in device functions.\n // Reference of device global variables in host functions is allowed\n // through shadow variables therefore it is not diagnosed.\n if (SemaRef.LangOpts.CUDAIsDevice) {\n SemaRef.targetDiag(Var->getLocation(), Var->getType().isConstQualified() ? diag::note_cuda_const_var_unpromoted : diag::note_cuda_host_var);"}} | ||
}, | }, | ||
["note_cuda_ovl_candidate_target_mismatch"]={ | ["note_cuda_ovl_candidate_target_mismatch"]={ | ||
Line 3,081: | Line 3,081: | ||
[c]=o, | [c]=o, | ||
[m]={"13e9b4d76851",1481138836,"[CUDA] Improve target attribute checking for function templates."}, | [m]={"13e9b4d76851",1481138836,"[CUDA] Improve target attribute checking for function templates."}, | ||
[n]={{P, | [n]={{P,11366,"/// Diagnose a failed template-argument deduction.\nstatic void DiagnoseBadDeduction(Sema &S, NamedDecl *Found, Decl *Templated, DeductionFailureInfo &DeductionFailure, unsigned NumArgs, bool TakingCandidateAddress) {\n case Sema::TDK_CUDATargetMismatch:\n S.Diag(Templated->getLocation(), diag::note_cuda_ovl_candidate_target_mismatch);"}} | ||
}, | }, | ||
["note_cxx20_compat_utf8_string_remove_u8"]={ | ["note_cxx20_compat_utf8_string_remove_u8"]={ | ||
Line 3,093: | Line 3,093: | ||
[c]=o, | [c]=o, | ||
[m]={yb,1576908663,Db}, | [m]={yb,1576908663,Db}, | ||
[n]={{r, | [n]={{r,1997,"/// ActOnStringLiteral - The specified tokens were lexed as pasted string\n/// fragments (e.g. \"foo\" \"bar\" L\"baz\"). The result string has to handle string\n/// concatenation ([C99 5.1.1.2, translation phase #6]), so it may come from\n/// multiple tokens. However, the common case is that StringToks points to one\n/// string.\n///\nExprResult Sema::ActOnStringLiteral(ArrayRef<Token> StringToks, Scope *UDLScope) {\n // Warn on initializing an array of char from a u8 string literal; this\n // becomes ill-formed in C++2a.\n if (getLangOpts().CPlusPlus && !getLangOpts().CPlusPlus20 && !getLangOpts().Char8 && Kind == StringLiteral::UTF8) {\n auto RemovalDiag = PDiag(diag::note_cxx20_compat_utf8_string_remove_u8);"}} | ||
}, | }, | ||
["note_decl_hiding_tag_type"]={ | ["note_decl_hiding_tag_type"]={ | ||
Line 3,105: | Line 3,105: | ||
[c]=Q, | [c]=Q, | ||
[m]={"3fe3f857699f",1335551209,"Imrpove the note text for when a non-type decl hides a tag type"}, | [m]={"3fe3f857699f",1335551209,"Imrpove the note text for when a non-type decl hides a tag type"}, | ||
[n]={{"clang/lib/Parse/ParseDecl.cpp", | [n]={{"clang/lib/Parse/ParseDecl.cpp",2830,"/// ParseImplicitInt - This method is called when we have an non-typename\n/// identifier in a declspec (which normally terminates the decl spec) when\n/// the declspec has no type specifier. In this case, the declspec is either\n/// malformed or is \"implicit int\" (in K&R and C89).\n///\n/// This method handles diagnosing this prettily and returns false if the\n/// declspec is done being processed. If it recovers and thinks there may be\n/// other pieces of declspec after it, it returns true.\n///\nbool Parser::ParseImplicitInt(DeclSpec &DS, CXXScopeSpec *SS, const ParsedTemplateInfo &TemplateInfo, AccessSpecifier AS, DeclSpecContext DSC, ParsedAttributes &Attrs) {\n // Otherwise, if we don\'t consume this token, we are going to emit an\n // error anyway. Try to recover from various common problems. Check\n // to see if this was a reference to a tag name without a tag specified.\n // This is a common problem in C (saying \'foo\' instead of \'struct foo\').\n //\n // C++ doesn\'t need this, and isTagName doesn\'t take SS.\n if (SS == nullptr) {\n if (TagName) {\n if (Actions.LookupParsedName(R, getCurScope(), SS)) {\n for (LookupResult::iterator I = R.begin(), IEnd = R.end(); I != IEnd; ++I)\n Diag((*I)->getLocation(), diag::note_decl_hiding_tag_type) << TokenName << TagName;"},{t,889,"static bool isTagTypeWithMissingTag(Sema &SemaRef, LookupResult &Result, Scope *S, CXXScopeSpec &SS, IdentifierInfo *&Name, SourceLocation NameLoc) {\n if (TagDecl *Tag = R.getAsSingle<TagDecl>()) {\n for (LookupResult::iterator I = Result.begin(), IEnd = Result.end(); I != IEnd; ++I)\n SemaRef.Diag((*I)->getLocation(), diag::note_decl_hiding_tag_type) << Name << TagName;"}} | ||
}, | }, | ||
["note_decl_unguarded_availability_silence"]={ | ["note_decl_unguarded_availability_silence"]={ | ||
Line 3,117: | Line 3,117: | ||
[c]=o, | [c]=o, | ||
[m]={"8b352c4d9d82",1502740152,"[Sema] Improve some -Wunguarded-availability diagnostics"}, | [m]={"8b352c4d9d82",1502740152,"[Sema] Improve some -Wunguarded-availability diagnostics"}, | ||
[n]={{V, | [n]={{V,404,"/// Actually emit an availability diagnostic for a reference to an unavailable\n/// decl.\n///\n/// \\param Ctx The context that the reference occurred in\n/// \\param ReferringDecl The exact declaration that was referenced.\n/// \\param OffendingDecl A related decl to \\c ReferringDecl that has an\n/// availability attribute corresponding to \\c K attached to it. Note that this\n/// may not be the same as ReferringDecl, i.e. if an EnumDecl is annotated and\n/// we refer to a member EnumConstantDecl, ReferringDecl is the EnumConstantDecl\n/// and OffendingDecl is the EnumDecl.\nstatic void DoEmitAvailabilityWarning(Sema &S, AvailabilityResult K, Decl *Ctx, const NamedDecl *ReferringDecl, const NamedDecl *OffendingDecl, StringRef Message, ArrayRef<SourceLocation> Locs, const ObjCInterfaceDecl *UnknownObjCClass, const ObjCPropertyDecl *ObjCProperty, bool ObjCPropertyAccess) {\n case AR_NotYetIntroduced: {\n if (const auto *Enclosing = findEnclosingDeclToAnnotate(Ctx)) {\n if (const auto *TD = dyn_cast<TagDecl>(Enclosing))\n if (TD->getDeclName().isEmpty()) {\n S.Diag(TD->getLocation(), diag::note_decl_unguarded_availability_silence) << /*Anonymous*/ 1 << TD->getKindName();"},{V,410,"/// Actually emit an availability diagnostic for a reference to an unavailable\n/// decl.\n///\n/// \\param Ctx The context that the reference occurred in\n/// \\param ReferringDecl The exact declaration that was referenced.\n/// \\param OffendingDecl A related decl to \\c ReferringDecl that has an\n/// availability attribute corresponding to \\c K attached to it. Note that this\n/// may not be the same as ReferringDecl, i.e. if an EnumDecl is annotated and\n/// we refer to a member EnumConstantDecl, ReferringDecl is the EnumConstantDecl\n/// and OffendingDecl is the EnumDecl.\nstatic void DoEmitAvailabilityWarning(Sema &S, AvailabilityResult K, Decl *Ctx, const NamedDecl *ReferringDecl, const NamedDecl *OffendingDecl, StringRef Message, ArrayRef<SourceLocation> Locs, const ObjCInterfaceDecl *UnknownObjCClass, const ObjCPropertyDecl *ObjCProperty, bool ObjCPropertyAccess) {\n case AR_NotYetIntroduced: {\n if (const auto *Enclosing = findEnclosingDeclToAnnotate(Ctx)) {\n auto FixitNoteDiag = S.Diag(Enclosing->getLocation(), diag::note_decl_unguarded_availability_silence) << /*Named*/ 0 << Enclosing;"}} | ||
}, | }, | ||
["note_declaration_not_a_prototype"]={ | ["note_declaration_not_a_prototype"]={ | ||
Line 3,129: | Line 3,129: | ||
[c]=o, | [c]=o, | ||
[m]={"2a45e409a8ae",1355794160,"When warning about a missing prototype because a function declaration is missing \'void\', insert a fi..."}, | [m]={"2a45e409a8ae",1355794160,"When warning about a missing prototype because a function declaration is missing \'void\', insert a fi..."}, | ||
[n]={{t, | [n]={{t,15671,"Decl *Sema::ActOnFinishFunctionBody(Decl *dcl, Stmt *Body, bool IsInstantiation) {\n {\n if (FD) {\n if (ShouldWarnAboutMissingPrototype(FD, PossiblePrototype)) {\n if (PossiblePrototype) {\n // We found a declaration that is not a prototype,\n // but that could be a zero-parameter prototype\n if (TypeSourceInfo *TI = PossiblePrototype->getTypeSourceInfo()) {\n if (FunctionNoProtoTypeLoc FTL = TL.getAs<FunctionNoProtoTypeLoc>())\n Diag(PossiblePrototype->getLocation(), diag::note_declaration_not_a_prototype) << (FD->getNumParams() != 0) << (FD->getNumParams() == 0 ? FixItHint::CreateInsertion(FTL.getRParenLoc(), \"void\") : FixItHint{});"}} | ||
}, | }, | ||
["note_declare_parameter_strong"]={ | ["note_declare_parameter_strong"]={ | ||
Line 3,141: | Line 3,141: | ||
[c]="ARC Semantic Issue", | [c]="ARC Semantic Issue", | ||
[m]={"c81708e6ecf0",1477345554,"[Sema][ObjC] Warn about implicitly autoreleasing out-parameters captured"}, | [m]={"c81708e6ecf0",1477345554,"[Sema][ObjC] Warn about implicitly autoreleasing out-parameters captured"}, | ||
[n]={{r, | [n]={{r,19346,"// Returns true if the capture by block was successful.\nstatic bool captureInBlock(BlockScopeInfo *BSI, ValueDecl *Var, SourceLocation Loc, const bool BuildAndDiagnose, QualType &CaptureType, QualType &DeclRefType, const bool Nested, Sema &S, bool Invalid) {\n // Warn about implicitly autoreleasing indirect parameters captured by blocks.\n if (const auto *PT = CaptureType->getAs<PointerType>()) {\n if (!Invalid && PointeeTy->getAs<ObjCObjectPointerType>() && PointeeTy.getObjCLifetime() == Qualifiers::OCL_Autoreleasing && !S.Context.hasDirectOwnershipQualifier(PointeeTy)) {\n if (BuildAndDiagnose) {\n S.Diag(VarLoc, diag::note_declare_parameter_strong);"}} | ||
}, | }, | ||
["note_declared_at"]={ | ["note_declared_at"]={ | ||
Line 3,154: | Line 3,154: | ||
[m]={wb,1236199783,vb}, | [m]={wb,1236199783,vb}, | ||
[n]={ | [n]={ | ||
[1]={p,2123,"static void NoteLValueLocation(EvalInfo &Info, APValue::LValueBase Base) {\n if (VD)\n Info.Note(VD->getLocation(), diag::note_declared_at);"}, | |||
[2]={p, | |||
} | } | ||
}, | }, | ||
Line 3,231: | Line 3,231: | ||
[c]=Zb, | [c]=Zb, | ||
[m]={"cfd53b4e9993",1445494430,"[coroutines] Initial stub Sema functionality for handling coroutine await / yield / return."}, | [m]={"cfd53b4e9993",1445494430,"[coroutines] Initial stub Sema functionality for handling coroutine await / yield / return."}, | ||
[n]={{L, | [n]={{L,721,"bool Sema::ActOnCoroutineBodyStart(Scope *SC, SourceLocation KWLoc, StringRef Keyword) {\n // Build the initial suspend point\n auto buildSuspends = [&](StringRef Name) mutable -> StmtResult {\n if (Suspend.isInvalid()) {\n Diag(KWLoc, diag::note_declared_coroutine_here) << Keyword;"},{L,1124,"void Sema::CheckCompletedCoroutineBody(FunctionDecl *FD, Stmt *&Body) {\n // [stmt.return.coroutine]p1:\n // A coroutine shall not enclose a return statement ([stmt.return]).\n if (Fn->FirstReturnLoc.isValid()) {\n Diag(Fn->FirstCoroutineStmtLoc, diag::note_declared_coroutine_here) << Fn->getFirstCoroutineStmtKeyword();"},{L,1229,"static bool diagReturnOnAllocFailure(Sema &S, Expr *E, CXXRecordDecl *PromiseRecordDecl, FunctionScopeInfo &Fn) {\n S.Diag(Fn.FirstCoroutineStmtLoc, diag::note_declared_coroutine_here) << Fn.getFirstCoroutineStmtKeyword();"},{L,1272,"bool CoroutineStmtBuilder::makeReturnOnAllocFailure() {\n if (ReturnStmt.isInvalid()) {\n S.Diag(Fn.FirstCoroutineStmtLoc, diag::note_declared_coroutine_here) << Fn.getFirstCoroutineStmtKeyword();"},{L,1726,"bool CoroutineStmtBuilder::makeOnException() {\n // Since the body of the coroutine will be wrapped in try-catch, it will\n // be incompatible with SEH __try if present in a function.\n if (!S.getLangOpts().Borland && Fn.FirstSEHTryLoc.isValid()) {\n S.Diag(Fn.FirstCoroutineStmtLoc, diag::note_declared_coroutine_here) << Fn.getFirstCoroutineStmtKeyword();"},{L,1928,"static void noteMemberDeclaredHere(Sema &S, Expr *E, FunctionScopeInfo &Fn) {\n S.Diag(Fn.FirstCoroutineStmtLoc, diag::note_declared_coroutine_here) << Fn.getFirstCoroutineStmtKeyword();"}} | ||
}, | }, | ||
["note_declared_nonnull"]={ | ["note_declared_nonnull"]={ | ||
Line 3,243: | Line 3,243: | ||
[c]=o, | [c]=o, | ||
[m]={"bc85ec865606",1465967919,"Add a \"declared \'nonnull\' here\" note to warnings where an expression is checked against null."}, | [m]={"bc85ec865606",1465967919,"Add a \"declared \'nonnull\' here\" note to warnings where an expression is checked against null."}, | ||
[n]={{y, | [n]={{y,15493,"/// Diagnose pointers that are always non-null.\n/// \\param E the expression containing the pointer\n/// \\param NullKind NPCK_NotNull if E is a cast to bool, otherwise, E is\n/// compared to a null pointer\n/// \\param IsEqual True when the comparison is equal to a null pointer\n/// \\param Range Extra SourceRange to highlight in the diagnostic\nvoid Sema::DiagnoseAlwaysNonNullPointer(Expr *E, Expr::NullPointerConstantKind NullKind, bool IsEqual, SourceRange Range) {\n auto ComplainAboutNonnullParamOrCall = [&](const Attr *NonnullAttr) {\n Diag(NonnullAttr->getLocation(), diag::note_declared_nonnull) << IsParam;"}} | ||
}, | }, | ||
["note_declared_required_constant_init_here"]={ | ["note_declared_required_constant_init_here"]={ | ||
Line 3,255: | Line 3,255: | ||
[c]=o, | [c]=o, | ||
[m]={"92f8935e63f0",1472840729,"Implement __attribute__((require_constant_initialization)) for safe static initialization."}, | [m]={"92f8935e63f0",1472840729,"Implement __attribute__((require_constant_initialization)) for safe static initialization."}, | ||
[n]={{t, | [n]={{t,14229,"void Sema::CheckCompleteVariableDeclaration(VarDecl *var) {\n // Check whether the initializer is sufficiently constant.\n if (getLangOpts().CPlusPlus && !type->isDependentType() && Init && !Init->isValueDependent() && (GlobalStorage || var->isConstexpr() || var->mightBeUsableInConstantExpressions(Context))) {\n if (HasConstInit) {\n } else if (var->isConstexpr()) {\n } else if (GlobalStorage && var->hasAttr<ConstInitAttr>()) {\n Diag(Attr->getLocation(), diag::note_declared_required_constant_init_here) << Attr->getRange() << Attr->isConstinit();"}} | ||
}, | }, | ||
["note_deduced_non_type_template_arg_type_mismatch"]={ | ["note_deduced_non_type_template_arg_type_mismatch"]={ | ||
Line 3,277: | Line 3,277: | ||
[c]=o, | [c]=o, | ||
[m]={"e68a38f0a8ab",1482553231,"Fix crash if substitution fails during deduction of variable template partial specialization argumen..."}, | [m]={"e68a38f0a8ab",1482553231,"Fix crash if substitution fails during deduction of variable template partial specialization argumen..."}, | ||
[n]={{z, | [n]={{z,858,"/// Prints the current instantiation stack through a series of\n/// notes.\nvoid Sema::PrintInstantiationStack() {\n for (SmallVectorImpl<CodeSynthesisContext>::reverse_iterator Active = CodeSynthesisContexts.rbegin(), ActiveEnd = CodeSynthesisContexts.rend(); Active != ActiveEnd; ++Active, ++InstantiationIdx) {\n case CodeSynthesisContext::DeducedTemplateArgumentSubstitution: {\n if (FunctionTemplateDecl *FnTmpl = dyn_cast<FunctionTemplateDecl>(Active->Entity)) {\n } else {\n Diags.Report(Active->PointOfInstantiation, diag::note_deduced_template_arg_substitution_here) << IsVar << IsTemplate << cast<NamedDecl>(Active->Entity) << getTemplateArgumentBindingsText(Params, Active->TemplateArgs, Active->NumTemplateArgs) << Active->InstantiationRange;"}} | ||
}, | }, | ||
["note_deduction_guide_access"]={ | ["note_deduction_guide_access"]={ | ||
Line 3,289: | Line 3,289: | ||
[c]=o, | [c]=o, | ||
[m]={"e4899c16480d",1527718423,"PR37631: verify that a member deduction guide has the same access as its template."}, | [m]={"e4899c16480d",1527718423,"PR37631: verify that a member deduction guide has the same access as its template."}, | ||
[n]={{q, | [n]={{q,3676,"/// ActOnCXXMemberDeclarator - This is invoked when a C++ class member\n/// declarator is parsed. \'AS\' is the access specifier, \'BW\' specifies the\n/// bitfield width if there is one, \'InitExpr\' specifies the initializer if\n/// one has been parsed, and \'InitStyle\' is set if an in-class initializer is\n/// present (but parsing it has been deferred).\nNamedDecl *Sema::ActOnCXXMemberDeclarator(Scope *S, AccessSpecifier AS, Declarator &D, MultiTemplateParamsArg TemplateParameterLists, Expr *BW, const VirtSpecifiers &VS, InClassInitStyle InitStyle) {\n if (isInstField) {\n } else {\n // C++ [temp.deduct.guide]p3:\n // A deduction guide [...] for a member class template [shall be\n // declared] with the same access [as the template].\n if (auto *DG = dyn_cast<CXXDeductionGuideDecl>(NonTemplateMember)) {\n // Access specifiers are only meaningful if both the template and the\n // deduction guide are from the same scope.\n if (AS != TD->getAccess() && TD->getDeclContext()->getRedeclContext()->Equals(DG->getDeclContext()->getRedeclContext())) {\n Diag(LastAccessSpec->getBeginLoc(), diag::note_deduction_guide_access) << AS;"}} | ||
}, | }, | ||
["note_deduction_guide_template_access"]={ | ["note_deduction_guide_template_access"]={ | ||
Line 3,301: | Line 3,301: | ||
[c]=o, | [c]=o, | ||
[m]={"e4899c16480d",1527718423,"PR37631: verify that a member deduction guide has the same access as its template."}, | [m]={"e4899c16480d",1527718423,"PR37631: verify that a member deduction guide has the same access as its template."}, | ||
[n]={{q, | [n]={{q,3668,"/// ActOnCXXMemberDeclarator - This is invoked when a C++ class member\n/// declarator is parsed. \'AS\' is the access specifier, \'BW\' specifies the\n/// bitfield width if there is one, \'InitExpr\' specifies the initializer if\n/// one has been parsed, and \'InitStyle\' is set if an in-class initializer is\n/// present (but parsing it has been deferred).\nNamedDecl *Sema::ActOnCXXMemberDeclarator(Scope *S, AccessSpecifier AS, Declarator &D, MultiTemplateParamsArg TemplateParameterLists, Expr *BW, const VirtSpecifiers &VS, InClassInitStyle InitStyle) {\n if (isInstField) {\n } else {\n // C++ [temp.deduct.guide]p3:\n // A deduction guide [...] for a member class template [shall be\n // declared] with the same access [as the template].\n if (auto *DG = dyn_cast<CXXDeductionGuideDecl>(NonTemplateMember)) {\n // Access specifiers are only meaningful if both the template and the\n // deduction guide are from the same scope.\n if (AS != TD->getAccess() && TD->getDeclContext()->getRedeclContext()->Equals(DG->getDeclContext()->getRedeclContext())) {\n Diag(TD->getBeginLoc(), diag::note_deduction_guide_template_access) << TD->getAccess();"}} | ||
}, | }, | ||
["note_default_arg_instantiation_here"]={ | ["note_default_arg_instantiation_here"]={ | ||
Line 3,313: | Line 3,313: | ||
[c]=o, | [c]=o, | ||
[m]={"5a8987ca5113",1237025389,"Update tablegen diagnostic files to be in sync with the def files."}, | [m]={"5a8987ca5113",1237025389,"Update tablegen diagnostic files to be in sync with the def files."}, | ||
[n]={{z, | [n]={{z,811,"/// Prints the current instantiation stack through a series of\n/// notes.\nvoid Sema::PrintInstantiationStack() {\n for (SmallVectorImpl<CodeSynthesisContext>::reverse_iterator Active = CodeSynthesisContexts.rbegin(), ActiveEnd = CodeSynthesisContexts.rend(); Active != ActiveEnd; ++Active, ++InstantiationIdx) {\n case CodeSynthesisContext::DefaultTemplateArgumentInstantiation: {\n Diags.Report(Active->PointOfInstantiation, diag::note_default_arg_instantiation_here) << OS.str() << Active->InstantiationRange;"}} | ||
}, | }, | ||
["note_default_argument_declared_here"]={ | ["note_default_argument_declared_here"]={ | ||
Line 3,325: | Line 3,325: | ||
[c]=o, | [c]=o, | ||
[m]={"84613c4eba08",1244825500,"It\'s an error to use a function declared in a class definition as a default argument before the func..."}, | [m]={"84613c4eba08",1244825500,"It\'s an error to use a function declared in a class definition as a default argument before the func..."}, | ||
[n]={{r, | [n]={{r,6327,"bool Sema::CheckCXXDefaultArgExpr(SourceLocation CallLoc, FunctionDecl *FD, ParmVarDecl *Param, Expr *RewrittenInit, bool SkipImmediateInvocations) {\n if (Param->hasUnparsedDefaultArg()) {\n Diag(UnparsedDefaultArgLocs[Param], diag::note_default_argument_declared_here);"}} | ||
}, | }, | ||
["note_default_function_arg_instantiation_here"]={ | ["note_default_function_arg_instantiation_here"]={ | ||
Line 3,337: | Line 3,337: | ||
[c]=o, | [c]=o, | ||
[m]={"657bad441eda",1252127659,"Use a separate diagnostic for default function argument expressions."}, | [m]={"657bad441eda",1252127659,"Use a separate diagnostic for default function argument expressions."}, | ||
[n]={{z, | [n]={{z,877,"/// Prints the current instantiation stack through a series of\n/// notes.\nvoid Sema::PrintInstantiationStack() {\n for (SmallVectorImpl<CodeSynthesisContext>::reverse_iterator Active = CodeSynthesisContexts.rbegin(), ActiveEnd = CodeSynthesisContexts.rend(); Active != ActiveEnd; ++Active, ++InstantiationIdx) {\n case CodeSynthesisContext::DefaultFunctionArgumentInstantiation: {\n Diags.Report(Active->PointOfInstantiation, diag::note_default_function_arg_instantiation_here) << OS.str() << Active->InstantiationRange;"}} | ||
}, | }, | ||
["note_default_member_initializer_not_yet_parsed"]={ | ["note_default_member_initializer_not_yet_parsed"]={ | ||
Line 3,349: | Line 3,349: | ||
[c]=o, | [c]=o, | ||
[m]={Y,1582847864,W}, | [m]={Y,1582847864,W}, | ||
[n]={{r, | [n]={{r,6457,"ExprResult Sema::BuildCXXDefaultInitExpr(SourceLocation Loc, FieldDecl *Field) {\n Diag(Field->getEndLoc(), diag::note_default_member_initializer_not_yet_parsed);"},{z,3520,"/// Instantiate the definition of a field from the given pattern.\n///\n/// \\param PointOfInstantiation The point of instantiation within the\n/// source code.\n/// \\param Instantiation is the declaration whose definition is being\n/// instantiated. This will be a class of a class temploid\n/// specialization, or a local enumeration within a function temploid\n/// specialization.\n/// \\param Pattern The templated declaration from which the instantiation\n/// occurs.\n/// \\param TemplateArgs The template arguments to be substituted into\n/// the pattern.\n///\n/// \\return \\c true if an error occurred, \\c false otherwise.\nbool Sema::InstantiateInClassInitializer(SourceLocation PointOfInstantiation, FieldDecl *Instantiation, FieldDecl *Pattern, const MultiLevelTemplateArgumentList &TemplateArgs) {\n if (!OldInit) {\n Diag(Pattern->getEndLoc(), diag::note_default_member_initializer_not_yet_parsed);"}} | ||
}, | }, | ||
["note_defaulted_comparison_ambiguous"]={ | ["note_defaulted_comparison_ambiguous"]={ | ||
Line 3,361: | Line 3,361: | ||
[c]=o, | [c]=o, | ||
[m]={jb,1573070592,gb}, | [m]={jb,1573070592,gb}, | ||
[n]={{q, | [n]={{q,8200,"/// A visitor over the notional body of a defaulted comparison that determines\n/// whether that body would be deleted or constexpr.\nclass DefaultedComparisonAnalyzer : public DefaultedComparisonVisitor<DefaultedComparisonAnalyzer, DefaultedComparisonInfo, DefaultedComparisonInfo, DefaultedComparisonSubobject> {\n Result visitBinaryOperator(OverloadedOperatorKind OO, ArrayRef<Expr *> Args, Subobject Subobj, OverloadCandidateSet *SpaceshipCandidates = nullptr) {\n case OR_Ambiguous:\n if (Diagnose == ExplainDeleted) {\n CandidateSet.NoteCandidates(PartialDiagnosticAt(Subobj.Loc, S.PDiag(diag::note_defaulted_comparison_ambiguous) << FD << Kind << Subobj.Kind << Subobj.Decl), S, OCD_AmbiguousCandidates, Args);"}} | ||
}, | }, | ||
["note_defaulted_comparison_calls_deleted"]={ | ["note_defaulted_comparison_calls_deleted"]={ | ||
Line 3,373: | Line 3,373: | ||
[c]=o, | [c]=o, | ||
[m]={jb,1573070592,gb}, | [m]={jb,1573070592,gb}, | ||
[n]={{q, | [n]={{q,8217,"/// A visitor over the notional body of a defaulted comparison that determines\n/// whether that body would be deleted or constexpr.\nclass DefaultedComparisonAnalyzer : public DefaultedComparisonVisitor<DefaultedComparisonAnalyzer, DefaultedComparisonInfo, DefaultedComparisonInfo, DefaultedComparisonSubobject> {\n Result visitBinaryOperator(OverloadedOperatorKind OO, ArrayRef<Expr *> Args, Subobject Subobj, OverloadCandidateSet *SpaceshipCandidates = nullptr) {\n case OR_Deleted:\n if (Diagnose == ExplainDeleted) {\n if ((DCK == DefaultedComparisonKind::NotEqual || DCK == DefaultedComparisonKind::Relational) && !Best->RewriteKind) {\n } else {\n S.Diag(Subobj.Loc, diag::note_defaulted_comparison_calls_deleted) << FD << Subobj.Kind << Subobj.Decl;"}} | ||
}, | }, | ||
["note_defaulted_comparison_cannot_deduce"]={ | ["note_defaulted_comparison_cannot_deduce"]={ | ||
Line 3,385: | Line 3,385: | ||
[c]=o, | [c]=o, | ||
[m]={"fe17b30a7957",1575504770,"[attributes][analyzer] Add annotations for handles."}, | [m]={"fe17b30a7957",1575504770,"[attributes][analyzer] Add annotations for handles."}, | ||
[n]={{q, | [n]={{q,8162,"/// A visitor over the notional body of a defaulted comparison that determines\n/// whether that body would be deleted or constexpr.\nclass DefaultedComparisonAnalyzer : public DefaultedComparisonVisitor<DefaultedComparisonAnalyzer, DefaultedComparisonInfo, DefaultedComparisonInfo, DefaultedComparisonSubobject> {\n Result visitBinaryOperator(OverloadedOperatorKind OO, ArrayRef<Expr *> Args, Subobject Subobj, OverloadCandidateSet *SpaceshipCandidates = nullptr) {\n case OR_Success: {\n if (FunctionDecl *BestFD = Best->Function) {\n if (NeedsDeducing) {\n if (!Info) {\n if (Diagnose == ExplainDeleted) {\n S.Diag(Subobj.Loc, diag::note_defaulted_comparison_cannot_deduce) << Subobj.Kind << Subobj.Decl << BestFD->getCallResultType().withoutLocalFastQualifiers();"}} | ||
}, | }, | ||
["note_defaulted_comparison_cannot_deduce_callee"]={ | ["note_defaulted_comparison_cannot_deduce_callee"]={ | ||
Line 3,397: | Line 3,397: | ||
[c]=o, | [c]=o, | ||
[m]={"fe17b30a7957",1575504770,"[attributes][analyzer] Add annotations for handles."}, | [m]={"fe17b30a7957",1575504770,"[attributes][analyzer] Add annotations for handles."}, | ||
[n]={{q, | [n]={{q,8153,"/// A visitor over the notional body of a defaulted comparison that determines\n/// whether that body would be deleted or constexpr.\nclass DefaultedComparisonAnalyzer : public DefaultedComparisonVisitor<DefaultedComparisonAnalyzer, DefaultedComparisonInfo, DefaultedComparisonInfo, DefaultedComparisonSubobject> {\n Result visitBinaryOperator(OverloadedOperatorKind OO, ArrayRef<Expr *> Args, Subobject Subobj, OverloadCandidateSet *SpaceshipCandidates = nullptr) {\n case OR_Success: {\n if (FunctionDecl *BestFD = Best->Function) {\n if (NeedsDeducing) {\n // If any callee has an undeduced return type, deduce it now.\n // FIXME: It\'s not clear how a failure here should be handled. For\n // now, we produce an eager diagnostic, because that is forward\n // compatible with most (all?) other reasonable options.\n if (BestFD->getReturnType()->isUndeducedType() && S.DeduceReturnType(BestFD, FD->getLocation(),\n // Don\'t produce a duplicate error when asked to explain why the\n // comparison is deleted: we diagnosed that when initially checking\n // the defaulted operator.\n if (Diagnose == NoDiagnostics) {\n S.Diag(BestFD->getLocation(), diag::note_defaulted_comparison_cannot_deduce_callee) << Subobj.Kind << Subobj.Decl;"},{q,8166,"/// A visitor over the notional body of a defaulted comparison that determines\n/// whether that body would be deleted or constexpr.\nclass DefaultedComparisonAnalyzer : public DefaultedComparisonVisitor<DefaultedComparisonAnalyzer, DefaultedComparisonInfo, DefaultedComparisonInfo, DefaultedComparisonSubobject> {\n Result visitBinaryOperator(OverloadedOperatorKind OO, ArrayRef<Expr *> Args, Subobject Subobj, OverloadCandidateSet *SpaceshipCandidates = nullptr) {\n case OR_Success: {\n if (FunctionDecl *BestFD = Best->Function) {\n if (NeedsDeducing) {\n if (!Info) {\n if (Diagnose == ExplainDeleted) {\n S.Diag(BestFD->getLocation(), diag::note_defaulted_comparison_cannot_deduce_callee) << Subobj.Kind << Subobj.Decl;"}} | ||
}, | }, | ||
["note_defaulted_comparison_cannot_deduce_undeduced_auto"]={ | ["note_defaulted_comparison_cannot_deduce_undeduced_auto"]={ | ||
Line 3,409: | Line 3,409: | ||
[c]=o, | [c]=o, | ||
[m]={"1228d42ddab8",1576809732,"[OpenMP][Part 2] Use reusable OpenMP context/traits handling"}, | [m]={"1228d42ddab8",1576809732,"[OpenMP][Part 2] Use reusable OpenMP context/traits handling"}, | ||
[n]={{q, | [n]={{q,8150,"/// A visitor over the notional body of a defaulted comparison that determines\n/// whether that body would be deleted or constexpr.\nclass DefaultedComparisonAnalyzer : public DefaultedComparisonVisitor<DefaultedComparisonAnalyzer, DefaultedComparisonInfo, DefaultedComparisonInfo, DefaultedComparisonSubobject> {\n Result visitBinaryOperator(OverloadedOperatorKind OO, ArrayRef<Expr *> Args, Subobject Subobj, OverloadCandidateSet *SpaceshipCandidates = nullptr) {\n case OR_Success: {\n if (FunctionDecl *BestFD = Best->Function) {\n if (NeedsDeducing) {\n // If any callee has an undeduced return type, deduce it now.\n // FIXME: It\'s not clear how a failure here should be handled. For\n // now, we produce an eager diagnostic, because that is forward\n // compatible with most (all?) other reasonable options.\n if (BestFD->getReturnType()->isUndeducedType() && S.DeduceReturnType(BestFD, FD->getLocation(),\n // Don\'t produce a duplicate error when asked to explain why the\n // comparison is deleted: we diagnosed that when initially checking\n // the defaulted operator.\n if (Diagnose == NoDiagnostics) {\n S.Diag(Subobj.Loc, diag::note_defaulted_comparison_cannot_deduce_undeduced_auto) << Subobj.Kind << Subobj.Decl;"}} | ||
}, | }, | ||
["note_defaulted_comparison_inaccessible"]={ | ["note_defaulted_comparison_inaccessible"]={ | ||
Line 3,421: | Line 3,421: | ||
[c]=o, | [c]=o, | ||
[m]={"fe17b30a7957",1575504770,"[attributes][analyzer] Add annotations for handles."}, | [m]={"fe17b30a7957",1575504770,"[attributes][analyzer] Add annotations for handles."}, | ||
[n]={{q, | [n]={{q,8105,"/// A visitor over the notional body of a defaulted comparison that determines\n/// whether that body would be deleted or constexpr.\nclass DefaultedComparisonAnalyzer : public DefaultedComparisonVisitor<DefaultedComparisonAnalyzer, DefaultedComparisonInfo, DefaultedComparisonInfo, DefaultedComparisonSubobject> {\n Result visitBinaryOperator(OverloadedOperatorKind OO, ArrayRef<Expr *> Args, Subobject Subobj, OverloadCandidateSet *SpaceshipCandidates = nullptr) {\n case OR_Success: {\n if (ArgClass && Best->FoundDecl.getDecl() && Best->FoundDecl.getDecl()->isCXXClassMember()) {\n if (!S.isMemberAccessibleForDeletion(ArgClass, Best->FoundDecl, ObjectType, Subobj.Loc, Diagnose == ExplainDeleted ? S.PDiag(diag::note_defaulted_comparison_inaccessible) << FD << Subobj.Kind << Subobj.Decl : S.PDiag()))"}} | ||
}, | }, | ||
["note_defaulted_comparison_no_viable_function"]={ | ["note_defaulted_comparison_no_viable_function"]={ | ||
Line 3,433: | Line 3,433: | ||
[c]=o, | [c]=o, | ||
[m]={jb,1573070592,gb}, | [m]={jb,1573070592,gb}, | ||
[n]={{q, | [n]={{q,8239,"/// A visitor over the notional body of a defaulted comparison that determines\n/// whether that body would be deleted or constexpr.\nclass DefaultedComparisonAnalyzer : public DefaultedComparisonVisitor<DefaultedComparisonAnalyzer, DefaultedComparisonInfo, DefaultedComparisonInfo, DefaultedComparisonSubobject> {\n Result visitBinaryOperator(OverloadedOperatorKind OO, ArrayRef<Expr *> Args, Subobject Subobj, OverloadCandidateSet *SpaceshipCandidates = nullptr) {\n case OR_No_Viable_Function:\n if (Diagnose == ExplainDeleted) {\n S.Diag(Subobj.Loc, diag::note_defaulted_comparison_no_viable_function) << FD << (OO == OO_EqualEqual || OO == OO_ExclaimEqual) << Subobj.Kind << Subobj.Decl;"}} | ||
}, | }, | ||
["note_defaulted_comparison_no_viable_function_synthesized"]={ | ["note_defaulted_comparison_no_viable_function_synthesized"]={ | ||
Line 3,445: | Line 3,445: | ||
[c]=o, | [c]=o, | ||
[m]={jb,1573070592,gb}, | [m]={jb,1573070592,gb}, | ||
[n]={{q, | [n]={{q,8251,"/// A visitor over the notional body of a defaulted comparison that determines\n/// whether that body would be deleted or constexpr.\nclass DefaultedComparisonAnalyzer : public DefaultedComparisonVisitor<DefaultedComparisonAnalyzer, DefaultedComparisonInfo, DefaultedComparisonInfo, DefaultedComparisonSubobject> {\n Result visitBinaryOperator(OverloadedOperatorKind OO, ArrayRef<Expr *> Args, Subobject Subobj, OverloadCandidateSet *SpaceshipCandidates = nullptr) {\n case OR_No_Viable_Function:\n if (Diagnose == ExplainDeleted) {\n // For a three-way comparison, list both the candidates for the\n // original operator and the candidates for the synthesized operator.\n if (SpaceshipCandidates) {\n S.Diag(Subobj.Loc, diag::note_defaulted_comparison_no_viable_function_synthesized) << (OO == OO_EqualEqual ? 0 : 1);"}} | ||
}, | }, | ||
["note_defaulted_comparison_not_constexpr"]={ | ["note_defaulted_comparison_not_constexpr"]={ | ||
Line 3,457: | Line 3,457: | ||
[c]=o, | [c]=o, | ||
[m]={jb,1573070592,gb}, | [m]={jb,1573070592,gb}, | ||
[n]={{q, | [n]={{q,8123,"/// A visitor over the notional body of a defaulted comparison that determines\n/// whether that body would be deleted or constexpr.\nclass DefaultedComparisonAnalyzer : public DefaultedComparisonVisitor<DefaultedComparisonAnalyzer, DefaultedComparisonInfo, DefaultedComparisonInfo, DefaultedComparisonSubobject> {\n Result visitBinaryOperator(OverloadedOperatorKind OO, ArrayRef<Expr *> Args, Subobject Subobj, OverloadCandidateSet *SpaceshipCandidates = nullptr) {\n case OR_Success: {\n if (FunctionDecl *BestFD = Best->Function) {\n // If it\'s not constexpr, explain why not.\n if (Diagnose == ExplainConstexpr && !BestFD->isConstexpr()) {\n if (Subobj.Kind != Subobject::CompleteObject)\n S.Diag(Subobj.Loc, diag::note_defaulted_comparison_not_constexpr) << Subobj.Kind << Subobj.Decl;"}} | ||
}, | }, | ||
["note_defaulted_comparison_not_constexpr_here"]={ | ["note_defaulted_comparison_not_constexpr_here"]={ | ||
Line 3,469: | Line 3,469: | ||
[c]=o, | [c]=o, | ||
[m]={jb,1573070592,gb}, | [m]={jb,1573070592,gb}, | ||
[n]={{q, | [n]={{q,8126,"/// A visitor over the notional body of a defaulted comparison that determines\n/// whether that body would be deleted or constexpr.\nclass DefaultedComparisonAnalyzer : public DefaultedComparisonVisitor<DefaultedComparisonAnalyzer, DefaultedComparisonInfo, DefaultedComparisonInfo, DefaultedComparisonSubobject> {\n Result visitBinaryOperator(OverloadedOperatorKind OO, ArrayRef<Expr *> Args, Subobject Subobj, OverloadCandidateSet *SpaceshipCandidates = nullptr) {\n case OR_Success: {\n if (FunctionDecl *BestFD = Best->Function) {\n // If it\'s not constexpr, explain why not.\n if (Diagnose == ExplainConstexpr && !BestFD->isConstexpr()) {\n S.Diag(BestFD->getLocation(), diag::note_defaulted_comparison_not_constexpr_here);"}} | ||
}, | }, | ||
["note_defaulted_comparison_not_rewritten_callee"]={ | ["note_defaulted_comparison_not_rewritten_callee"]={ | ||
Line 3,481: | Line 3,481: | ||
[c]=o, | [c]=o, | ||
[m]={jb,1573070592,gb}, | [m]={jb,1573070592,gb}, | ||
[n]={{q, | [n]={{q,8072,"/// A visitor over the notional body of a defaulted comparison that determines\n/// whether that body would be deleted or constexpr.\nclass DefaultedComparisonAnalyzer : public DefaultedComparisonVisitor<DefaultedComparisonAnalyzer, DefaultedComparisonInfo, DefaultedComparisonInfo, DefaultedComparisonSubobject> {\n Result visitBinaryOperator(OverloadedOperatorKind OO, ArrayRef<Expr *> Args, Subobject Subobj, OverloadCandidateSet *SpaceshipCandidates = nullptr) {\n case OR_Success: {\n // C++2a [class.compare.secondary]p2 [P2002R0]:\n // The operator function [...] is defined as deleted if [...] the\n // candidate selected by overload resolution is not a rewritten\n // candidate.\n if ((DCK == DefaultedComparisonKind::NotEqual || DCK == DefaultedComparisonKind::Relational) && !Best->RewriteKind) {\n if (Diagnose == ExplainDeleted) {\n if (Best->Function) {\n S.Diag(Best->Function->getLocation(), diag::note_defaulted_comparison_not_rewritten_callee) << FD;"},{q,8213,"/// A visitor over the notional body of a defaulted comparison that determines\n/// whether that body would be deleted or constexpr.\nclass DefaultedComparisonAnalyzer : public DefaultedComparisonVisitor<DefaultedComparisonAnalyzer, DefaultedComparisonInfo, DefaultedComparisonInfo, DefaultedComparisonSubobject> {\n Result visitBinaryOperator(OverloadedOperatorKind OO, ArrayRef<Expr *> Args, Subobject Subobj, OverloadCandidateSet *SpaceshipCandidates = nullptr) {\n case OR_Deleted:\n if (Diagnose == ExplainDeleted) {\n if ((DCK == DefaultedComparisonKind::NotEqual || DCK == DefaultedComparisonKind::Relational) && !Best->RewriteKind) {\n S.Diag(Best->Function->getLocation(), diag::note_defaulted_comparison_not_rewritten_callee) << FD;"}} | ||
}, | }, | ||
["note_defaulted_comparison_not_rewritten_conversion"]={ | ["note_defaulted_comparison_not_rewritten_conversion"]={ | ||
Line 3,493: | Line 3,493: | ||
[c]=o, | [c]=o, | ||
[m]={Pb,1615397021,Ob}, | [m]={Pb,1615397021,Ob}, | ||
[n]={{q, | [n]={{q,8082,"/// A visitor over the notional body of a defaulted comparison that determines\n/// whether that body would be deleted or constexpr.\nclass DefaultedComparisonAnalyzer : public DefaultedComparisonVisitor<DefaultedComparisonAnalyzer, DefaultedComparisonInfo, DefaultedComparisonInfo, DefaultedComparisonSubobject> {\n Result visitBinaryOperator(OverloadedOperatorKind OO, ArrayRef<Expr *> Args, Subobject Subobj, OverloadCandidateSet *SpaceshipCandidates = nullptr) {\n case OR_Success: {\n // C++2a [class.compare.secondary]p2 [P2002R0]:\n // The operator function [...] is defined as deleted if [...] the\n // candidate selected by overload resolution is not a rewritten\n // candidate.\n if ((DCK == DefaultedComparisonKind::NotEqual || DCK == DefaultedComparisonKind::Relational) && !Best->RewriteKind) {\n if (Diagnose == ExplainDeleted) {\n if (Best->Function) {\n } else {\n S.Diag(Best->Conversions[0].UserDefined.FoundConversionFunction.getDecl()->getLocation(), diag::note_defaulted_comparison_not_rewritten_conversion) << FD;"}} | ||
}, | }, | ||
["note_defaulted_comparison_reference_member"]={ | ["note_defaulted_comparison_reference_member"]={ | ||
Line 3,505: | Line 3,505: | ||
[c]=o, | [c]=o, | ||
[m]={jb,1573070592,gb}, | [m]={jb,1573070592,gb}, | ||
[n]={{q, | [n]={{q,8015,"/// A visitor over the notional body of a defaulted comparison that determines\n/// whether that body would be deleted or constexpr.\nclass DefaultedComparisonAnalyzer : public DefaultedComparisonVisitor<DefaultedComparisonAnalyzer, DefaultedComparisonInfo, DefaultedComparisonInfo, DefaultedComparisonSubobject> {\n Result visitExpandedSubobject(QualType Type, Subobject Subobj) {\n // C++2a [class.compare.default]p2 [P2002R0]:\n // A defaulted <=> or == operator function for class C is defined as\n // deleted if any non-static data member of C is of reference type\n if (Type->isReferenceType()) {\n if (Diagnose == ExplainDeleted) {\n S.Diag(Subobj.Loc, diag::note_defaulted_comparison_reference_member) << FD << RD;"}} | ||
}, | }, | ||
["note_defaulted_comparison_union"]={ | ["note_defaulted_comparison_union"]={ | ||
Line 3,517: | Line 3,517: | ||
[c]=o, | [c]=o, | ||
[m]={jb,1573070592,gb}, | [m]={jb,1573070592,gb}, | ||
[n]={{q, | [n]={{q,7986,"/// A visitor over the notional body of a defaulted comparison that determines\n/// whether that body would be deleted or constexpr.\nclass DefaultedComparisonAnalyzer : public DefaultedComparisonVisitor<DefaultedComparisonAnalyzer, DefaultedComparisonInfo, DefaultedComparisonInfo, DefaultedComparisonSubobject> {\n Result visit() {\n if ((DCK == DefaultedComparisonKind::Equal || DCK == DefaultedComparisonKind::ThreeWay) && RD->hasVariantMembers()) {\n // C++2a [class.compare.default]p2 [P2002R0]:\n // A defaulted comparison operator function for class C is defined as\n // deleted if [...] C has variant members.\n if (Diagnose == ExplainDeleted) {\n S.Diag(FD->getLocation(), diag::note_defaulted_comparison_union) << FD << RD->isUnion() << RD;"}} | ||
}, | }, | ||
["note_defined_here"]={ | ["note_defined_here"]={ | ||
Line 3,529: | Line 3,529: | ||
[c]=o, | [c]=o, | ||
[m]={"74f7d50f6a5b",1329334432,"When overload resolution picks an implicitly-deleted special member"}, | [m]={"74f7d50f6a5b",1329334432,"When overload resolution picks an implicitly-deleted special member"}, | ||
[n]={{"clang/lib/Sema/Sema.cpp", | [n]={{"clang/lib/Sema/Sema.cpp",2006,"void Sema::checkTypeSupport(QualType Ty, SourceLocation Loc, ValueDecl *D) {\n auto CheckDeviceType = [&](QualType Ty) {\n if ((Ty->isFloat16Type() && !Context.getTargetInfo().hasFloat16Type()) || (Ty->isFloat128Type() && !Context.getTargetInfo().hasFloat128Type()) || (Ty->isIbm128Type() && !Context.getTargetInfo().hasIbm128Type()) || (Ty->isIntegerType() && Context.getTypeSize(Ty) == 128 && !Context.getTargetInfo().hasInt128Type()) || (Ty->isBFloat16Type() && !Context.getTargetInfo().hasBFloat16Type() && !LangOpts.CUDAIsDevice) || LongDoubleMismatched) {\n if (D)\n targetDiag(D->getLocation(), diag::note_defined_here, FD) << D;"},{"clang/lib/Sema/Sema.cpp",2032,"void Sema::checkTypeSupport(QualType Ty, SourceLocation Loc, ValueDecl *D) {\n auto CheckType = [&](QualType Ty, bool IsRetTy = false) {\n if (!TI.hasLongDoubleType() && UnqualTy == Context.LongDoubleTy) {\n if (D)\n targetDiag(D->getLocation(), diag::note_defined_here, FD) << D;"},{"clang/lib/Sema/Sema.cpp",2051,"void Sema::checkTypeSupport(QualType Ty, SourceLocation Loc, ValueDecl *D) {\n auto CheckType = [&](QualType Ty, bool IsRetTy = false) {\n if (IsRetTy && !TI.hasFPReturn() && (IsDouble || IsFloat)) {\n if (D)\n targetDiag(D->getLocation(), diag::note_defined_here, FD) << D;"},{L,1700,"bool CoroutineStmtBuilder::makeOnException() {\n if (!lookupMember(S, \"unhandled_exception\", PromiseRecordDecl, Loc)) {\n S.Diag(PromiseRecordDecl->getLocation(), diag::note_defined_here) << PromiseRecordDecl;"},{t,4783,"void Sema::notePreviousDefinition(const NamedDecl *Old, SourceLocation New) {\n auto noteFromModuleOrInclude = [&](Module *Mod, SourceLocation IncLoc) -> bool {\n // Redefinition errors with modules are common with non modular mapped\n // headers, example: a non-modular header H in module A that also gets\n // included directly in a TU. Pointing twice to the same header/definition\n // is confusing, try to get better diagnostics when modules is on.\n if (IncLoc.isValid()) {\n if (Mod) {\n if (!Mod->DefinitionLoc.isInvalid())\n Diag(Mod->DefinitionLoc, diag::note_defined_here) << Mod->getFullModuleName();"},{I,4645,"bool Sema::checkMSInheritanceAttrOnDefinition(CXXRecordDecl *RD, SourceRange Range, bool BestCase, MSInheritanceModel ExplicitModel) {\n Diag(RD->getDefinition()->getLocation(), diag::note_defined_here) << RD;"},{q,2453,"bool Sema::CheckImmediateEscalatingFunctionDefinition(FunctionDecl *FD, const sema::FunctionScopeInfo *FSI) {\n if (FSI->FoundImmediateEscalatingExpression) {\n if (it != UndefinedButUsed.end()) {\n Diag(FD->getLocation(), diag::note_defined_here) << FD;"},{E,3135,"Sema::DeclGroupPtrTy Sema::ActOnForwardClassDeclaration(SourceLocation AtClassLoc, IdentifierInfo **IdentList, SourceLocation *IdentLocs, ArrayRef<ObjCTypeParamList *> TypeParamLists, unsigned NumElts) {\n for (unsigned i = 0; i != NumElts; ++i) {\n if (PrevIDecl && TypeParams) {\n if (ObjCTypeParamList *PrevTypeParams = PrevIDecl->getTypeParamList()) {\n } else if (ObjCInterfaceDecl *Def = PrevIDecl->getDefinition()) {\n Diag(Def->getLocation(), diag::note_defined_here) << ClassName;"},{C,1720,"static bool rejectConstNotMutableType(Sema &SemaRef, const ValueDecl *D, QualType Type, OpenMPClauseKind CKind, SourceLocation ELoc, bool AcceptIfMutable = true, bool ListItemNotVar = false) {\n if (isConstNotMutableType(SemaRef, Type, AcceptIfMutable, &IsClassType)) {\n if (!ListItemNotVar && D) {\n SemaRef.Diag(D->getLocation(), IsDecl ? diag::note_previous_decl : diag::note_defined_here) << D;"},{C,3073,"ExprResult Sema::ActOnOpenMPIdExpression(Scope *CurScope, CXXScopeSpec &ScopeSpec, const DeclarationNameInfo &Id, OpenMPDirectiveKind Kind) {\n // OpenMP [2.9.2, Syntax, C/C++]\n // Variables must be file-scope, namespace-scope, or static block-scope.\n if (Kind == OMPD_threadprivate && !VD->hasGlobalStorage()) {\n Diag(VD->getLocation(), IsDecl ? diag::note_previous_decl : diag::note_defined_here) << VD;"},{C,3090,"ExprResult Sema::ActOnOpenMPIdExpression(Scope *CurScope, CXXScopeSpec &ScopeSpec, const DeclarationNameInfo &Id, OpenMPDirectiveKind Kind) {\n // OpenMP [2.9.2, Restrictions, C/C++, p.2]\n // A threadprivate directive for file-scope variables must appear outside\n // any definition or declaration.\n if (CanonicalVD->getDeclContext()->isTranslationUnit() && !getCurLexicalContext()->isTranslationUnit()) {\n Diag(VD->getLocation(), IsDecl ? diag::note_previous_decl : diag::note_defined_here) << VD;"},{C,3105,"ExprResult Sema::ActOnOpenMPIdExpression(Scope *CurScope, CXXScopeSpec &ScopeSpec, const DeclarationNameInfo &Id, OpenMPDirectiveKind Kind) {\n // OpenMP [2.9.2, Restrictions, C/C++, p.3]\n // A threadprivate directive for static class member variables must appear\n // in the class definition, in the same scope in which the member\n // variables are declared.\n if (CanonicalVD->isStaticDataMember() && !CanonicalVD->getDeclContext()->Equals(getCurLexicalContext())) {\n Diag(VD->getLocation(), IsDecl ? diag::note_previous_decl : diag::note_defined_here) << VD;"},{C,3121,"ExprResult Sema::ActOnOpenMPIdExpression(Scope *CurScope, CXXScopeSpec &ScopeSpec, const DeclarationNameInfo &Id, OpenMPDirectiveKind Kind) {\n // OpenMP [2.9.2, Restrictions, C/C++, p.4]\n // A threadprivate directive for namespace-scope variables must appear\n // outside any definition or declaration other than the namespace\n // definition itself.\n if (CanonicalVD->getDeclContext()->isNamespace() && (!getCurLexicalContext()->isFileContext() || !getCurLexicalContext()->Encloses(CanonicalVD->getDeclContext()))) {\n Diag(VD->getLocation(), IsDecl ? diag::note_previous_decl : diag::note_defined_here) << VD;"},{C,3135,"ExprResult Sema::ActOnOpenMPIdExpression(Scope *CurScope, CXXScopeSpec &ScopeSpec, const DeclarationNameInfo &Id, OpenMPDirectiveKind Kind) {\n // OpenMP [2.9.2, Restrictions, C/C++, p.6]\n // A threadprivate directive for static block-scope variables must appear\n // in the scope of the variable and not in a nested scope.\n if (CanonicalVD->isLocalVarDecl() && CurScope && !isDeclInScope(ND, getCurLexicalContext(), CurScope)) {\n Diag(VD->getLocation(), IsDecl ? diag::note_previous_decl : diag::note_defined_here) << VD;"},{C,3179,"class LocalVarRefChecker final : public ConstStmtVisitor<LocalVarRefChecker, bool> {\n bool VisitDeclRefExpr(const DeclRefExpr *E) {\n if (const auto *VD = dyn_cast<VarDecl>(E->getDecl())) {\n if (VD->hasLocalStorage()) {\n SemaRef.Diag(VD->getLocation(), diag::note_defined_here) << VD << VD->getSourceRange();"},{C,3231,"OMPThreadPrivateDecl *Sema::CheckOMPThreadPrivateDecl(SourceLocation Loc, ArrayRef<Expr *> VarList) {\n for (Expr *RefExpr : VarList) {\n // OpenMP [2.9.2, Restrictions, C/C++, p.10]\n // A threadprivate variable must not have a reference type.\n if (VD->getType()->isReferenceType()) {\n Diag(VD->getLocation(), IsDecl ? diag::note_previous_decl : diag::note_defined_here) << VD;"},{C,3249,"OMPThreadPrivateDecl *Sema::CheckOMPThreadPrivateDecl(SourceLocation Loc, ArrayRef<Expr *> VarList) {\n for (Expr *RefExpr : VarList) {\n // Check if this is a TLS variable. If TLS is not being supported, produce\n // the corresponding diagnostic.\n if ((VD->getTLSKind() != VarDecl::TLS_None && !(VD->hasAttr<OMPThreadPrivateDeclAttr>() && getLangOpts().OpenMPUseTLS && getASTContext().getTargetInfo().isTLSSupported())) || (VD->getStorageClass() == SC_Register && VD->hasAttr<AsmLabelAttr>() && !VD->isLocalVarDecl())) {\n Diag(VD->getLocation(), IsDecl ? diag::note_previous_decl : diag::note_defined_here) << VD;"},{C,3434,"Sema::DeclGroupPtrTy Sema::ActOnOpenMPAllocateDirective(SourceLocation Loc, ArrayRef<Expr *> VarList, ArrayRef<OMPClause *> Clauses, DeclContext *Owner) {\n for (Expr *RefExpr : VarList) {\n // OpenMP, 2.11.3 allocate Directive, Restrictions, C / C++\n // If a list item has a static storage type, the allocator expression in the\n // allocator clause must be a constant expression that evaluates to one of\n // the predefined memory allocator values.\n if (Allocator && VD->hasGlobalStorage()) {\n if (AllocatorKind == OMPAllocateDeclAttr::OMPUserDefinedMemAlloc) {\n Diag(VD->getLocation(), IsDecl ? diag::note_previous_decl : diag::note_defined_here) << VD;"},{C,18117,"OMPClause *Sema::ActOnOpenMPPrivateClause(ArrayRef<Expr *> VarList, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc) {\n for (Expr *RefExpr : VarList) {\n // Variably modified types are not supported for tasks.\n if (!Type->isAnyPointerType() && Type->isVariablyModifiedType() && isOpenMPTaskingDirective(CurrDir)) {\n Diag(D->getLocation(), IsDecl ? diag::note_previous_decl : diag::note_defined_here) << D;"},{C,18390,"OMPClause *Sema::ActOnOpenMPFirstprivateClause(ArrayRef<Expr *> VarList, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc) {\n for (Expr *RefExpr : VarList) {\n // Variably modified types are not supported for tasks.\n if (!Type->isAnyPointerType() && Type->isVariablyModifiedType() && isOpenMPTaskingDirective(DSAStack->getCurrentDirective())) {\n Diag(D->getLocation(), IsDecl ? diag::note_previous_decl : diag::note_defined_here) << D;"},{C,18547,"OMPClause *Sema::ActOnOpenMPLastprivateClause(ArrayRef<Expr *> VarList, OpenMPLastprivateModifier LPKind, SourceLocation LPKindLoc, SourceLocation ColonLoc, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc) {\n for (Expr *RefExpr : VarList) {\n // OpenMP 5.0 [2.19.4.5 lastprivate Clause, Restrictions]\n // A list item that appears in a lastprivate clause with the conditional\n // modifier must be a scalar variable.\n if (LPKind == OMPC_LASTPRIVATE_conditional && !Type->isScalarType()) {\n Diag(D->getLocation(), IsDecl ? diag::note_previous_decl : diag::note_defined_here) << D;"},{C,19346,"static bool actOnOMPReductionKindClause(Sema &S, DSAStackTy *Stack, OpenMPClauseKind ClauseKind, ArrayRef<Expr *> VarList, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation ColonLoc, SourceLocation EndLoc, CXXScopeSpec &ReductionIdScopeSpec, const DeclarationNameInfo &ReductionId, ArrayRef<Expr *> UnresolvedReductions, ReductionData &RD) {\n for (Expr *RefExpr : VarList) {\n // OpenMP [2.9.3.6, Restrictions, C/C++, p.4]\n // If a list-item is a reference type then it must bind to the same object\n // for all threads of the team.\n if (!ASE && !OASE) {\n if (VD) {\n if (VD->getType()->isReferenceType() && VDDef && VDDef->hasInit()) {\n if (Check.Visit(VDDef->getInit())) {\n S.Diag(VDDef->getLocation(), diag::note_defined_here) << VDDef;"},{C,19453,"static bool actOnOMPReductionKindClause(Sema &S, DSAStackTy *Stack, OpenMPClauseKind ClauseKind, ArrayRef<Expr *> VarList, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation ColonLoc, SourceLocation EndLoc, CXXScopeSpec &ReductionIdScopeSpec, const DeclarationNameInfo &ReductionId, ArrayRef<Expr *> UnresolvedReductions, ReductionData &RD) {\n for (Expr *RefExpr : VarList) {\n // OpenMP [2.14.3.6, reduction clause, Restrictions]\n // The type of a list item that appears in a reduction clause must be valid\n // for the reduction-identifier. For a max or min reduction in C, the type\n // of the list item must be an allowed arithmetic data type: char, int,\n // float, double, or _Bool, possibly modified with long, short, signed, or\n // unsigned. For a max or min reduction in C++, the type of the list item\n // must be an allowed arithmetic data type: char, wchar_t, int, float,\n // double, or bool, possibly modified with long, short, signed, or unsigned.\n if (DeclareReductionRef.isUnset()) {\n if ((BOK == BO_GT || BOK == BO_LT) && !(Type->isScalarType() || (S.getLangOpts().CPlusPlus && Type->isArithmeticType()))) {\n if (!ASE && !OASE) {\n S.Diag(D->getLocation(), IsDecl ? diag::note_previous_decl : diag::note_defined_here) << D;"},{C,19466,"static bool actOnOMPReductionKindClause(Sema &S, DSAStackTy *Stack, OpenMPClauseKind ClauseKind, ArrayRef<Expr *> VarList, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation ColonLoc, SourceLocation EndLoc, CXXScopeSpec &ReductionIdScopeSpec, const DeclarationNameInfo &ReductionId, ArrayRef<Expr *> UnresolvedReductions, ReductionData &RD) {\n for (Expr *RefExpr : VarList) {\n // OpenMP [2.14.3.6, reduction clause, Restrictions]\n // The type of a list item that appears in a reduction clause must be valid\n // for the reduction-identifier. For a max or min reduction in C, the type\n // of the list item must be an allowed arithmetic data type: char, int,\n // float, double, or _Bool, possibly modified with long, short, signed, or\n // unsigned. For a max or min reduction in C++, the type of the list item\n // must be an allowed arithmetic data type: char, wchar_t, int, float,\n // double, or bool, possibly modified with long, short, signed, or unsigned.\n if (DeclareReductionRef.isUnset()) {\n if ((BOK == BO_OrAssign || BOK == BO_AndAssign || BOK == BO_XorAssign) && !S.getLangOpts().CPlusPlus && Type->isFloatingType()) {\n if (!ASE && !OASE) {\n S.Diag(D->getLocation(), IsDecl ? diag::note_previous_decl : diag::note_defined_here) << D;"},{C,19664,"static bool actOnOMPReductionKindClause(Sema &S, DSAStackTy *Stack, OpenMPClauseKind ClauseKind, ArrayRef<Expr *> VarList, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation ColonLoc, SourceLocation EndLoc, CXXScopeSpec &ReductionIdScopeSpec, const DeclarationNameInfo &ReductionId, ArrayRef<Expr *> UnresolvedReductions, ReductionData &RD) {\n for (Expr *RefExpr : VarList) {\n if (!RHSVD->hasInit() && DeclareReductionRef.isUnset()) {\n S.Diag(D->getLocation(), IsDecl ? diag::note_previous_decl : diag::note_defined_here) << D;"},{C,20012,"bool Sema::CheckOpenMPLinearDecl(const ValueDecl *D, SourceLocation ELoc, OpenMPLinearClauseKind LinKind, QualType Type, bool IsDeclareSimd) {\n if (!Ty || (LinKind != OMPC_LINEAR_ref && !Ty->isDependentType() && !Ty->isIntegralType(Context) && !Ty->isPointerType())) {\n if (D) {\n Diag(D->getLocation(), IsDecl ? diag::note_previous_decl : diag::note_defined_here) << D;"},{C,20289,"OMPClause *Sema::ActOnOpenMPAlignedClause(ArrayRef<Expr *> VarList, Expr *Alignment, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation ColonLoc, SourceLocation EndLoc) {\n for (Expr *RefExpr : VarList) {\n if (!Ty || (!Ty->isArrayType() && !Ty->isPointerType())) {\n Diag(D->getLocation(), IsDecl ? diag::note_previous_decl : diag::note_defined_here) << D;"},{C,20491,"OMPClause *Sema::ActOnOpenMPCopyprivateClause(ArrayRef<Expr *> VarList, SourceLocation StartLoc, SourceLocation LParenLoc, SourceLocation EndLoc) {\n for (Expr *RefExpr : VarList) {\n // Variably modified types are not supported.\n if (!Type->isAnyPointerType() && Type->isVariablyModifiedType()) {\n Diag(D->getLocation(), IsDecl ? diag::note_previous_decl : diag::note_defined_here) << D;"},{C,23171,"void Sema::checkDeclIsAllowedInOpenMPTarget(Expr *E, Decl *D, SourceLocation IdLoc) {\n if (auto *FD = dyn_cast<FunctionDecl>(D)) {\n if (IdLoc.isValid() && Res && *Res == OMPDeclareTargetDeclAttr::MT_Link) {\n Diag(FD->getLocation(), diag::note_defined_here) << FD;"}} | ||
}, | }, | ||
["note_delete_conversion"]={ | ["note_delete_conversion"]={ | ||
Line 3,541: | Line 3,541: | ||
[c]=o, | [c]=o, | ||
[m]={"ccc11811052d",1369163148,"Refactor places which perform contextual implicit conversions to go through a"}, | [m]={"ccc11811052d",1369163148,"Refactor places which perform contextual implicit conversions to go through a"}, | ||
[n]={{K, | [n]={{K,3640,"/// ActOnCXXDelete - Parsed a C++ \'delete\' expression (C++ 5.3.5), as in:\n/// @code ::delete ptr; @endcode\n/// or\n/// @code delete [] ptr; @endcode\nExprResult Sema::ActOnCXXDelete(SourceLocation StartLoc, bool UseGlobal, bool ArrayForm, Expr *ExE) {\n if (!Ex.get()->isTypeDependent()) {\n class DeleteConverter : public ContextualImplicitConverter {\n SemaDiagnosticBuilder noteExplicitConv(Sema &S, CXXConversionDecl *Conv, QualType ConvTy) override { return S.Diag(Conv->getLocation(), diag::note_delete_conversion) << ConvTy; }"},{K,3651,"/// ActOnCXXDelete - Parsed a C++ \'delete\' expression (C++ 5.3.5), as in:\n/// @code ::delete ptr; @endcode\n/// or\n/// @code delete [] ptr; @endcode\nExprResult Sema::ActOnCXXDelete(SourceLocation StartLoc, bool UseGlobal, bool ArrayForm, Expr *ExE) {\n if (!Ex.get()->isTypeDependent()) {\n class DeleteConverter : public ContextualImplicitConverter {\n SemaDiagnosticBuilder noteAmbiguous(Sema &S, CXXConversionDecl *Conv, QualType ConvTy) override { return S.Diag(Conv->getLocation(), diag::note_delete_conversion) << ConvTy; }"}} | ||
}, | }, | ||
["note_delete_non_virtual"]={ | ["note_delete_non_virtual"]={ | ||
Line 3,553: | Line 3,553: | ||
[c]=o, | [c]=o, | ||
[m]={"5a9259caa9b7",1452894331,"Make -Wdelete-non-virtual-dtor warn on explicit `a->~A()` dtor calls too."}, | [m]={"5a9259caa9b7",1452894331,"Make -Wdelete-non-virtual-dtor warn on explicit `a->~A()` dtor calls too."}, | ||
[n]={{K, | [n]={{K,3979,"void Sema::CheckVirtualDtorCall(CXXDestructorDecl *dtor, SourceLocation Loc, bool IsDelete, bool CallCanBeVirtual, bool WarnOnNonAbstractTypes, SourceLocation DtorLoc) {\n if (!IsDelete) {\n Diag(DtorLoc, diag::note_delete_non_virtual) << FixItHint::CreateInsertion(DtorLoc, TypeStr + \"::\");"}} | ||
}, | }, | ||
["note_deleted_assign_field"]={ | ["note_deleted_assign_field"]={ | ||
Line 3,565: | Line 3,565: | ||
[c]=o, | [c]=o, | ||
[m]={Mb,1333140808,Jb}, | [m]={Mb,1333140808,Jb}, | ||
[n]={{q, | [n]={{q,9495,"/// Check whether we should delete a special member function due to the class\n/// having a particular non-static data member.\nbool SpecialMemberDeletionInfo::shouldDeleteForField(FieldDecl *FD) {\n if (CSM == Sema::CXXDefaultConstructor) {\n } else if (CSM == Sema::CXXCopyConstructor) {\n } else if (IsAssignment) {\n // For an assignment operator, data members must not be of reference type.\n if (FieldType->isReferenceType()) {\n if (Diagnose)\n S.Diag(FD->getLocation(), diag::note_deleted_assign_field) << isMove() << MD->getParent() << FD << FieldType << /*Reference*/ 0;"},{q,9503,"/// Check whether we should delete a special member function due to the class\n/// having a particular non-static data member.\nbool SpecialMemberDeletionInfo::shouldDeleteForField(FieldDecl *FD) {\n if (CSM == Sema::CXXDefaultConstructor) {\n } else if (CSM == Sema::CXXCopyConstructor) {\n } else if (IsAssignment) {\n if (!FieldRecord && FieldType.isConstQualified()) {\n // C++11 [class.copy]p23:\n // -- a non-static data member of const non-class type (or array thereof)\n if (Diagnose)\n S.Diag(FD->getLocation(), diag::note_deleted_assign_field) << isMove() << MD->getParent() << FD << FD->getType() << /*Const*/ 1;"}} | ||
}, | }, | ||
["note_deleted_copy_ctor_rvalue_reference"]={ | ["note_deleted_copy_ctor_rvalue_reference"]={ | ||
Line 3,577: | Line 3,577: | ||
[c]=o, | [c]=o, | ||
[m]={Mb,1333140808,Jb}, | [m]={Mb,1333140808,Jb}, | ||
[n]={{q, | [n]={{q,9487,"/// Check whether we should delete a special member function due to the class\n/// having a particular non-static data member.\nbool SpecialMemberDeletionInfo::shouldDeleteForField(FieldDecl *FD) {\n if (CSM == Sema::CXXDefaultConstructor) {\n } else if (CSM == Sema::CXXCopyConstructor) {\n // For a copy constructor, data members must not be of rvalue reference\n // type.\n if (FieldType->isRValueReferenceType()) {\n if (Diagnose)\n S.Diag(FD->getLocation(), diag::note_deleted_copy_ctor_rvalue_reference) << MD->getParent() << FD << FieldType;"}} | ||
}, | }, | ||
["note_deleted_copy_user_declared_move"]={ | ["note_deleted_copy_user_declared_move"]={ | ||
Line 3,589: | Line 3,589: | ||
[c]=o, | [c]=o, | ||
[m]={Mb,1333140808,Jb}, | [m]={Mb,1333140808,Jb}, | ||
[n]={{q, | [n]={{q,9653,"/// Determine whether a defaulted special member function should be defined as\n/// deleted, as specified in C++11 [class.ctor]p5, C++11 [class.copy]p11,\n/// C++11 [class.copy]p23, and C++11 [class.dtor]p5.\nbool Sema::ShouldDeleteSpecialMember(CXXMethodDecl *MD, CXXSpecialMember CSM, InheritedConstructorInfo *ICI, bool Diagnose) {\n // C++11 [class.copy]p7, p18:\n // If the class definition declares a move constructor or move assignment\n // operator, an implicitly declared copy constructor or copy assignment\n // operator is defined as deleted.\n if (MD->isImplicit() && (CSM == CXXCopyConstructor || CSM == CXXCopyAssignment)) {\n if (UserDeclaredMove) {\n Diag(UserDeclaredMove->getLocation(), diag::note_deleted_copy_user_declared_move) << (CSM == CXXCopyAssignment) << RD << UserDeclaredMove->isMoveAssignmentOperator();"}} | ||
}, | }, | ||
["note_deleted_default_ctor_all_const"]={ | ["note_deleted_default_ctor_all_const"]={ | ||
Line 3,601: | Line 3,601: | ||
[c]=o, | [c]=o, | ||
[m]={Mb,1333140808,Jb}, | [m]={Mb,1333140808,Jb}, | ||
[n]={{q, | [n]={{q,9537,"/// Check whether we should delete a special member function due to the class\n/// having a particular non-static data member.\nbool SpecialMemberDeletionInfo::shouldDeleteForField(FieldDecl *FD) {\n if (FieldRecord) {\n // Some additional restrictions exist on the variant members.\n if (!inUnion() && FieldRecord->isUnion() && FieldRecord->isAnonymousStructOrUnion()) {\n // At least one member in each anonymous union must be non-const\n if (CSM == Sema::CXXDefaultConstructor && AllVariantFieldsAreConst && !FieldRecord->field_empty()) {\n if (Diagnose)\n S.Diag(FieldRecord->getLocation(), diag::note_deleted_default_ctor_all_const) << !!ICI << MD->getParent() << /*anonymous union*/ 1;"},{q,9571,"/// C++11 [class.ctor] p5:\n/// A defaulted default constructor for a class X is defined as deleted if\n/// X is a union and all of its variant members are of const-qualified type.\nbool SpecialMemberDeletionInfo::shouldDeleteForAllConstMembers() {\n // This is a silly definition, because it gives an empty union a deleted\n // default constructor. Don\'t do that.\n if (CSM == Sema::CXXDefaultConstructor && inUnion() && AllFieldsAreConst) {\n if (Diagnose)\n S.Diag(MD->getParent()->getLocation(), diag::note_deleted_default_ctor_all_const) << !!ICI << MD->getParent() << /*not anonymous union*/ 0;"}} | ||
}, | }, | ||
["note_deleted_default_ctor_uninit_field"]={ | ["note_deleted_default_ctor_uninit_field"]={ | ||
Line 3,613: | Line 3,613: | ||
[c]=o, | [c]=o, | ||
[m]={Mb,1333140808,Jb}, | [m]={Mb,1333140808,Jb}, | ||
[n]={{q, | [n]={{q,9464,"/// Check whether we should delete a special member function due to the class\n/// having a particular non-static data member.\nbool SpecialMemberDeletionInfo::shouldDeleteForField(FieldDecl *FD) {\n if (CSM == Sema::CXXDefaultConstructor) {\n // For a default constructor, all references must be initialized in-class\n // and, if a union, it must have a non-const member.\n if (FieldType->isReferenceType() && !FD->hasInClassInitializer()) {\n if (Diagnose)\n S.Diag(FD->getLocation(), diag::note_deleted_default_ctor_uninit_field) << !!ICI << MD->getParent() << FD << FieldType << /*Reference*/ 0;"},{q,9475,"/// Check whether we should delete a special member function due to the class\n/// having a particular non-static data member.\nbool SpecialMemberDeletionInfo::shouldDeleteForField(FieldDecl *FD) {\n if (CSM == Sema::CXXDefaultConstructor) {\n // C++11 [class.ctor]p5 (modified by DR2394): any non-variant non-static\n // data member of const-qualified type (or array thereof) with no\n // brace-or-equal-initializer is not const-default-constructible.\n if (!inUnion() && FieldType.isConstQualified() && !FD->hasInClassInitializer() && (!FieldRecord || !FieldRecord->allowConstDefaultInit())) {\n if (Diagnose)\n S.Diag(FD->getLocation(), diag::note_deleted_default_ctor_uninit_field) << !!ICI << MD->getParent() << FD << FD->getType() << /*Const*/ 1;"}} | ||
}, | }, | ||
["note_deleted_dtor_no_operator_delete"]={ | ["note_deleted_dtor_no_operator_delete"]={ | ||
Line 3,625: | Line 3,625: | ||
[c]=o, | [c]=o, | ||
[m]={Mb,1333140808,Jb}, | [m]={Mb,1333140808,Jb}, | ||
[n]={{q, | [n]={{q,9673,"/// Determine whether a defaulted special member function should be defined as\n/// deleted, as specified in C++11 [class.ctor]p5, C++11 [class.copy]p11,\n/// C++11 [class.copy]p23, and C++11 [class.dtor]p5.\nbool Sema::ShouldDeleteSpecialMember(CXXMethodDecl *MD, CXXSpecialMember CSM, InheritedConstructorInfo *ICI, bool Diagnose) {\n // C++11 [class.dtor]p5:\n // -- for a virtual destructor, lookup of the non-array deallocation function\n // results in an ambiguity or in a function that is deleted or inaccessible\n if (CSM == CXXDestructor && MD->isVirtual()) {\n if (FindDeallocationFunction(MD->getLocation(), MD->getParent(), Name, OperatorDelete, /*Diagnose*/ false)) {\n if (Diagnose)\n Diag(RD->getLocation(), diag::note_deleted_dtor_no_operator_delete);"}} | ||
}, | }, | ||
["note_deleted_special_member_class_subobject"]={ | ["note_deleted_special_member_class_subobject"]={ | ||
Line 3,637: | Line 3,637: | ||
[c]=o, | [c]=o, | ||
[m]={Mb,1333140808,Jb}, | [m]={Mb,1333140808,Jb}, | ||
[n]={{q, | [n]={{q,9336,"/// Check whether we should delete a special member due to the implicit\n/// definition containing a call to a special member of a subobject.\nbool SpecialMemberDeletionInfo::shouldDeleteForSubobjectCall(Subobject Subobj, Sema::SpecialMemberOverloadResult SMOR, bool IsDtorCallInCtor) {\n if (Diagnose) {\n if (Field) {\n S.Diag(Field->getLocation(), diag::note_deleted_special_member_class_subobject) << getEffectiveCSM() << MD->getParent() << /*IsField*/ true << Field << DiagKind << IsDtorCallInCtor << /*IsObjCPtr*/ false;"},{q,9342,"/// Check whether we should delete a special member due to the implicit\n/// definition containing a call to a special member of a subobject.\nbool SpecialMemberDeletionInfo::shouldDeleteForSubobjectCall(Subobject Subobj, Sema::SpecialMemberOverloadResult SMOR, bool IsDtorCallInCtor) {\n if (Diagnose) {\n if (Field) {\n } else {\n S.Diag(Base->getBeginLoc(), diag::note_deleted_special_member_class_subobject) << getEffectiveCSM() << MD->getParent() << /*IsField*/ false << Base->getType() << DiagKind << IsDtorCallInCtor << /*IsObjCPtr*/ false;"},{q,9413,"bool SpecialMemberDeletionInfo::shouldDeleteForVariantObjCPtrMember(FieldDecl *FD, QualType FieldType) {\n if (Diagnose) {\n S.Diag(FD->getLocation(), diag::note_deleted_special_member_class_subobject) << getEffectiveCSM() << ParentClass << /*IsField*/ true << FD << 4 << /*IsDtorCallInCtor*/ false << /*IsObjCPtr*/ true;"},{q,9439,"/// Check whether we should delete a special member function due to the class\n/// having a particular direct or virtual base class.\nbool SpecialMemberDeletionInfo::shouldDeleteForBase(CXXBaseSpecifier *Base) {\n if (auto *BaseCtor = SMOR.getMethod()) {\n // Note that we do not check access along this path; other than that,\n // this is the same as shouldDeleteForSubobjectCall(Base, BaseCtor, false);\n // FIXME: Check that the base has a usable destructor! Sink this into\n // shouldDeleteForClassSubobject.\n if (BaseCtor->isDeleted() && Diagnose) {\n S.Diag(Base->getBeginLoc(), diag::note_deleted_special_member_class_subobject) << getEffectiveCSM() << MD->getParent() << /*IsField*/ false << Base->getType() << /*Deleted*/ 1 << /*IsDtorCallInCtor*/ false << /*IsObjCPtr*/ false;"}} | ||
}, | }, | ||
["note_deleted_type_mismatch"]={ | ["note_deleted_type_mismatch"]={ | ||
Line 3,649: | Line 3,649: | ||
[c]=o, | [c]=o, | ||
[m]={"9b2c5e7c44fd",1538097403,"[cxx2a] P0641R2: (Some) type mismatches on defaulted functions only"}, | [m]={"9b2c5e7c44fd",1538097403,"[cxx2a] P0641R2: (Some) type mismatches on defaulted functions only"}, | ||
[n]={{q, | [n]={{q,7774,"bool Sema::CheckExplicitlyDefaultedSpecialMember(CXXMethodDecl *MD, CXXSpecialMember CSM, SourceLocation DefaultLoc) {\n if (ShouldDeleteForTypeMismatch || ShouldDeleteSpecialMember(MD, CSM)) {\n if (First) {\n if (!inTemplateInstantiation() && !HadError) {\n if (ShouldDeleteForTypeMismatch) {\n Diag(MD->getLocation(), diag::note_deleted_type_mismatch) << CSM;"}} | ||
}, | }, | ||
["note_dependent_function_template_spec_discard_reason"]={ | ["note_dependent_function_template_spec_discard_reason"]={ | ||
Line 3,661: | Line 3,661: | ||
[c]=o, | [c]=o, | ||
[m]={"0b75dc5fa2e0",1532032820,"[Sema] Diagnose an invalid dependent function template specialization"}, | [m]={"0b75dc5fa2e0",1532032820,"[Sema] Diagnose an invalid dependent function template specialization"}, | ||
[n]={{u, | [n]={{u,9357,"/// Perform semantic analysis for the given dependent function\n/// template specialization.\n///\n/// The only possible way to get a dependent function template specialization\n/// is with a friend declaration, like so:\n///\n/// \\code\n/// template \\<class T> void foo(T);\n/// template \\<class T> class A {\n/// friend void foo<>(T);\n/// };\n/// \\endcode\n///\n/// There really isn\'t any useful analysis we can do here, so we\n/// just store the information.\nbool Sema::CheckDependentFunctionTemplateSpecialization(FunctionDecl *FD, const TemplateArgumentListInfo &ExplicitTemplateArgs, LookupResult &Previous) {\n if (Previous.empty()) {\n for (auto &P : DiscardedCandidates)\n Diag(P.second->getLocation(), diag::note_dependent_function_template_spec_discard_reason) << P.first;"}} | ||
}, | }, | ||
["note_dependent_member_use"]={ | ["note_dependent_member_use"]={ | ||
Line 3,673: | Line 3,673: | ||
[c]=o, | [c]=o, | ||
[m]={T,1590001902,S}, | [m]={T,1590001902,S}, | ||
[n]={{r, | [n]={{r,2333,"/// Diagnose a lookup that found results in an enclosing class during error\n/// recovery. This usually indicates that the results were found in a dependent\n/// base class that could not be searched as part of a template definition.\n/// Always issues a diagnostic (though this may be only a warning in MS\n/// compatibility mode).\n///\n/// Return \\c true if the error is unrecoverable, or \\c false if the caller\n/// should attempt to recover using these lookup results.\nbool Sema::DiagnoseDependentMemberLookup(const LookupResult &R) {\n if (R.getRepresentativeDecl()->getDeclContext()->Equals(R.getNamingClass())) {\n } else if (getLangOpts().MSVCCompat) {\n NoteID = diag::note_dependent_member_use;"}} | ||
}, | }, | ||
["note_dependent_non_type_default_arg_in_partial_spec"]={ | ["note_dependent_non_type_default_arg_in_partial_spec"]={ | ||
Line 3,685: | Line 3,685: | ||
[c]=o, | [c]=o, | ||
[m]={"6056d5e91886",1391907283,"PR16519, PR18009: When checking a partial specialization for uses of its own"}, | [m]={"6056d5e91886",1391907283,"PR16519, PR18009: When checking a partial specialization for uses of its own"}, | ||
[n]={{u, | [n]={{u,8549,"/// Subroutine of Sema::CheckTemplatePartialSpecializationArgs\n/// that checks non-type template partial specialization arguments.\nstatic bool CheckNonTypeTemplatePartialSpecializationArgs(Sema &S, SourceLocation TemplateNameLoc, NonTypeTemplateParmDecl *Param, const TemplateArgument *Args, unsigned NumArgs, bool IsDefaultArgument) {\n for (unsigned I = 0; I != NumArgs; ++I) {\n if (ParamUseRange.isValid()) {\n if (IsDefaultArgument) {\n S.Diag(ParamUseRange.getBegin(), diag::note_dependent_non_type_default_arg_in_partial_spec) << ParamUseRange;"}} | ||
}, | }, | ||
["note_deprecated_this_capture"]={ | ["note_deprecated_this_capture"]={ | ||
Line 3,697: | Line 3,697: | ||
[c]=ac, | [c]=ac, | ||
[m]={"d82201e7c66b",1530943128,"P0806R2 Implicit capture of this with a capture-default of [=] is"}, | [m]={"d82201e7c66b",1530943128,"P0806R2 Implicit capture of this with a capture-default of [=] is"}, | ||
[n]={{"clang/lib/Sema/SemaLambda.cpp", | [n]={{"clang/lib/Sema/SemaLambda.cpp",2038,"ExprResult Sema::BuildLambdaExpr(SourceLocation StartLoc, SourceLocation EndLoc, LambdaScopeInfo *LSI) {\n {\n for (unsigned I = 0, N = LSI->Captures.size(); I != N; ++I) {\n // Map the capture to our AST representation.\n LambdaCapture Capture = [&] {\n if (From.isThisCapture()) {\n // Capturing \'this\' implicitly with a default of \'[=]\' is deprecated,\n // because it results in a reference capture. Don\'t warn prior to\n // C++2a; there\'s nothing that can be done about it before then.\n if (getLangOpts().CPlusPlus20 && IsImplicit && CaptureDefault == LCD_ByCopy) {\n Diag(CaptureDefaultLoc, diag::note_deprecated_this_capture) << FixItHint::CreateInsertion(getLocForEndOfToken(CaptureDefaultLoc), \", this\");"}} | ||
}, | }, | ||
["note_designated_init_mixed"]={ | ["note_designated_init_mixed"]={ | ||
Line 3,709: | Line 3,709: | ||
[c]=o, | [c]=o, | ||
[m]={"5030928d60a1",1567205575,"[c++20] Implement semantic restrictions for C++20 designated"}, | [m]={"5030928d60a1",1567205575,"[c++20] Implement semantic restrictions for C++20 designated"}, | ||
[n]={{r, | [n]={{r,7817,"ExprResult Sema::ActOnInitList(SourceLocation LBraceLoc, MultiExprArg InitArgList, SourceLocation RBraceLoc) {\n // Check that any designated initializers are syntactically valid in the\n // current language mode.\n for (unsigned I = 0, E = InitArgList.size(); I != E; ++I) {\n if (auto *DIE = dyn_cast<DesignatedInitExpr>(InitArgList[I])) {\n if (!DiagnosedMixedDesignator && !isa<DesignatedInitExpr>(InitArgList[0])) {\n Diag(InitArgList[0]->getBeginLoc(), diag::note_designated_init_mixed) << InitArgList[0]->getSourceRange();"},{r,7830,"ExprResult Sema::ActOnInitList(SourceLocation LBraceLoc, MultiExprArg InitArgList, SourceLocation RBraceLoc) {\n // Check that any designated initializers are syntactically valid in the\n // current language mode.\n for (unsigned I = 0, E = InitArgList.size(); I != E; ++I) {\n if (auto *DIE = dyn_cast<DesignatedInitExpr>(InitArgList[I])) {\n } else if (getLangOpts().CPlusPlus && !DiagnosedMixedDesignator && isa<DesignatedInitExpr>(InitArgList[0])) {\n Diag(InitArgList[I]->getBeginLoc(), diag::note_designated_init_mixed) << InitArgList[I]->getSourceRange();"}} | ||
}, | }, | ||
["note_destructor_nontype_here"]={ | ["note_destructor_nontype_here"]={ | ||
Line 3,721: | Line 3,721: | ||
[c]=o, | [c]=o, | ||
[m]={"1228d42ddab8",1576809732,"[OpenMP][Part 2] Use reusable OpenMP context/traits handling"}, | [m]={"1228d42ddab8",1576809732,"[OpenMP][Part 2] Use reusable OpenMP context/traits handling"}, | ||
[n]={{K, | [n]={{K,236,"ParsedType Sema::getDestructorName(SourceLocation TildeLoc, IdentifierInfo &II, SourceLocation NameLoc, Scope *S, CXXScopeSpec &SS, ParsedType ObjectTypePtr, bool EnteringContext) {\n auto CheckLookupResult = [&](LookupResult &Found) -> ParsedType {\n // As an extension, attempt to \"fix\" an ambiguity by erasing all non-type\n // results, and all non-matching results if we have a search type. It\'s not\n // clear what the right behavior is if destructor lookup hits an ambiguity,\n // but other compilers do generally accept at least some kinds of\n // ambiguity.\n if (Found.isAmbiguous() && NumAcceptableResults == 1) {\n while (F.hasNext()) {\n if (auto *TD = dyn_cast<TypeDecl>(D->getUnderlyingDecl()))\n else\n Diag(D->getLocation(), diag::note_destructor_nontype_here);"},{K,462,"ParsedType Sema::getDestructorName(SourceLocation TildeLoc, IdentifierInfo &II, SourceLocation NameLoc, Scope *S, CXXScopeSpec &SS, ParsedType ObjectTypePtr, bool EnteringContext) {\n for (NamedDecl *FoundD : FoundDecls) {\n if (auto *TD = dyn_cast<TypeDecl>(FoundD->getUnderlyingDecl()))\n else\n Diag(FoundD->getLocation(), diag::note_destructor_nontype_here) << FoundD;"}} | ||
}, | }, | ||
["note_destructor_type_here"]={ | ["note_destructor_type_here"]={ | ||
Line 3,733: | Line 3,733: | ||
[c]=o, | [c]=o, | ||
[m]={"4cf85a725af0",1299277928,"When clearing a LookupResult structure, clear out the naming class,"}, | [m]={"4cf85a725af0",1299277928,"When clearing a LookupResult structure, clear out the naming class,"}, | ||
[n]={{K, | [n]={{K,233,"ParsedType Sema::getDestructorName(SourceLocation TildeLoc, IdentifierInfo &II, SourceLocation NameLoc, Scope *S, CXXScopeSpec &SS, ParsedType ObjectTypePtr, bool EnteringContext) {\n auto CheckLookupResult = [&](LookupResult &Found) -> ParsedType {\n // As an extension, attempt to \"fix\" an ambiguity by erasing all non-type\n // results, and all non-matching results if we have a search type. It\'s not\n // clear what the right behavior is if destructor lookup hits an ambiguity,\n // but other compilers do generally accept at least some kinds of\n // ambiguity.\n if (Found.isAmbiguous() && NumAcceptableResults == 1) {\n while (F.hasNext()) {\n if (auto *TD = dyn_cast<TypeDecl>(D->getUnderlyingDecl()))\n Diag(D->getLocation(), diag::note_destructor_type_here) << Context.getTypeDeclType(TD);"},{K,402,"ParsedType Sema::getDestructorName(SourceLocation TildeLoc, IdentifierInfo &II, SourceLocation NameLoc, Scope *S, CXXScopeSpec &SS, ParsedType ObjectTypePtr, bool EnteringContext) {\n if (SS.isSet()) {\n // For compatibility with other compilers and older versions of Clang,\n //\n // nested-name-specifier type-name :: ~ type-name\n //\n // also looks for type-name in the scope. Unfortunately, we can\'t\n // reasonably apply this fallback for dependent nested-name-specifiers.\n if (SS.isValid() && SS.getScopeRep()->getPrefix()) {\n if (ParsedType T = LookupInScope()) {\n Diag(FoundDecls.back()->getLocation(), diag::note_destructor_type_here) << GetTypeFromParser(T);"},{K,459,"ParsedType Sema::getDestructorName(SourceLocation TildeLoc, IdentifierInfo &II, SourceLocation NameLoc, Scope *S, CXXScopeSpec &SS, ParsedType ObjectTypePtr, bool EnteringContext) {\n for (NamedDecl *FoundD : FoundDecls) {\n if (auto *TD = dyn_cast<TypeDecl>(FoundD->getUnderlyingDecl()))\n Diag(FoundD->getLocation(), diag::note_destructor_type_here) << Context.getTypeDeclType(TD);"}} | ||
}, | }, | ||
["note_direct_member_here"]={ | ["note_direct_member_here"]={ | ||
Line 3,745: | Line 3,745: | ||
[c]=o, | [c]=o, | ||
[m]={T,1590001902,S}, | [m]={T,1590001902,S}, | ||
[n]={{E, | [n]={{E,3972,"static void DiagnoseCategoryDirectMembersProtocolConformance(Sema &S, ObjCProtocolDecl *PDecl, ObjCCategoryDecl *CDecl) {\n if (!DirectMembers.empty()) {\n for (const auto *MD : DirectMembers)\n S.Diag(MD->getLocation(), diag::note_direct_member_here);"}} | ||
}, | }, | ||
["note_direct_method_declared_at"]={ | ["note_direct_method_declared_at"]={ | ||
Line 3,757: | Line 3,757: | ||
[c]=o, | [c]=o, | ||
[m]={"c094e7dc4b3f",1573050950,"[SYCL] Add sycl_kernel attribute for accelerated code outlining"}, | [m]={"c094e7dc4b3f",1573050950,"[SYCL] Add sycl_kernel attribute for accelerated code outlining"}, | ||
[n]={{s, | [n]={{s,1326,"ExprResult Sema::ParseObjCSelectorExpression(Selector Sel, SourceLocation AtLoc, SourceLocation SelLoc, SourceLocation LParenLoc, SourceLocation RParenLoc, bool WarnMultipleSelectors) {\n if (!Method) {\n } else {\n if (onlyDirect) {\n Diag(Method->getLocation(), diag::note_direct_method_declared_at) << Method->getDeclName();"},{s,1336,"ExprResult Sema::ParseObjCSelectorExpression(Selector Sel, SourceLocation AtLoc, SourceLocation SelLoc, SourceLocation LParenLoc, SourceLocation RParenLoc, bool WarnMultipleSelectors) {\n if (!Method) {\n } else {\n if (onlyDirect) {\n } else if (anyDirect) {\n if (LikelyTargetMethod && LikelyTargetMethod->isDirectMethod()) {\n Diag(LikelyTargetMethod->getLocation(), diag::note_direct_method_declared_at) << LikelyTargetMethod->getDeclName();"},{s,1344,"ExprResult Sema::ParseObjCSelectorExpression(Selector Sel, SourceLocation AtLoc, SourceLocation SelLoc, SourceLocation LParenLoc, SourceLocation RParenLoc, bool WarnMultipleSelectors) {\n if (!Method) {\n } else {\n if (onlyDirect) {\n } else if (anyDirect) {\n if (LikelyTargetMethod && LikelyTargetMethod->isDirectMethod()) {\n } else if (!LikelyTargetMethod) {\n Diag(GlobalDirectMethod->getLocation(), diag::note_direct_method_declared_at) << GlobalDirectMethod->getDeclName();"},{s,2708,"/// \\param ReceiverType The type of the object receiving the\n/// message. When \\p ReceiverTypeInfo is non-NULL, this is the same\n/// type as that refers to. For a superclass send, this is the type of\n/// the superclass.\n///\n/// \\param SuperLoc The location of the \"super\" keyword in a\n/// superclass message.\n///\n/// \\param Sel The selector to which the message is being sent.\n///\n/// \\param Method The method that this class message is invoking, if\n/// already known.\n///\n/// \\param LBracLoc The location of the opening square bracket \']\'.\n///\n/// \\param RBracLoc The location of the closing square bracket \']\'.\n///\n/// \\param ArgsIn The message arguments.\nExprResult Sema::BuildClassMessage(TypeSourceInfo *ReceiverTypeInfo, QualType ReceiverType, SourceLocation SuperLoc, Selector Sel, ObjCMethodDecl *Method, SourceLocation LBracLoc, ArrayRef<SourceLocation> SelectorLocs, SourceLocation RBracLoc, MultiExprArg ArgsIn, bool isImplicit) {\n if (Method && Method->isDirectMethod() && SuperLoc.isValid()) {\n Diag(Method->getLocation(), diag::note_direct_method_declared_at) << Method->getDeclName();"},{s,3144,"/// Build an Objective-C instance message expression.\n///\n/// This routine takes care of both normal instance messages and\n/// instance messages to the superclass instance.\n///\n/// \\param Receiver The expression that computes the object that will\n/// receive this message. This may be empty, in which case we are\n/// sending to the superclass instance and \\p SuperLoc must be a valid\n/// source location.\n///\n/// \\param ReceiverType The (static) type of the object receiving the\n/// message. When a \\p Receiver expression is provided, this is the\n/// same type as that expression. For a superclass instance send, this\n/// is a pointer to the type of the superclass.\n///\n/// \\param SuperLoc The location of the \"super\" keyword in a\n/// superclass instance message.\n///\n/// \\param Sel The selector to which the message is being sent.\n///\n/// \\param Method The method that this instance message is invoking, if\n/// already known.\n///\n/// \\param LBracLoc The location of the opening square bracket \']\'.\n///\n/// \\param RBracLoc The location of the closing square bracket \']\'.\n///\n/// \\param ArgsIn The message arguments.\nExprResult Sema::BuildInstanceMessage(Expr *Receiver, QualType ReceiverType, SourceLocation SuperLoc, Selector Sel, ObjCMethodDecl *Method, SourceLocation LBracLoc, ArrayRef<SourceLocation> SelectorLocs, SourceLocation RBracLoc, MultiExprArg ArgsIn, bool isImplicit) {\n if (Method && Method->isDirectMethod()) {\n if (ReceiverType->isObjCIdType() && !isImplicit) {\n Diag(Method->getLocation(), diag::note_direct_method_declared_at) << Method->getDeclName();"},{s,3161,"/// Build an Objective-C instance message expression.\n///\n/// This routine takes care of both normal instance messages and\n/// instance messages to the superclass instance.\n///\n/// \\param Receiver The expression that computes the object that will\n/// receive this message. This may be empty, in which case we are\n/// sending to the superclass instance and \\p SuperLoc must be a valid\n/// source location.\n///\n/// \\param ReceiverType The (static) type of the object receiving the\n/// message. When a \\p Receiver expression is provided, this is the\n/// same type as that expression. For a superclass instance send, this\n/// is a pointer to the type of the superclass.\n///\n/// \\param SuperLoc The location of the \"super\" keyword in a\n/// superclass instance message.\n///\n/// \\param Sel The selector to which the message is being sent.\n///\n/// \\param Method The method that this instance message is invoking, if\n/// already known.\n///\n/// \\param LBracLoc The location of the opening square bracket \']\'.\n///\n/// \\param RBracLoc The location of the closing square bracket \']\'.\n///\n/// \\param ArgsIn The message arguments.\nExprResult Sema::BuildInstanceMessage(Expr *Receiver, QualType ReceiverType, SourceLocation SuperLoc, Selector Sel, ObjCMethodDecl *Method, SourceLocation LBracLoc, ArrayRef<SourceLocation> SelectorLocs, SourceLocation RBracLoc, MultiExprArg ArgsIn, bool isImplicit) {\n if (Method && Method->isDirectMethod()) {\n // Under ARC, self can\'t be assigned, and doing a direct call to `self`\n // when it\'s a Class is hence safe. For other cases, we can\'t trust `self`\n // is what we think it is, so we reject it.\n if (ReceiverType->isObjCClassType() && !isImplicit && !(Receiver->isObjCSelfExpr() && getLangOpts().ObjCAutoRefCount)) {\n Diag(Method->getLocation(), diag::note_direct_method_declared_at) << Method->getDeclName();"},{s,3176,"/// Build an Objective-C instance message expression.\n///\n/// This routine takes care of both normal instance messages and\n/// instance messages to the superclass instance.\n///\n/// \\param Receiver The expression that computes the object that will\n/// receive this message. This may be empty, in which case we are\n/// sending to the superclass instance and \\p SuperLoc must be a valid\n/// source location.\n///\n/// \\param ReceiverType The (static) type of the object receiving the\n/// message. When a \\p Receiver expression is provided, this is the\n/// same type as that expression. For a superclass instance send, this\n/// is a pointer to the type of the superclass.\n///\n/// \\param SuperLoc The location of the \"super\" keyword in a\n/// superclass instance message.\n///\n/// \\param Sel The selector to which the message is being sent.\n///\n/// \\param Method The method that this instance message is invoking, if\n/// already known.\n///\n/// \\param LBracLoc The location of the opening square bracket \']\'.\n///\n/// \\param RBracLoc The location of the closing square bracket \']\'.\n///\n/// \\param ArgsIn The message arguments.\nExprResult Sema::BuildInstanceMessage(Expr *Receiver, QualType ReceiverType, SourceLocation SuperLoc, Selector Sel, ObjCMethodDecl *Method, SourceLocation LBracLoc, ArrayRef<SourceLocation> SelectorLocs, SourceLocation RBracLoc, MultiExprArg ArgsIn, bool isImplicit) {\n if (Method && Method->isDirectMethod()) {\n if (SuperLoc.isValid()) {\n Diag(Method->getLocation(), diag::note_direct_method_declared_at) << Method->getDeclName();"}} | ||
}, | }, | ||
["note_doc_block_command_previous"]={ | ["note_doc_block_command_previous"]={ | ||
Line 3,769: | Line 3,769: | ||
[c]=nb, | [c]=nb, | ||
[m]={"5ec0c7536a98",1344272907,"Comment diagnostics: warn on duplicate \\brief and \\return commands."}, | [m]={"5ec0c7536a98",1344272907,"Comment diagnostics: warn on duplicate \\brief and \\return commands."}, | ||
[n]={{ob, | [n]={{ob,628,"void Sema::checkBlockCommandDuplicate(const BlockCommandComment *Command) {\n if (CommandName == PrevCommandName)\n Diag(PrevCommand->getLocation(), diag::note_doc_block_command_previous) << PrevCommand->getCommandMarker() << PrevCommandName << PrevCommand->getSourceRange();"}} | ||
}, | }, | ||
["note_doc_block_command_previous_alias"]={ | ["note_doc_block_command_previous_alias"]={ | ||
Line 3,781: | Line 3,781: | ||
[c]=nb, | [c]=nb, | ||
[m]={"5ec0c7536a98",1344272907,"Comment diagnostics: warn on duplicate \\brief and \\return commands."}, | [m]={"5ec0c7536a98",1344272907,"Comment diagnostics: warn on duplicate \\brief and \\return commands."}, | ||
[n]={{ob, | [n]={{ob,634,"void Sema::checkBlockCommandDuplicate(const BlockCommandComment *Command) {\n if (CommandName == PrevCommandName)\n else\n Diag(PrevCommand->getLocation(), diag::note_doc_block_command_previous_alias) << PrevCommand->getCommandMarker() << PrevCommandName << CommandName;"}} | ||
}, | }, | ||
["note_doc_html_end_tag"]={ | ["note_doc_html_end_tag"]={ | ||
Line 3,793: | Line 3,793: | ||
[c]=nb, | [c]=nb, | ||
[m]={"e00ffc7bb836",1342140264,"Comment parsing: repaint the bikesched: rename \'HTML open tags\' to \'HTML start tags\' and \'HTML close..."}, | [m]={"e00ffc7bb836",1342140264,"Comment parsing: repaint the bikesched: rename \'HTML open tags\' to \'HTML start tags\' and \'HTML close..."}, | ||
[n]={{ob, | [n]={{ob,510,"HTMLEndTagComment *Sema::actOnHTMLEndTag(SourceLocation LocBegin, SourceLocation LocEnd, StringRef TagName) {\n while (!HTMLOpenTags.empty()) {\n if (OpenLineInvalid || CloseLineInvalid || OpenLine == CloseLine) {\n } else {\n Diag(HET->getLocation(), diag::note_doc_html_end_tag) << HET->getSourceRange();"}} | ||
}, | }, | ||
["note_doc_html_tag_started_here"]={ | ["note_doc_html_tag_started_here"]={ | ||
Line 3,805: | Line 3,805: | ||
[c]=nb, | [c]=nb, | ||
[m]={"f26054f0fb53",1342042719,"Enable comment parsing and semantic analysis to emit diagnostics. A few"}, | [m]={"f26054f0fb53",1342042719,"Enable comment parsing and semantic analysis to emit diagnostics. A few"}, | ||
[n]={{"clang/lib/AST/CommentParser.cpp", | [n]={{"clang/lib/AST/CommentParser.cpp",521,"HTMLStartTagComment *Parser::parseHTMLStartTag() {\n while (true) {\n default:\n if (StartLineInvalid || EndLineInvalid || StartLine == EndLine)\n else {\n Diag(HST->getLocation(), diag::note_doc_html_tag_started_here) << HST->getSourceRange();"}} | ||
}, | }, | ||
["note_doc_param_name_suggestion"]={ | ["note_doc_param_name_suggestion"]={ | ||
Line 3,817: | Line 3,817: | ||
[c]=nb, | [c]=nb, | ||
[m]={"f26054f0fb53",1342042719,"Enable comment parsing and semantic analysis to emit diagnostics. A few"}, | [m]={"f26054f0fb53",1342042719,"Enable comment parsing and semantic analysis to emit diagnostics. A few"}, | ||
[n]={{ob, | [n]={{ob,787,"void Sema::resolveParamCommandIndexes(const FullComment *FC) {\n // Second pass over unresolved \\\\param commands: do typo correction.\n // Suggest corrections from a set of parameter declarations that have no\n // corresponding \\\\param.\n for (unsigned i = 0, e = UnresolvedParamCommands.size(); i != e; ++i) {\n if (CorrectedParamIndex != ParamCommandComment::InvalidParamIndex) {\n if (const IdentifierInfo *CorrectedII = CorrectedPVD->getIdentifier())\n Diag(ArgRange.getBegin(), diag::note_doc_param_name_suggestion) << CorrectedII->getName() << FixItHint::CreateReplacement(ArgRange, CorrectedII->getName());"}} | ||
}, | }, | ||
["note_doc_param_previous"]={ | ["note_doc_param_previous"]={ | ||
Line 3,829: | Line 3,829: | ||
[c]=nb, | [c]=nb, | ||
[m]={"8f0f1b0c41cd",1343166256,"Comment diagnostics: add warning for multiple \\param commands with duplicate"}, | [m]={"8f0f1b0c41cd",1343166256,"Comment diagnostics: add warning for multiple \\param commands with duplicate"}, | ||
[n]={{ob, | [n]={{ob,746,"void Sema::resolveParamCommandIndexes(const FullComment *FC) {\n // First pass over all \\\\param commands: resolve all parameter names.\n for (Comment::child_iterator I = FC->child_begin(), E = FC->child_end(); I != E; ++I) {\n if (ParamVarDocs[ResolvedParamIndex]) {\n Diag(PrevCommand->getLocation(), diag::note_doc_param_previous) << PrevCommand->getParamNameRange();"}} | ||
}, | }, | ||
["note_doc_tparam_name_suggestion"]={ | ["note_doc_tparam_name_suggestion"]={ | ||
Line 3,841: | Line 3,841: | ||
[c]=nb, | [c]=nb, | ||
[m]={"34df220410b3",1343774226,"Comment parsing: add support for \\tparam command on all levels."}, | [m]={"34df220410b3",1343774226,"Comment parsing: add support for \\tparam command on all levels."}, | ||
[n]={{ob, | [n]={{ob,349,"void Sema::actOnTParamCommandParamNameArg(TParamCommandComment *Command, SourceLocation ArgLocBegin, SourceLocation ArgLocEnd, StringRef Arg) {\n if (!CorrectedName.empty()) {\n Diag(ArgLocBegin, diag::note_doc_tparam_name_suggestion) << CorrectedName << FixItHint::CreateReplacement(ArgRange, CorrectedName);"}} | ||
}, | }, | ||
["note_doc_tparam_previous"]={ | ["note_doc_tparam_previous"]={ | ||
Line 3,853: | Line 3,853: | ||
[c]=nb, | [c]=nb, | ||
[m]={"34df220410b3",1343774226,"Comment parsing: add support for \\tparam command on all levels."}, | [m]={"34df220410b3",1343774226,"Comment parsing: add support for \\tparam command on all levels."}, | ||
[n]={{ob, | [n]={{ob,324,"void Sema::actOnTParamCommandParamNameArg(TParamCommandComment *Command, SourceLocation ArgLocBegin, SourceLocation ArgLocEnd, StringRef Arg) {\n if (resolveTParamReference(Arg, TemplateParameters, &Position)) {\n if (PrevCommand) {\n Diag(PrevCommand->getLocation(), diag::note_doc_tparam_previous) << PrevCommand->getParamNameRange();"}} | ||
}, | }, | ||
["note_drv_address_sanitizer_debug_runtime"]={ | ["note_drv_address_sanitizer_debug_runtime"]={ | ||
Line 3,865: | Line 3,865: | ||
[c]=a, | [c]=a, | ||
[m]={"e0db196556f2",1413328544,"clang-cl: Diagnose the usage of ASAN with a debug runtime library"}, | [m]={"e0db196556f2",1413328544,"clang-cl: Diagnose the usage of ASAN with a debug runtime library"}, | ||
[n]={{"clang/lib/Driver/SanitizerArgs.cpp", | [n]={{"clang/lib/Driver/SanitizerArgs.cpp",942,"SanitizerArgs::SanitizerArgs(const ToolChain &TC, const llvm::opt::ArgList &Args, bool DiagnoseErrors) {\n if (AllAddedKinds & SanitizerKind::Address) {\n if (Arg *WindowsDebugRTArg = Args.getLastArg(options::OPT__SLASH_MTd, options::OPT__SLASH_MT, options::OPT__SLASH_MDd, options::OPT__SLASH_MD, options::OPT__SLASH_LDd, options::OPT__SLASH_LD)) {\n case options::OPT__SLASH_LDd:\n if (DiagnoseErrors) {\n D.Diag(clang::diag::note_drv_address_sanitizer_debug_runtime);"}} | ||
}, | }, | ||
["note_drv_available_multilibs"]={ | ["note_drv_available_multilibs"]={ | ||
Line 3,877: | Line 3,877: | ||
[c]=a, | [c]=a, | ||
[m]={"028c1033b1ed",1687186972,"[Driver][BareMetal] Error if no matching multilib"}, | [m]={"028c1033b1ed",1687186972,"[Driver][BareMetal] Error if no matching multilib"}, | ||
[n]={{"clang/lib/Driver/ToolChains/BareMetal.cpp", | [n]={{"clang/lib/Driver/ToolChains/BareMetal.cpp",194,"static void findMultilibsFromYAML(const ToolChain &TC, const Driver &D, StringRef MultilibPath, const ArgList &Args, DetectedMultilibs &Result) {\n D.Diag(clang::diag::note_drv_available_multilibs) << ss.str();"}} | ||
}, | }, | ||
["note_drv_command_failed_diag_msg"]={ | ["note_drv_command_failed_diag_msg"]={ | ||
Line 3,889: | Line 3,889: | ||
[c]=a, | [c]=a, | ||
[m]={"e3805fc11821",1311193592,"When the compiler crashes, the compiler driver now produces diagnostic information "}, | [m]={"e3805fc11821",1311193592,"When the compiler crashes, the compiler driver now produces diagnostic information "}, | ||
[n]={{H, | [n]={{H,1694,"// When clang crashes, produce diagnostic information including the fully\n// preprocessed source file(s). Request that the developer attach the\n// diagnostic information to a bug report.\nvoid Driver::generateCompilationDiagnostics(Compilation &C, const Command &FailingCommand, StringRef AdditionalInformation, CompilationDiagnosticReport *Report) {\n // If lld failed, rerun it again with --reproduce.\n if (IsLLD) {\n Diag(clang::diag::note_drv_command_failed_diag_msg) << BugReporMsg;"},{H,1695,"// When clang crashes, produce diagnostic information including the fully\n// preprocessed source file(s). Request that the developer attach the\n// diagnostic information to a bug report.\nvoid Driver::generateCompilationDiagnostics(Compilation &C, const Command &FailingCommand, StringRef AdditionalInformation, CompilationDiagnosticReport *Report) {\n // If lld failed, rerun it again with --reproduce.\n if (IsLLD) {\n Diag(clang::diag::note_drv_command_failed_diag_msg) << TmpName;"},{H,1696,"// When clang crashes, produce diagnostic information including the fully\n// preprocessed source file(s). Request that the developer attach the\n// diagnostic information to a bug report.\nvoid Driver::generateCompilationDiagnostics(Compilation &C, const Command &FailingCommand, StringRef AdditionalInformation, CompilationDiagnosticReport *Report) {\n // If lld failed, rerun it again with --reproduce.\n if (IsLLD) {\n Diag(clang::diag::note_drv_command_failed_diag_msg) << \"\\n\\n********************\";"},{H,1715,"// When clang crashes, produce diagnostic information including the fully\n// preprocessed source file(s). Request that the developer attach the\n// diagnostic information to a bug report.\nvoid Driver::generateCompilationDiagnostics(Compilation &C, const Command &FailingCommand, StringRef AdditionalInformation, CompilationDiagnosticReport *Report) {\n for (InputList::iterator it = Inputs.begin(), ie = Inputs.end(); it != ie;) {\n // Ignore input from stdin or any inputs that cannot be preprocessed.\n // Check type first as not all linker inputs have a value.\n if (types::getPreprocessedType(it->first) == types::TY_INVALID) {\n } else if (!strcmp(it->second->getValue(), \"-\")) {\n Diag(clang::diag::note_drv_command_failed_diag_msg) << \"Error generating preprocessed source(s) - \""},{H,1730,"// When clang crashes, produce diagnostic information including the fully\n// preprocessed source file(s). Request that the developer attach the\n// diagnostic information to a bug report.\nvoid Driver::generateCompilationDiagnostics(Compilation &C, const Command &FailingCommand, StringRef AdditionalInformation, CompilationDiagnosticReport *Report) {\n if (Inputs.empty()) {\n Diag(clang::diag::note_drv_command_failed_diag_msg) << \"Error generating preprocessed source(s) - \""},{H,1746,"// When clang crashes, produce diagnostic information including the fully\n// preprocessed source file(s). Request that the developer attach the\n// diagnostic information to a bug report.\nvoid Driver::generateCompilationDiagnostics(Compilation &C, const Command &FailingCommand, StringRef AdditionalInformation, CompilationDiagnosticReport *Report) {\n if (ArchNames.size() > 1) {\n Diag(clang::diag::note_drv_command_failed_diag_msg) << \"Error generating preprocessed source(s) - cannot generate \""},{H,1764,"// When clang crashes, produce diagnostic information including the fully\n// preprocessed source file(s). Request that the developer attach the\n// diagnostic information to a bug report.\nvoid Driver::generateCompilationDiagnostics(Compilation &C, const Command &FailingCommand, StringRef AdditionalInformation, CompilationDiagnosticReport *Report) {\n // If there were errors building the compilation, quit now.\n if (Trap.hasErrorOccurred()) {\n Diag(clang::diag::note_drv_command_failed_diag_msg) << \"Error generating preprocessed source(s).\";"},{H,1775,"// When clang crashes, produce diagnostic information including the fully\n// preprocessed source file(s). Request that the developer attach the\n// diagnostic information to a bug report.\nvoid Driver::generateCompilationDiagnostics(Compilation &C, const Command &FailingCommand, StringRef AdditionalInformation, CompilationDiagnosticReport *Report) {\n // If any of the preprocessing commands failed, clean up and exit.\n if (!FailingCommands.empty()) {\n Diag(clang::diag::note_drv_command_failed_diag_msg) << \"Error generating preprocessed source(s).\";"},{H,1782,"// When clang crashes, produce diagnostic information including the fully\n// preprocessed source file(s). Request that the developer attach the\n// diagnostic information to a bug report.\nvoid Driver::generateCompilationDiagnostics(Compilation &C, const Command &FailingCommand, StringRef AdditionalInformation, CompilationDiagnosticReport *Report) {\n if (TempFiles.empty()) {\n Diag(clang::diag::note_drv_command_failed_diag_msg) << \"Error generating preprocessed source(s).\";"},{H,1787,"// When clang crashes, produce diagnostic information including the fully\n// preprocessed source file(s). Request that the developer attach the\n// diagnostic information to a bug report.\nvoid Driver::generateCompilationDiagnostics(Compilation &C, const Command &FailingCommand, StringRef AdditionalInformation, CompilationDiagnosticReport *Report) {\n Diag(clang::diag::note_drv_command_failed_diag_msg) << BugReporMsg;"},{H,1792,"// When clang crashes, produce diagnostic information including the fully\n// preprocessed source file(s). Request that the developer attach the\n// diagnostic information to a bug report.\nvoid Driver::generateCompilationDiagnostics(Compilation &C, const Command &FailingCommand, StringRef AdditionalInformation, CompilationDiagnosticReport *Report) {\n for (const char *TempFile : TempFiles) {\n Diag(clang::diag::note_drv_command_failed_diag_msg) << TempFile;"},{H,1820,"// When clang crashes, produce diagnostic information including the fully\n// preprocessed source file(s). Request that the developer attach the\n// diagnostic information to a bug report.\nvoid Driver::generateCompilationDiagnostics(Compilation &C, const Command &FailingCommand, StringRef AdditionalInformation, CompilationDiagnosticReport *Report) {\n if (EC) {\n Diag(clang::diag::note_drv_command_failed_diag_msg) << \"Error generating run script: \" << Script << \" \" << EC.message();"},{H,1834,"// When clang crashes, produce diagnostic information including the fully\n// preprocessed source file(s). Request that the developer attach the\n// diagnostic information to a bug report.\nvoid Driver::generateCompilationDiagnostics(Compilation &C, const Command &FailingCommand, StringRef AdditionalInformation, CompilationDiagnosticReport *Report) {\n if (EC) {\n } else {\n Diag(clang::diag::note_drv_command_failed_diag_msg) << Script;"},{H,1841,"// When clang crashes, produce diagnostic information including the fully\n// preprocessed source file(s). Request that the developer attach the\n// diagnostic information to a bug report.\nvoid Driver::generateCompilationDiagnostics(Compilation &C, const Command &FailingCommand, StringRef AdditionalInformation, CompilationDiagnosticReport *Report) {\n // On darwin, provide information about the .crash diagnostic report.\n if (llvm::Triple(llvm::sys::getProcessTriple()).isOSDarwin()) {\n if (getCrashDiagnosticFile(ReproCrashFilename, CrashDiagDir)) {\n Diag(clang::diag::note_drv_command_failed_diag_msg) << ReproCrashFilename.str();"},{H,1846,"// When clang crashes, produce diagnostic information including the fully\n// preprocessed source file(s). Request that the developer attach the\n// diagnostic information to a bug report.\nvoid Driver::generateCompilationDiagnostics(Compilation &C, const Command &FailingCommand, StringRef AdditionalInformation, CompilationDiagnosticReport *Report) {\n // On darwin, provide information about the .crash diagnostic report.\n if (llvm::Triple(llvm::sys::getProcessTriple()).isOSDarwin()) {\n if (getCrashDiagnosticFile(ReproCrashFilename, CrashDiagDir)) {\n } else { // Suggest a directory for the user to look for .crash files.\n Diag(clang::diag::note_drv_command_failed_diag_msg) << \"Crash backtrace is located in\";"},{H,1848,"// When clang crashes, produce diagnostic information including the fully\n// preprocessed source file(s). Request that the developer attach the\n// diagnostic information to a bug report.\nvoid Driver::generateCompilationDiagnostics(Compilation &C, const Command &FailingCommand, StringRef AdditionalInformation, CompilationDiagnosticReport *Report) {\n // On darwin, provide information about the .crash diagnostic report.\n if (llvm::Triple(llvm::sys::getProcessTriple()).isOSDarwin()) {\n if (getCrashDiagnosticFile(ReproCrashFilename, CrashDiagDir)) {\n } else { // Suggest a directory for the user to look for .crash files.\n Diag(clang::diag::note_drv_command_failed_diag_msg) << CrashDiagDir.str();"},{H,1850,"// When clang crashes, produce diagnostic information including the fully\n// preprocessed source file(s). Request that the developer attach the\n// diagnostic information to a bug report.\nvoid Driver::generateCompilationDiagnostics(Compilation &C, const Command &FailingCommand, StringRef AdditionalInformation, CompilationDiagnosticReport *Report) {\n // On darwin, provide information about the .crash diagnostic report.\n if (llvm::Triple(llvm::sys::getProcessTriple()).isOSDarwin()) {\n if (getCrashDiagnosticFile(ReproCrashFilename, CrashDiagDir)) {\n } else { // Suggest a directory for the user to look for .crash files.\n Diag(clang::diag::note_drv_command_failed_diag_msg) << \"(choose the .crash file that corresponds to your crash)\";"},{H,1855,"// When clang crashes, produce diagnostic information including the fully\n// preprocessed source file(s). Request that the developer attach the\n// diagnostic information to a bug report.\nvoid Driver::generateCompilationDiagnostics(Compilation &C, const Command &FailingCommand, StringRef AdditionalInformation, CompilationDiagnosticReport *Report) {\n Diag(clang::diag::note_drv_command_failed_diag_msg) << \"\\n\\n********************\";"}} | ||
}, | }, | ||
["note_drv_config_file_searched_in"]={ | ["note_drv_config_file_searched_in"]={ | ||
Line 3,901: | Line 3,901: | ||
[c]=a, | [c]=a, | ||
[m]={"c92ca91472b9",1514656766,"Enable configuration files in clang"}, | [m]={"c92ca91472b9",1514656766,"Enable configuration files in clang"}, | ||
[n]={{H, | [n]={{H,1114,"bool Driver::loadConfigFiles() {\n if (CLOptions) {\n for (auto CfgFileName : CLOptions->getAllArgValues(options::OPT_config)) {\n // If argument contains directory separator, treat it as a path to\n // configuration file.\n if (llvm::sys::path::has_parent_path(CfgFileName)) {\n } else if (!ExpCtx.findConfigFile(CfgFileName, CfgFilePath)) {\n for (const StringRef &SearchDir : CfgFileSearchDirs)\n if (!SearchDir.empty())\n Diag(diag::note_drv_config_file_searched_in) << SearchDir;"}} | ||
}, | }, | ||
["note_drv_t_option_is_global"]={ | ["note_drv_t_option_is_global"]={ | ||
Line 3,913: | Line 3,913: | ||
[c]=a, | [c]=a, | ||
[m]={"0d0b19cbe1e3",1376332457,"clang-cl: Expand warning about /TC and /TP override, and expand test"}, | [m]={"0d0b19cbe1e3",1376332457,"clang-cl: Expand warning about /TC and /TP override, and expand test"}, | ||
[n]={{H, | [n]={{H,2629,"// Construct a the list of inputs and their types.\nvoid Driver::BuildInputs(const ToolChain &TC, DerivedArgList &Args, InputList &Inputs) const {\n // The last /TC or /TP option sets the input type to C or C++ globally.\n if (Arg *TCTP = Args.getLastArgNoClaim(options::OPT__SLASH_TC, options::OPT__SLASH_TP)) {\n if (ShowNote)\n Diag(clang::diag::note_drv_t_option_is_global);"}} | ||
}, | }, | ||
["note_drv_use_standard"]={ | ["note_drv_use_standard"]={ | ||
Line 3,925: | Line 3,925: | ||
[c]=a, | [c]=a, | ||
[m]={"c91daf1cf9a4",1487112260,"[Driver] Report available language standards on user error"}, | [m]={"c91daf1cf9a4",1487112260,"[Driver] Report available language standards on user error"}, | ||
[n]={{bc, | [n]={{bc,3568,"bool CompilerInvocation::ParseLangArgs(LangOptions &Opts, ArgList &Args, InputKind IK, const llvm::Triple &T, std::vector<std::string> &Includes, DiagnosticsEngine &Diags) {\n if (const Arg *A = Args.getLastArg(OPT_std_EQ)) {\n if (LangStd == LangStandard::lang_unspecified) {\n // Report supported standards with short description.\n for (unsigned KindValue = 0; KindValue != LangStandard::lang_unspecified; ++KindValue) {\n if (IsInputCompatibleWithStandard(IK, Std)) {\n auto Diag = Diags.Report(diag::note_drv_use_standard);"}} | ||
}, | }, | ||
["note_drv_verify_prefix_spelling"]={ | ["note_drv_verify_prefix_spelling"]={ | ||
Line 3,937: | Line 3,937: | ||
[c]=a, | [c]=a, | ||
[m]={"05e46484825f",1513391002,"[VerifyDiagnosticConsumer] support -verify=<prefixes>"}, | [m]={"05e46484825f",1513391002,"[VerifyDiagnosticConsumer] support -verify=<prefixes>"}, | ||
[n]={{bc, | [n]={{bc,2217,"static bool checkVerifyPrefixes(const std::vector<std::string> &VerifyPrefixes, DiagnosticsEngine &Diags) {\n for (const auto &Prefix : VerifyPrefixes) {\n if (BadChar != Prefix.end() || !isLetter(Prefix[0])) {\n Diags.Report(diag::note_drv_verify_prefix_spelling);"}} | ||
}, | }, | ||
["note_due_to_dllexported_class"]={ | ["note_due_to_dllexported_class"]={ | ||
Line 3,949: | Line 3,949: | ||
[c]=o, | [c]=o, | ||
[m]={"5870373d1954",1424480844,"Improve diagnostic when failing to synthesize implicit member due to dllexport (PR22591)"}, | [m]={"5870373d1954",1424480844,"Improve diagnostic when failing to synthesize implicit member due to dllexport (PR22591)"}, | ||
[n]={{z, | [n]={{z,1003,"/// Prints the current instantiation stack through a series of\n/// notes.\nvoid Sema::PrintInstantiationStack() {\n for (SmallVectorImpl<CodeSynthesisContext>::reverse_iterator Active = CodeSynthesisContexts.rbegin(), ActiveEnd = CodeSynthesisContexts.rend(); Active != ActiveEnd; ++Active, ++InstantiationIdx) {\n case CodeSynthesisContext::MarkingClassDllexported:\n Diags.Report(Active->PointOfInstantiation, diag::note_due_to_dllexported_class) << cast<CXXRecordDecl>(Active->Entity) << !getLangOpts().CPlusPlus11;"}} | ||
}, | }, | ||
["note_duplicate_asm_operand_name"]={ | ["note_duplicate_asm_operand_name"]={ | ||
Line 3,961: | Line 3,961: | ||
[c]="Inline Assembly Issue", | [c]="Inline Assembly Issue", | ||
[m]={"954ec09aed4f",1559178346,"clang support gnu asm goto."}, | [m]={"954ec09aed4f",1559178346,"clang support gnu asm goto."}, | ||
[n]={{Tb, | [n]={{Tb,738,"StmtResult Sema::ActOnGCCAsmStmt(SourceLocation AsmLoc, bool IsSimple, bool IsVolatile, unsigned NumOutputs, unsigned NumInputs, IdentifierInfo **Names, MultiExprArg constraints, MultiExprArg Exprs, Expr *asmString, MultiExprArg clobbers, unsigned NumLabels, SourceLocation RParenLoc) {\n if (Found != NamedOperandList.end()) {\n Diag(Found->second->getBeginLoc(), diag::note_duplicate_asm_operand_name) << Found->first;"}} | ||
}, | }, | ||
["note_duplicate_case_prev"]={ | ["note_duplicate_case_prev"]={ | ||
Line 3,973: | Line 3,973: | ||
[c]=a, | [c]=a, | ||
[m]={wb,1236199783,vb}, | [m]={wb,1236199783,vb}, | ||
[n]={{A, | [n]={{A,1281,"StmtResult Sema::ActOnFinishSwitchStmt(SourceLocation SwitchLoc, Stmt *Switch, Stmt *BodyStmt) {\n for (SwitchCase *SC = SS->getSwitchCaseList(); SC && !HasDependentValue; SC = SC->getNextSwitchCase()) {\n if (DefaultStmt *DS = dyn_cast<DefaultStmt>(SC)) {\n if (TheDefaultStmt) {\n Diag(TheDefaultStmt->getDefaultLoc(), diag::note_duplicate_case_prev);"},{A,1384,"StmtResult Sema::ActOnFinishSwitchStmt(SourceLocation SwitchLoc, Stmt *Switch, Stmt *BodyStmt) {\n if (!HasDependentValue) {\n if (!CaseVals.empty()) {\n for (unsigned i = 0, e = CaseVals.size(); i != e; ++i) {\n if (i != 0 && CaseVals[i].first == CaseVals[i - 1].first) {\n Diag(CaseVals[i - 1].second->getLHS()->getBeginLoc(), diag::note_duplicate_case_prev);"},{A,1477,"StmtResult Sema::ActOnFinishSwitchStmt(SourceLocation SwitchLoc, Stmt *Switch, Stmt *BodyStmt) {\n if (!HasDependentValue) {\n // Detect duplicate case ranges, which usually don\'t exist at all in\n // the first place.\n if (!CaseRanges.empty()) {\n // Rescan the ranges, looking for overlap with singleton values and other\n // ranges. Since the range list is sorted, we only need to compare case\n // ranges with their neighbors.\n for (unsigned i = 0, e = CaseRanges.size(); i != e; ++i) {\n if (OverlapStmt) {\n Diag(OverlapStmt->getLHS()->getBeginLoc(), diag::note_duplicate_case_prev);"}} | ||
}, | }, | ||
["note_duplicate_element"]={ | ["note_duplicate_element"]={ | ||
Line 3,985: | Line 3,985: | ||
[c]=o, | [c]=o, | ||
[m]={"73e306e548cd",1346358744,"Add -Wduplicate-enum warning. Clang will emit this warning when an implicitly"}, | [m]={"73e306e548cd",1346358744,"Add -Wduplicate-enum warning. Clang will emit this warning when an implicitly"}, | ||
[n]={{t, | [n]={{t,19669,"// Emits a warning when an element is implicitly set a value that\n// a previous element has already been set to.\nstatic void CheckForDuplicateEnumValues(Sema &S, ArrayRef<Decl *> Elements, EnumDecl *Enum, QualType EnumType) {\n // Emit diagnostics.\n for (const auto &Vec : DupVector) {\n // Emit one note for each of the remaining enum constants with\n // the same value.\n for (auto *ECD : llvm::drop_begin(*Vec))\n S.Diag(ECD->getLocation(), diag::note_duplicate_element) << ECD << toString(ECD->getInitVal(), 10) << ECD->getSourceRange();"}} | ||
}, | }, | ||
["note_empty_body_on_separate_line"]={ | ["note_empty_body_on_separate_line"]={ | ||
Line 3,997: | Line 3,997: | ||
[c]=o, | [c]=o, | ||
[m]={"800ddf3dda7b",1329257672,"Generalize -Wempty-body: warn when statement body is empty (closes: PR11329)"}, | [m]={"800ddf3dda7b",1329257672,"Generalize -Wempty-body: warn when statement body is empty (closes: PR11329)"}, | ||
[n]={{y, | [n]={{y,17891,"void Sema::DiagnoseEmptyStmtBody(SourceLocation StmtLoc, const Stmt *Body, unsigned DiagID) {\n Diag(NBody->getSemiLoc(), diag::note_empty_body_on_separate_line);"},{y,17956,"void Sema::DiagnoseEmptyLoopBody(const Stmt *S, const Stmt *PossibleBody) {\n if (ProbableTypo) {\n Diag(NBody->getSemiLoc(), diag::note_empty_body_on_separate_line);"}} | ||
}, | }, | ||
["note_empty_parens_default_ctor"]={ | ["note_empty_parens_default_ctor"]={ | ||
Line 4,009: | Line 4,009: | ||
[c]=o, | [c]=o, | ||
[m]={"8d06f424480e",1326412409,"Improve 0-argument -Wvexing-parse diagnostic by adding notes with fix-its:"}, | [m]={"8d06f424480e",1326412409,"Improve 0-argument -Wvexing-parse diagnostic by adding notes with fix-its:"}, | ||
[n]={{B, | [n]={{B,3908,"/// Produce an appropriate diagnostic for an ambiguity between a function\n/// declarator and a C++ direct-initializer.\nstatic void warnAboutAmbiguousFunction(Sema &S, Declarator &D, DeclaratorChunk &DeclType, QualType RT) {\n if (FTI.NumParams > 0) {\n } else {\n // Empty parens mean value-initialization, and no parens mean\n // default initialization. These are equivalent if the default\n // constructor is user-provided or if zero-initialization is a\n // no-op.\n if (RD && RD->hasDefinition() && (RD->isEmpty() || RD->hasUserProvidedDefaultConstructor()))\n S.Diag(DeclType.Loc, diag::note_empty_parens_default_ctor) << FixItHint::CreateRemoval(ParenRange);"}} | ||
}, | }, | ||
["note_empty_parens_function_call"]={ | ["note_empty_parens_function_call"]={ | ||
Line 4,021: | Line 4,021: | ||
[c]=o, | [c]=o, | ||
[m]={"8d06f424480e",1326412409,"Improve 0-argument -Wvexing-parse diagnostic by adding notes with fix-its:"}, | [m]={"8d06f424480e",1326412409,"Improve 0-argument -Wvexing-parse diagnostic by adding notes with fix-its:"}, | ||
[n]={{B, | [n]={{B,3877,"/// Produce an appropriate diagnostic for an ambiguity between a function\n/// declarator and a C++ direct-initializer.\nstatic void warnAboutAmbiguousFunction(Sema &S, Declarator &D, DeclaratorChunk &DeclType, QualType RT) {\n // If the declaration looks like:\n // T var1,\n // f();\n // and name lookup finds a function named \'f\', then the \',\' was\n // probably intended to be a \';\'.\n if (!D.isFirstDeclarator() && D.getIdentifier()) {\n if (Comma.getFileID() != Name.getFileID() || Comma.getSpellingLineNumber() != Name.getSpellingLineNumber()) {\n if (S.LookupName(Result, S.getCurScope()))\n S.Diag(D.getCommaLoc(), diag::note_empty_parens_function_call) << FixItHint::CreateReplacement(D.getCommaLoc(), \";\") << D.getIdentifier();"}} | ||
}, | }, | ||
["note_empty_parens_zero_initialize"]={ | ["note_empty_parens_zero_initialize"]={ | ||
Line 4,033: | Line 4,033: | ||
[c]=o, | [c]=o, | ||
[m]={"8d06f424480e",1326412409,"Improve 0-argument -Wvexing-parse diagnostic by adding notes with fix-its:"}, | [m]={"8d06f424480e",1326412409,"Improve 0-argument -Wvexing-parse diagnostic by adding notes with fix-its:"}, | ||
[n]={{B, | [n]={{B,3916,"/// Produce an appropriate diagnostic for an ambiguity between a function\n/// declarator and a C++ direct-initializer.\nstatic void warnAboutAmbiguousFunction(Sema &S, Declarator &D, DeclaratorChunk &DeclType, QualType RT) {\n if (FTI.NumParams > 0) {\n } else {\n // Empty parens mean value-initialization, and no parens mean\n // default initialization. These are equivalent if the default\n // constructor is user-provided or if zero-initialization is a\n // no-op.\n if (RD && RD->hasDefinition() && (RD->isEmpty() || RD->hasUserProvidedDefaultConstructor()))\n else {\n if (!Init.empty())\n S.Diag(DeclType.Loc, diag::note_empty_parens_zero_initialize) << FixItHint::CreateReplacement(ParenRange, Init);"}} | ||
}, | }, | ||
["note_empty_using_if_exists_here"]={ | ["note_empty_using_if_exists_here"]={ | ||
Line 4,045: | Line 4,045: | ||
[c]=o, | [c]=o, | ||
[m]={Pb,1615397021,Ob}, | [m]={Pb,1615397021,Ob}, | ||
[n]={{r, | [n]={{r,367,"/// Determine whether the use of this declaration is valid, and\n/// emit any corresponding diagnostics.\n///\n/// This routine diagnoses various problems with referencing\n/// declarations that can occur when using a declaration. For example,\n/// it might warn if a deprecated or unavailable declaration is being\n/// used, or produce an error (and return true) if a C++0x deleted\n/// function is being used.\n///\n/// \\returns true if there was an error (this declaration cannot be\n/// referenced), false otherwise.\n///\nbool Sema::DiagnoseUseOfDecl(NamedDecl *D, ArrayRef<SourceLocation> Locs, const ObjCInterfaceDecl *UnknownObjCClass, bool ObjCPropertyAccess, bool AvoidPartialAvailabilityChecks, ObjCInterfaceDecl *ClassReceiver, bool SkipTrailingRequiresClause) {\n if (const auto *EmptyD = dyn_cast<UnresolvedUsingIfExistsDecl>(D)) {\n Diag(EmptyD->getLocation(), diag::note_empty_using_if_exists_here);"}} | ||
}, | }, | ||
["note_enforce_read_only_placement"]={ | ["note_enforce_read_only_placement"]={ | ||
Line 4,057: | Line 4,057: | ||
[c]=o, | [c]=o, | ||
[m]={db,1625925174,eb}, | [m]={db,1625925174,eb}, | ||
[n]={{t, | [n]={{t,7439,"// This function emits warning and a corresponding note based on the\n// ReadOnlyPlacementAttr attribute. The warning checks that all global variable\n// declarations of an annotated type must be const qualified.\nvoid emitReadOnlyPlacementAttrWarning(Sema &S, const VarDecl *VD) {\n if (const auto *ConstDecl = RD->getAttr<ReadOnlyPlacementAttr>()) {\n S.Diag(ConstDecl->getLocation(), diag::note_enforce_read_only_placement);"}} | ||
}, | }, | ||
["note_enters_block_captures_cxx_obj"]={ | ["note_enters_block_captures_cxx_obj"]={ | ||
Line 4,069: | Line 4,069: | ||
[c]=o, | [c]=o, | ||
[m]={Vb,1310407494,Qb}, | [m]={Vb,1310407494,Qb}, | ||
[n]={{x, | [n]={{x,262,"/// Build scope information for a captured block literal variables.\nvoid JumpScopeChecker::BuildScopeInformation(VarDecl *D, const BlockDecl *BDecl, unsigned &ParentScope) {\n if (destructKind != QualType::DK_none) {\n case QualType::DK_cxx_destructor:\n Diags = ScopePair(diag::note_enters_block_captures_cxx_obj, diag::note_exits_block_captures_cxx_obj);"}} | ||
}, | }, | ||
["note_enters_block_captures_non_trivial_c_struct"]={ | ["note_enters_block_captures_non_trivial_c_struct"]={ | ||
Line 4,081: | Line 4,081: | ||
[c]=o, | [c]=o, | ||
[m]={"7275da0f2ee2",1519802155,"[ObjC] Allow declaring __strong pointer fields in structs in Objective-C"}, | [m]={"7275da0f2ee2",1519802155,"[ObjC] Allow declaring __strong pointer fields in structs in Objective-C"}, | ||
[n]={{x, | [n]={{x,274,"/// Build scope information for a captured block literal variables.\nvoid JumpScopeChecker::BuildScopeInformation(VarDecl *D, const BlockDecl *BDecl, unsigned &ParentScope) {\n if (destructKind != QualType::DK_none) {\n case QualType::DK_nontrivial_c_struct:\n Diags = ScopePair(diag::note_enters_block_captures_non_trivial_c_struct, diag::note_exits_block_captures_non_trivial_c_struct);"}} | ||
}, | }, | ||
["note_enters_block_captures_strong"]={ | ["note_enters_block_captures_strong"]={ | ||
Line 4,093: | Line 4,093: | ||
[c]=o, | [c]=o, | ||
[m]={Vb,1310407494,Qb}, | [m]={Vb,1310407494,Qb}, | ||
[n]={{x, | [n]={{x,266,"/// Build scope information for a captured block literal variables.\nvoid JumpScopeChecker::BuildScopeInformation(VarDecl *D, const BlockDecl *BDecl, unsigned &ParentScope) {\n if (destructKind != QualType::DK_none) {\n case QualType::DK_objc_strong_lifetime:\n Diags = ScopePair(diag::note_enters_block_captures_strong, diag::note_exits_block_captures_strong);"}} | ||
}, | }, | ||
["note_enters_block_captures_weak"]={ | ["note_enters_block_captures_weak"]={ | ||
Line 4,105: | Line 4,105: | ||
[c]=o, | [c]=o, | ||
[m]={Vb,1310407494,Qb}, | [m]={Vb,1310407494,Qb}, | ||
[n]={{x, | [n]={{x,270,"/// Build scope information for a captured block literal variables.\nvoid JumpScopeChecker::BuildScopeInformation(VarDecl *D, const BlockDecl *BDecl, unsigned &ParentScope) {\n if (destructKind != QualType::DK_none) {\n case QualType::DK_objc_weak_lifetime:\n Diags = ScopePair(diag::note_enters_block_captures_weak, diag::note_exits_block_captures_weak);"}} | ||
}, | }, | ||
["note_enters_compound_literal_scope"]={ | ["note_enters_compound_literal_scope"]={ | ||
Line 4,117: | Line 4,117: | ||
[c]=o, | [c]=o, | ||
[m]={yb,1576908663,Db}, | [m]={yb,1576908663,Db}, | ||
[n]={{x, | [n]={{x,293,"/// Build scope information for compound literals of C struct types that are\n/// non-trivial to destruct.\nvoid JumpScopeChecker::BuildScopeInformation(CompoundLiteralExpr *CLE, unsigned &ParentScope) {\n unsigned InDiag = diag::note_enters_compound_literal_scope;"}} | ||
}, | }, | ||
["note_enters_statement_expression"]={ | ["note_enters_statement_expression"]={ | ||
Line 4,129: | Line 4,129: | ||
[c]=o, | [c]=o, | ||
[m]={"202191060602",1688720293,"[Clang] Diagnose jumps into statement expressions"}, | [m]={"202191060602",1688720293,"[Clang] Diagnose jumps into statement expressions"}, | ||
[n]={{x, | [n]={{x,479,"/// BuildScopeInformation - The statements from CI to CE are known to form a\n/// coherent VLA scope with a specified parent node. Walk through the\n/// statements, adding any labels or gotos to LabelAndGotoScopes and recursively\n/// walking the AST as needed.\nvoid JumpScopeChecker::BuildScopeInformation(Stmt *S, unsigned &origParentScope) {\n case Stmt::StmtExprClass: {\n Scopes.push_back(GotoScope(ParentScope, diag::note_enters_statement_expression,"}} | ||
}, | }, | ||
["note_entity_declared_at"]={ | ["note_entity_declared_at"]={ | ||
Line 4,141: | Line 4,141: | ||
[c]=o, | [c]=o, | ||
[m]={"2afa8780d62a",1401279614,"Consolidate some note diagnostics"}, | [m]={"2afa8780d62a",1401279614,"Consolidate some note diagnostics"}, | ||
[n]={{y, | [n]={{y,6466,"/// Diagnose use of %s directive in an NSString which is being passed\n/// as formatting string to formatting method.\nstatic void DiagnoseCStringFormatDirectiveInCFAPI(Sema &S, const NamedDecl *FDecl, Expr **Args, unsigned NumArgs) {\n if (S.FormatStringHasSArg(FormatString)) {\n S.Diag(FDecl->getLocation(), diag::note_entity_declared_at) << FDecl->getDeclName();"},{cc,602,"/// Build a new nested-name-specifier for \"identifier::\", as described\n/// by ActOnCXXNestedNameSpecifier.\n///\n/// \\param S Scope in which the nested-name-specifier occurs.\n/// \\param IdInfo Parser information about an identifier in the\n/// nested-name-spec.\n/// \\param EnteringContext If true, enter the context specified by the\n/// nested-name-specifier.\n/// \\param SS Optional nested name specifier preceding the identifier.\n/// \\param ScopeLookupResult Provides the result of name lookup within the\n/// scope of the nested-name-specifier that was computed at template\n/// definition time.\n/// \\param ErrorRecoveryLookup Specifies if the method is called to improve\n/// error recovery and what kind of recovery is performed.\n/// \\param IsCorrectedToColon If not null, suggestion of replace \'::\' -> \':\'\n/// are allowed. The bool value pointed by this parameter is set to\n/// \'true\' if the identifier is treated as if it was followed by \':\',\n/// not \'::\'.\n/// \\param OnlyNamespace If true, only considers namespaces in lookup.\n///\n/// This routine differs only slightly from ActOnCXXNestedNameSpecifier, in\n/// that it contains an extra parameter \\p ScopeLookupResult, which provides\n/// the result of name lookup within the scope of the nested-name-specifier\n/// that was computed at template definition time.\n///\n/// If ErrorRecoveryLookup is true, then this call is used to improve error\n/// recovery. This means that it should not emit diagnostics, it should\n/// just return true on failure. It also means it should only return a valid\n/// scope if it *knows* that the result is correct. It should not return in a\n/// dependent context, for example. Nor will it extend \\p SS with the scope\n/// specifier.\nbool Sema::BuildCXXNestedNameSpecifier(Scope *S, NestedNameSpecInfo &IdInfo, bool EnteringContext, CXXScopeSpec &SS, NamedDecl *ScopeLookupResult, bool ErrorRecoveryLookup, bool *IsCorrectedToColon, bool OnlyNamespace) {\n if (Found.empty() && !ErrorRecoveryLookup) {\n if (!R.empty()) {\n if (NamedDecl *ND = R.getAsSingle<NamedDecl>())\n Diag(ND->getLocation(), diag::note_entity_declared_at) << IdInfo.Identifier;"},{cc,819,"/// Build a new nested-name-specifier for \"identifier::\", as described\n/// by ActOnCXXNestedNameSpecifier.\n///\n/// \\param S Scope in which the nested-name-specifier occurs.\n/// \\param IdInfo Parser information about an identifier in the\n/// nested-name-spec.\n/// \\param EnteringContext If true, enter the context specified by the\n/// nested-name-specifier.\n/// \\param SS Optional nested name specifier preceding the identifier.\n/// \\param ScopeLookupResult Provides the result of name lookup within the\n/// scope of the nested-name-specifier that was computed at template\n/// definition time.\n/// \\param ErrorRecoveryLookup Specifies if the method is called to improve\n/// error recovery and what kind of recovery is performed.\n/// \\param IsCorrectedToColon If not null, suggestion of replace \'::\' -> \':\'\n/// are allowed. The bool value pointed by this parameter is set to\n/// \'true\' if the identifier is treated as if it was followed by \':\',\n/// not \'::\'.\n/// \\param OnlyNamespace If true, only considers namespaces in lookup.\n///\n/// This routine differs only slightly from ActOnCXXNestedNameSpecifier, in\n/// that it contains an extra parameter \\p ScopeLookupResult, which provides\n/// the result of name lookup within the scope of the nested-name-specifier\n/// that was computed at template definition time.\n///\n/// If ErrorRecoveryLookup is true, then this call is used to improve error\n/// recovery. This means that it should not emit diagnostics, it should\n/// just return true on failure. It also means it should only return a valid\n/// scope if it *knows* that the result is correct. It should not return in a\n/// dependent context, for example. Nor will it extend \\p SS with the scope\n/// specifier.\nbool Sema::BuildCXXNestedNameSpecifier(Scope *S, NestedNameSpecInfo &IdInfo, bool EnteringContext, CXXScopeSpec &SS, NamedDecl *ScopeLookupResult, bool ErrorRecoveryLookup, bool *IsCorrectedToColon, bool OnlyNamespace) {\n if (!Found.empty()) {\n if (TypeDecl *TD = Found.getAsSingle<TypeDecl>()) {\n } else if (Found.getAsSingle<TemplateDecl>()) {\n } else {\n if (NamedDecl *ND = Found.getAsSingle<NamedDecl>())\n Diag(ND->getLocation(), diag::note_entity_declared_at) << IdInfo.Identifier;"},{t,9488,"static void checkIsValidOpenCLKernelParameter(Sema &S, Declarator &D, ParmVarDecl *Param, llvm::SmallPtrSetImpl<const Type *> &ValidTypes) {\n case InvalidKernelParam:\n // OpenCL v1.2 s6.8 n:\n // A kernel function argument cannot be declared\n // of event_t type.\n // Do not diagnose half type since it is diagnosed as invalid argument\n // type for any function elsewhere.\n if (!PT->isHalfType()) {\n while ((Typedef = PT->getAs<TypedefType>())) {\n // SourceLocation may be invalid for a built-in type.\n if (Loc.isValid())\n S.Diag(Loc, diag::note_entity_declared_at) << PT;"},{I,1464,"static void handlePreferredName(Sema &S, Decl *D, const ParsedAttr &AL) {\n if (const auto *TT = T->getAs<TypedefType>())\n S.Diag(TT->getDecl()->getLocation(), diag::note_entity_declared_at) << TT->getDecl();"},{q,2783,"/// Check the validity of a C++ base class specifier.\n///\n/// \\returns a new CXXBaseSpecifier if well-formed, emits diagnostics\n/// and returns NULL otherwise.\nCXXBaseSpecifier *Sema::CheckBaseSpecifier(CXXRecordDecl *Class, SourceRange SpecifierRange, bool Virtual, AccessSpecifier Access, TypeSourceInfo *TInfo, SourceLocation EllipsisLoc) {\n // C++ [class]p3:\n // If a class is marked final and it appears as a base-type-specifier in\n // base-clause, the program is ill-formed.\n if (FinalAttr *FA = CXXBaseDecl->getAttr<FinalAttr>()) {\n Diag(CXXBaseDecl->getLocation(), diag::note_entity_declared_at) << CXXBaseDecl->getDeclName() << FA->getRange();"},{q,6300,"static void checkForMultipleExportedDefaultConstructors(Sema &S, CXXRecordDecl *Class) {\n for (Decl *Member : Class->decls()) {\n if (LastExportedDefaultCtor) {\n S.Diag(CD->getLocation(), diag::note_entity_declared_at) << CD->getDeclName();"},{E,3925,"static void DiagnoseVariableSizedIvars(Sema &S, ObjCContainerDecl *OCD) {\n if (FirstIvar && (FirstIvar == IntfDecl->all_declared_ivar_begin())) {\n if (SuperClass) {\n if (IsVariableSizedType(LastIvar->getType())) {\n S.Diag(LastIvar->getLocation(), diag::note_entity_declared_at) << LastIvar->getDeclName();"},{r,197,"/// Check whether we\'re in an extern inline function and referring to a\n/// variable or function with internal linkage (C11 6.7.4p3).\n///\n/// This is only a warning because we used to silently accept this code, but\n/// in many cases it will not behave correctly. This is not enabled in C++ mode\n/// because the restriction language is a bit weaker (C++11 [basic.def.odr]p6)\n/// and so while there may still be user mistakes, most of the time we can\'t\n/// prove that there are errors.\nstatic void diagnoseUseOfInternalDeclInInlineFunction(Sema &S, const NamedDecl *D, SourceLocation Loc) {\n S.Diag(D->getCanonicalDecl()->getLocation(), diag::note_entity_declared_at) << D;"},{r,348,"/// Determine whether the use of this declaration is valid, and\n/// emit any corresponding diagnostics.\n///\n/// This routine diagnoses various problems with referencing\n/// declarations that can occur when using a declaration. For example,\n/// it might warn if a deprecated or unavailable declaration is being\n/// used, or produce an error (and return true) if a C++0x deleted\n/// function is being used.\n///\n/// \\returns true if there was an error (this declaration cannot be\n/// referenced), false otherwise.\n///\nbool Sema::DiagnoseUseOfDecl(NamedDecl *D, ArrayRef<SourceLocation> Locs, const ObjCInterfaceDecl *UnknownObjCClass, bool ObjCPropertyAccess, bool AvoidPartialAvailabilityChecks, ObjCInterfaceDecl *ClassReceiver, bool SkipTrailingRequiresClause) {\n if (LangOpts.OpenMP && DRD && !CurContext->containsDecl(D) && isa<VarDecl>(D)) {\n Diag(D->getLocation(), diag::note_entity_declared_at) << D;"},{r,361,"/// Determine whether the use of this declaration is valid, and\n/// emit any corresponding diagnostics.\n///\n/// This routine diagnoses various problems with referencing\n/// declarations that can occur when using a declaration. For example,\n/// it might warn if a deprecated or unavailable declaration is being\n/// used, or produce an error (and return true) if a C++0x deleted\n/// function is being used.\n///\n/// \\returns true if there was an error (this declaration cannot be\n/// referenced), false otherwise.\n///\nbool Sema::DiagnoseUseOfDecl(NamedDecl *D, ArrayRef<SourceLocation> Locs, const ObjCInterfaceDecl *UnknownObjCClass, bool ObjCPropertyAccess, bool AvoidPartialAvailabilityChecks, ObjCInterfaceDecl *ClassReceiver, bool SkipTrailingRequiresClause) {\n // [OpenMP 5.0], 2.19.7.3. declare mapper Directive, Restrictions\n // List-items in map clauses on this construct may only refer to the declared\n // variable var and entities that could be referenced by a procedure defined\n // at the same location.\n // [OpenMP 5.2] Also allow iterator declared variables.\n if (LangOpts.OpenMP && isa<VarDecl>(D) && !isOpenMPDeclareMapperVarDeclAllowed(cast<VarDecl>(D))) {\n Diag(D->getLocation(), diag::note_entity_declared_at) << D;"},{r,406,"/// Determine whether the use of this declaration is valid, and\n/// emit any corresponding diagnostics.\n///\n/// This routine diagnoses various problems with referencing\n/// declarations that can occur when using a declaration. For example,\n/// it might warn if a deprecated or unavailable declaration is being\n/// used, or produce an error (and return true) if a C++0x deleted\n/// function is being used.\n///\n/// \\returns true if there was an error (this declaration cannot be\n/// referenced), false otherwise.\n///\nbool Sema::DiagnoseUseOfDecl(NamedDecl *D, ArrayRef<SourceLocation> Locs, const ObjCInterfaceDecl *UnknownObjCClass, bool ObjCPropertyAccess, bool AvoidPartialAvailabilityChecks, ObjCInterfaceDecl *ClassReceiver, bool SkipTrailingRequiresClause) {\n if (isa<ParmVarDecl>(D) && isa<RequiresExprBodyDecl>(D->getDeclContext()) && !isUnevaluatedContext()) {\n Diag(D->getLocation(), diag::note_entity_declared_at) << D;"},{r,19155,"void diagnoseUncapturableValueReferenceOrBinding(Sema &S, SourceLocation loc, ValueDecl *var) {\n S.Diag(var->getLocation(), diag::note_entity_declared_at) << var;"},{r,19230,"// Certain capturing entities (lambdas, blocks etc.) are not allowed to capture\n// certain types of variables (unnamed, variably modified types etc.)\n// so check for eligibility.\nstatic bool isVariableCapturable(CapturingScopeInfo *CSI, ValueDecl *Var, SourceLocation Loc, const bool Diagnose, Sema &S) {\n if (isa<BindingDecl>(Var)) {\n if (!IsLambda || !S.getLangOpts().CPlusPlus) {\n } else if (Diagnose && S.getLangOpts().CPlusPlus) {\n S.Diag(Var->getLocation(), diag::note_entity_declared_at) << Var;"},{r,19354,"/// Capture the given variable in the lambda.\nstatic bool captureInLambda(LambdaScopeInfo *LSI, ValueDecl *Var, SourceLocation Loc, const bool BuildAndDiagnose, QualType &CaptureType, QualType &DeclRefType, const bool RefersToCapturedVariable, const Sema::TryCaptureKind Kind, SourceLocation EllipsisLoc, const bool IsTopScope, Sema &S, bool Invalid) {\n // FIXME: We should support capturing structured bindings in OpenMP.\n if (!Invalid && BD && S.LangOpts.OpenMP) {\n if (BuildAndDiagnose) {\n S.Diag(Var->getLocation(), diag::note_entity_declared_at) << Var;"},{r,20837,"bool Sema::CheckCallReturnType(QualType ReturnType, SourceLocation Loc, CallExpr *CE, FunctionDecl *FD) {\n class CallReturnIncompleteDiagnoser : public TypeDiagnoser {\n void diagnose(Sema &S, SourceLocation Loc, QualType T) override {\n S.Diag(FD->getLocation(), diag::note_entity_declared_at) << FD->getDeclName();"},{s,1401,"ExprResult Sema::ParseObjCProtocolExpression(IdentifierInfo *ProtocolId, SourceLocation AtLoc, SourceLocation ProtoLoc, SourceLocation LParenLoc, SourceLocation ProtoIdLoc, SourceLocation RParenLoc) {\n if (!PDecl->hasDefinition()) {\n Diag(PDecl->getLocation(), diag::note_entity_declared_at) << PDecl;"},{u,7822,"/// Check a template argument against its corresponding\n/// template template parameter.\n///\n/// This routine implements the semantics of C++ [temp.arg.template].\n/// It returns true if an error occurred, and false otherwise.\nbool Sema::CheckTemplateTemplateArgument(TemplateTemplateParmDecl *Param, TemplateParameterList *Params, TemplateArgumentLoc &Arg) {\n // C++1z [temp.arg.template]p3: (DR 150)\n // A template-argument matches a template template-parameter P when P\n // is at least as specialized as the template-argument A.\n // FIXME: We should enable RelaxedTemplateTemplateArgs by default as it is a\n // defect report resolution from C++17 and shouldn\'t be introduced by\n // concepts.\n if (getLangOpts().RelaxedTemplateTemplateArgs) {\n if (isTemplateTemplateParameterAtLeastAsSpecializedAs(Params, Template, Arg.getLocation())) {\n if (!IsParamAtLeastAsConstrained) {\n Diag(Param->getLocation(), diag::note_entity_declared_at) << Param;"},{u,7823,"/// Check a template argument against its corresponding\n/// template template parameter.\n///\n/// This routine implements the semantics of C++ [temp.arg.template].\n/// It returns true if an error occurred, and false otherwise.\nbool Sema::CheckTemplateTemplateArgument(TemplateTemplateParmDecl *Param, TemplateParameterList *Params, TemplateArgumentLoc &Arg) {\n // C++1z [temp.arg.template]p3: (DR 150)\n // A template-argument matches a template template-parameter P when P\n // is at least as specialized as the template-argument A.\n // FIXME: We should enable RelaxedTemplateTemplateArgs by default as it is a\n // defect report resolution from C++17 and shouldn\'t be introduced by\n // concepts.\n if (getLangOpts().RelaxedTemplateTemplateArgs) {\n if (isTemplateTemplateParameterAtLeastAsSpecializedAs(Params, Template, Arg.getLocation())) {\n if (!IsParamAtLeastAsConstrained) {\n Diag(Template->getLocation(), diag::note_entity_declared_at) << Template;"}} | ||
}, | }, | ||
["note_enum_specialized_here"]={ | ["note_enum_specialized_here"]={ | ||
Line 4,153: | Line 4,153: | ||
[c]=o, | [c]=o, | ||
[m]={"169f2190013d",1332793696,"Add a special-case diagnostic for one of the more obnoxious special cases of"}, | [m]={"169f2190013d",1332793696,"Add a special-case diagnostic for one of the more obnoxious special cases of"}, | ||
[n]={{dc, | [n]={{dc,6337,"/// Find the instantiation of the given declaration within the\n/// current instantiation.\n///\n/// This routine is intended to be used when \\p D is a declaration\n/// referenced from within a template, that needs to mapped into the\n/// corresponding declaration within an instantiation. For example,\n/// given:\n///\n/// \\code\n/// template<typename T>\n/// struct X {\n/// enum Kind {\n/// KnownValue = sizeof(T)\n/// };\n///\n/// bool getKind() const { return KnownValue; }\n/// };\n///\n/// template struct X<int>;\n/// \\endcode\n///\n/// In the instantiation of X<int>::getKind(), we need to map the \\p\n/// EnumConstantDecl for \\p KnownValue (which refers to\n/// X<T>::<Kind>::KnownValue) to its instantiation (X<int>::<Kind>::KnownValue).\n/// \\p FindInstantiatedDecl performs this mapping from within the instantiation\n/// of X<int>.\nNamedDecl *Sema::FindInstantiatedDecl(SourceLocation Loc, NamedDecl *D, const MultiLevelTemplateArgumentList &TemplateArgs, bool FindingInstantiatedContext) {\n if (ParentDC != D->getDeclContext()) {\n if (!Result) {\n if (isa<UsingShadowDecl>(D)) {\n } else if (hasUncompilableErrorOccurred()) {\n } else if (IsBeingInstantiated) {\n } else if (EnumConstantDecl *ED = dyn_cast<EnumConstantDecl>(D)) {\n Diag(Spec->getLocation(), diag::note_enum_specialized_here) << Context.getTypeDeclType(Spec);"}} | ||
}, | }, | ||
["note_equality_comparison_silence"]={ | ["note_equality_comparison_silence"]={ | ||
Line 4,165: | Line 4,165: | ||
[c]=o, | [c]=o, | ||
[m]={"8b6ec6870f65",1296584662,"Warn for \"if ((a == b))\" where the equality expression is needlessly wrapped inside parentheses."}, | [m]={"8b6ec6870f65",1296584662,"Warn for \"if ((a == b))\" where the equality expression is needlessly wrapped inside parentheses."}, | ||
[n]={{r, | [n]={{r,20914,"/// Redundant parentheses over an equality comparison can indicate\n/// that the user intended an assignment used as condition.\nvoid Sema::DiagnoseEqualityWithExtraParens(ParenExpr *ParenE) {\n if (BinaryOperator *opE = dyn_cast<BinaryOperator>(E))\n if (opE->getOpcode() == BO_EQ && opE->getLHS()->IgnoreParenImpCasts()->isModifiableLvalue(Context) == Expr::MLV_Valid) {\n Diag(Loc, diag::note_equality_comparison_silence) << FixItHint::CreateRemoval(ParenERange.getBegin()) << FixItHint::CreateRemoval(ParenERange.getEnd());"}} | ||
}, | }, | ||
["note_equality_comparison_to_assign"]={ | ["note_equality_comparison_to_assign"]={ | ||
Line 4,177: | Line 4,177: | ||
[c]=o, | [c]=o, | ||
[m]={"8b6ec6870f65",1296584662,"Warn for \"if ((a == b))\" where the equality expression is needlessly wrapped inside parentheses."}, | [m]={"8b6ec6870f65",1296584662,"Warn for \"if ((a == b))\" where the equality expression is needlessly wrapped inside parentheses."}, | ||
[n]={{r, | [n]={{r,20940,"/// Redundant parentheses over an equality comparison can indicate\n/// that the user intended an assignment used as condition.\nvoid Sema::DiagnoseEqualityWithExtraParens(ParenExpr *ParenE) {\n if (BinaryOperator *opE = dyn_cast<BinaryOperator>(E))\n if (opE->getOpcode() == BO_EQ && opE->getLHS()->IgnoreParenImpCasts()->isModifiableLvalue(Context) == Expr::MLV_Valid) {\n Diag(Loc, diag::note_equality_comparison_to_assign) << FixItHint::CreateReplacement(Loc, \"=\");"},{A,195,"/// Diagnose unused comparisons, both builtin and overloaded operators.\n/// For \'==\' and \'!=\', suggest fixits for \'=\' or \'|=\'.\n///\n/// Adding a cast to void (or other expression wrappers) will prevent the\n/// warning from firing.\nstatic bool DiagnoseUnusedComparison(Sema &S, const Expr *E) {\n // If the LHS is a plausible entity to assign to, provide a fixit hint to\n // correct common typos.\n if (CanAssign) {\n if (Kind == Inequality)\n else if (Kind == Equality)\n S.Diag(Loc, diag::note_equality_comparison_to_assign) << FixItHint::CreateReplacement(Loc, \"=\");"}} | ||
}, | }, | ||
["note_equivalent_internal_linkage_decl"]={ | ["note_equivalent_internal_linkage_decl"]={ | ||
Line 4,189: | Line 4,189: | ||
[c]=Sb, | [c]=Sb, | ||
[m]={"2dbe4043e8f5",1446665192,"[modules] Generalize the workaround for multiple ambiguous definitions of"}, | [m]={"2dbe4043e8f5",1446665192,"[modules] Generalize the workaround for multiple ambiguous definitions of"}, | ||
[n]={{P, | [n]={{P,10306,"void Sema::diagnoseEquivalentInternalLinkageDeclarations(SourceLocation Loc, const NamedDecl *D, ArrayRef<const NamedDecl *> Equiv) {\n Diag(D->getLocation(), diag::note_equivalent_internal_linkage_decl) << !M << (M ? M->getFullModuleName() : \"\");"},{P,10311,"void Sema::diagnoseEquivalentInternalLinkageDeclarations(SourceLocation Loc, const NamedDecl *D, ArrayRef<const NamedDecl *> Equiv) {\n for (auto *E : Equiv) {\n Diag(E->getLocation(), diag::note_equivalent_internal_linkage_decl) << !M << (M ? M->getFullModuleName() : \"\");"}} | ||
}, | }, | ||
["note_evaluate_comparison_first"]={ | ["note_evaluate_comparison_first"]={ | ||
Line 4,201: | Line 4,201: | ||
[c]=o, | [c]=o, | ||
[m]={"fe042e6aab26",1366164765,"Add warning group -Woverloaded-shift-op-parentheses to -Wparentheses. This"}, | [m]={"fe042e6aab26",1366164765,"Add warning group -Woverloaded-shift-op-parentheses to -Wparentheses. This"}, | ||
[n]={{r, | [n]={{r,16033,"static void DiagnoseShiftCompare(Sema &S, SourceLocation OpLoc, Expr *LHSExpr, Expr *RHSExpr) {\n SuggestParentheses(S, OpLoc, S.PDiag(diag::note_evaluate_comparison_first), SourceRange(OCE->getArg(1)->getBeginLoc(), RHSExpr->getEndLoc()));"}} | ||
}, | }, | ||
["note_evaluating_exception_spec_here"]={ | ["note_evaluating_exception_spec_here"]={ | ||
Line 4,213: | Line 4,213: | ||
[c]=o, | [c]=o, | ||
[m]={"5159bbad8b2b",1536186637,"PR38627: Fix handling of exception specification adjustment for"}, | [m]={"5159bbad8b2b",1536186637,"PR38627: Fix handling of exception specification adjustment for"}, | ||
[n]={{z, | [n]={{z,927,"/// Prints the current instantiation stack through a series of\n/// notes.\nvoid Sema::PrintInstantiationStack() {\n for (SmallVectorImpl<CodeSynthesisContext>::reverse_iterator Active = CodeSynthesisContexts.rbegin(), ActiveEnd = CodeSynthesisContexts.rend(); Active != ActiveEnd; ++Active, ++InstantiationIdx) {\n case CodeSynthesisContext::ExceptionSpecEvaluation:\n Diags.Report(Active->PointOfInstantiation, diag::note_evaluating_exception_spec_here) << cast<FunctionDecl>(Active->Entity);"}} | ||
}, | }, | ||
["note_exception_spec_deprecated"]={ | ["note_exception_spec_deprecated"]={ | ||
Line 4,225: | Line 4,225: | ||
[c]=Q, | [c]=Q, | ||
[m]={"8ca78a16f4a5",1371088971,"Add -Wdeprecated warnings and fixits for things deprecated in C++11:"}, | [m]={"8ca78a16f4a5",1371088971,"Add -Wdeprecated warnings and fixits for things deprecated in C++11:"}, | ||
[n]={{"clang/lib/Parse/ParseDeclCXX.cpp", | [n]={{"clang/lib/Parse/ParseDeclCXX.cpp",4013,"static void diagnoseDynamicExceptionSpecification(Parser &P, SourceRange Range, bool IsNoexcept) {\n if (P.getLangOpts().CPlusPlus11) {\n P.Diag(Range.getBegin(), diag::note_exception_spec_deprecated) << Replacement << FixItHint::CreateReplacement(Range, Replacement);"}} | ||
}, | }, | ||
["note_exits___block"]={ | ["note_exits___block"]={ | ||
Line 4,237: | Line 4,237: | ||
[c]=o, | [c]=o, | ||
[m]={U,1273625893,X}, | [m]={U,1273625893,X}, | ||
[n]={{x, | [n]={{x,153,"/// GetDiagForGotoScopeDecl - If this decl induces a new goto scope, return a\n/// diagnostic that should be emitted if control goes over it. If not, return 0.\nstatic ScopePair GetDiagForGotoScopeDecl(Sema &S, const Decl *D) {\n if (const VarDecl *VD = dyn_cast<VarDecl>(D)) {\n if (VD->hasAttr<BlocksAttr>())\n return ScopePair(diag::note_protected_by___block, diag::note_exits___block);"}} | ||
}, | }, | ||
["note_exits_block_captures_cxx_obj"]={ | ["note_exits_block_captures_cxx_obj"]={ | ||
Line 4,249: | Line 4,249: | ||
[c]=o, | [c]=o, | ||
[m]={Vb,1310407494,Qb}, | [m]={Vb,1310407494,Qb}, | ||
[n]={{x, | [n]={{x,263,"/// Build scope information for a captured block literal variables.\nvoid JumpScopeChecker::BuildScopeInformation(VarDecl *D, const BlockDecl *BDecl, unsigned &ParentScope) {\n if (destructKind != QualType::DK_none) {\n case QualType::DK_cxx_destructor:\n Diags = ScopePair(diag::note_enters_block_captures_cxx_obj, diag::note_exits_block_captures_cxx_obj);"}} | ||
}, | }, | ||
["note_exits_block_captures_non_trivial_c_struct"]={ | ["note_exits_block_captures_non_trivial_c_struct"]={ | ||
Line 4,261: | Line 4,261: | ||
[c]=o, | [c]=o, | ||
[m]={"7275da0f2ee2",1519802155,"[ObjC] Allow declaring __strong pointer fields in structs in Objective-C"}, | [m]={"7275da0f2ee2",1519802155,"[ObjC] Allow declaring __strong pointer fields in structs in Objective-C"}, | ||
[n]={{x, | [n]={{x,275,"/// Build scope information for a captured block literal variables.\nvoid JumpScopeChecker::BuildScopeInformation(VarDecl *D, const BlockDecl *BDecl, unsigned &ParentScope) {\n if (destructKind != QualType::DK_none) {\n case QualType::DK_nontrivial_c_struct:\n Diags = ScopePair(diag::note_enters_block_captures_non_trivial_c_struct, diag::note_exits_block_captures_non_trivial_c_struct);"}} | ||
}, | }, | ||
["note_exits_block_captures_strong"]={ | ["note_exits_block_captures_strong"]={ | ||
Line 4,273: | Line 4,273: | ||
[c]=o, | [c]=o, | ||
[m]={Vb,1310407494,Qb}, | [m]={Vb,1310407494,Qb}, | ||
[n]={{x, | [n]={{x,267,"/// Build scope information for a captured block literal variables.\nvoid JumpScopeChecker::BuildScopeInformation(VarDecl *D, const BlockDecl *BDecl, unsigned &ParentScope) {\n if (destructKind != QualType::DK_none) {\n case QualType::DK_objc_strong_lifetime:\n Diags = ScopePair(diag::note_enters_block_captures_strong, diag::note_exits_block_captures_strong);"}} | ||
}, | }, | ||
["note_exits_block_captures_weak"]={ | ["note_exits_block_captures_weak"]={ | ||
Line 4,285: | Line 4,285: | ||
[c]=o, | [c]=o, | ||
[m]={Vb,1310407494,Qb}, | [m]={Vb,1310407494,Qb}, | ||
[n]={{x, | [n]={{x,271,"/// Build scope information for a captured block literal variables.\nvoid JumpScopeChecker::BuildScopeInformation(VarDecl *D, const BlockDecl *BDecl, unsigned &ParentScope) {\n if (destructKind != QualType::DK_none) {\n case QualType::DK_objc_weak_lifetime:\n Diags = ScopePair(diag::note_enters_block_captures_weak, diag::note_exits_block_captures_weak);"}} | ||
}, | }, | ||
["note_exits_cleanup"]={ | ["note_exits_cleanup"]={ | ||
Line 4,297: | Line 4,297: | ||
[c]=o, | [c]=o, | ||
[m]={U,1273625893,X}, | [m]={U,1273625893,X}, | ||
[n]={{x, | [n]={{x,157,"/// GetDiagForGotoScopeDecl - If this decl induces a new goto scope, return a\n/// diagnostic that should be emitted if control goes over it. If not, return 0.\nstatic ScopePair GetDiagForGotoScopeDecl(Sema &S, const Decl *D) {\n if (const VarDecl *VD = dyn_cast<VarDecl>(D)) {\n if (VD->hasAttr<CleanupAttr>())\n return ScopePair(diag::note_protected_by_cleanup, diag::note_exits_cleanup);"}} | ||
}, | }, | ||
["note_exits_compound_literal_scope"]={ | ["note_exits_compound_literal_scope"]={ | ||
Line 4,309: | Line 4,309: | ||
[c]=o, | [c]=o, | ||
[m]={yb,1576908663,Db}, | [m]={yb,1576908663,Db}, | ||
[n]={{x, | [n]={{x,294,"/// Build scope information for compound literals of C struct types that are\n/// non-trivial to destruct.\nvoid JumpScopeChecker::BuildScopeInformation(CompoundLiteralExpr *CLE, unsigned &ParentScope) {\n unsigned OutDiag = diag::note_exits_compound_literal_scope;"}} | ||
}, | }, | ||
["note_exits_cxx_catch"]={ | ["note_exits_cxx_catch"]={ | ||
Line 4,321: | Line 4,321: | ||
[c]=o, | [c]=o, | ||
[m]={U,1273625893,X}, | [m]={U,1273625893,X}, | ||
[n]={{x, | [n]={{x,420,"/// BuildScopeInformation - The statements from CI to CE are known to form a\n/// coherent VLA scope with a specified parent node. Walk through the\n/// statements, adding any labels or gotos to LabelAndGotoScopes and recursively\n/// walking the AST as needed.\nvoid JumpScopeChecker::BuildScopeInformation(Stmt *S, unsigned &origParentScope) {\n case Stmt::CXXTryStmtClass: {\n // Jump from the catch into the try is not allowed either.\n for (unsigned I = 0, E = TS->getNumHandlers(); I != E; ++I) {\n Scopes.push_back(GotoScope(ParentScope, diag::note_protected_by_cxx_catch, diag::note_exits_cxx_catch, CS->getSourceRange().getBegin()));"}} | ||
}, | }, | ||
["note_exits_cxx_try"]={ | ["note_exits_cxx_try"]={ | ||
Line 4,333: | Line 4,333: | ||
[c]=o, | [c]=o, | ||
[m]={U,1273625893,X}, | [m]={U,1273625893,X}, | ||
[n]={{x, | [n]={{x,408,"/// BuildScopeInformation - The statements from CI to CE are known to form a\n/// coherent VLA scope with a specified parent node. Walk through the\n/// statements, adding any labels or gotos to LabelAndGotoScopes and recursively\n/// walking the AST as needed.\nvoid JumpScopeChecker::BuildScopeInformation(Stmt *S, unsigned &origParentScope) {\n case Stmt::CXXTryStmtClass: {\n {\n Scopes.push_back(GotoScope(ParentScope, diag::note_protected_by_cxx_try, diag::note_exits_cxx_try, TS->getSourceRange().getBegin()));"}} | ||
}, | }, | ||
["note_exits_dtor"]={ | ["note_exits_dtor"]={ | ||
Line 4,345: | Line 4,345: | ||
[c]=o, | [c]=o, | ||
[m]={U,1273625893,X}, | [m]={U,1273625893,X}, | ||
[n]={{x, | [n]={{x,171,"/// GetDiagForGotoScopeDecl - If this decl induces a new goto scope, return a\n/// diagnostic that should be emitted if control goes over it. If not, return 0.\nstatic ScopePair GetDiagForGotoScopeDecl(Sema &S, const Decl *D) {\n if (const VarDecl *VD = dyn_cast<VarDecl>(D)) {\n if (VD->hasLocalStorage()) {\n case QualType::DK_nontrivial_c_struct:\n return ScopePair(diag::note_protected_by_non_trivial_c_struct_init, diag::note_exits_dtor);"},{x,174,"/// GetDiagForGotoScopeDecl - If this decl induces a new goto scope, return a\n/// diagnostic that should be emitted if control goes over it. If not, return 0.\nstatic ScopePair GetDiagForGotoScopeDecl(Sema &S, const Decl *D) {\n if (const VarDecl *VD = dyn_cast<VarDecl>(D)) {\n if (VD->hasLocalStorage()) {\n case QualType::DK_cxx_destructor:\n OutDiag = diag::note_exits_dtor;"}} | ||
}, | }, | ||
["note_exits_objc_autoreleasepool"]={ | ["note_exits_objc_autoreleasepool"]={ | ||
Line 4,357: | Line 4,357: | ||
[c]=o, | [c]=o, | ||
[m]={Ib,1308178962,Hb}, | [m]={Ib,1308178962,Hb}, | ||
[n]={{x, | [n]={{x,551,"/// BuildScopeInformation - The statements from CI to CE are known to form a\n/// coherent VLA scope with a specified parent node. Walk through the\n/// statements, adding any labels or gotos to LabelAndGotoScopes and recursively\n/// walking the AST as needed.\nvoid JumpScopeChecker::BuildScopeInformation(Stmt *S, unsigned &origParentScope) {\n case Stmt::ObjCAutoreleasePoolStmtClass: {\n Scopes.push_back(GotoScope(ParentScope, diag::note_protected_by_objc_autoreleasepool, diag::note_exits_objc_autoreleasepool, AS->getAtLoc()));"}} | ||
}, | }, | ||
["note_exits_objc_catch"]={ | ["note_exits_objc_catch"]={ | ||
Line 4,369: | Line 4,369: | ||
[c]=o, | [c]=o, | ||
[m]={U,1273625893,X}, | [m]={U,1273625893,X}, | ||
[n]={{x, | [n]={{x,505,"/// BuildScopeInformation - The statements from CI to CE are known to form a\n/// coherent VLA scope with a specified parent node. Walk through the\n/// statements, adding any labels or gotos to LabelAndGotoScopes and recursively\n/// walking the AST as needed.\nvoid JumpScopeChecker::BuildScopeInformation(Stmt *S, unsigned &origParentScope) {\n case Stmt::ObjCAtTryStmtClass: {\n // Jump from the catch to the finally or try is not valid.\n for (ObjCAtCatchStmt *AC : AT->catch_stmts()) {\n Scopes.push_back(GotoScope(ParentScope, diag::note_protected_by_objc_catch, diag::note_exits_objc_catch, AC->getAtCatchLoc()));"}} | ||
}, | }, | ||
["note_exits_objc_finally"]={ | ["note_exits_objc_finally"]={ | ||
Line 4,381: | Line 4,381: | ||
[c]=o, | [c]=o, | ||
[m]={U,1273625893,X}, | [m]={U,1273625893,X}, | ||
[n]={{x, | [n]={{x,516,"/// BuildScopeInformation - The statements from CI to CE are known to form a\n/// coherent VLA scope with a specified parent node. Walk through the\n/// statements, adding any labels or gotos to LabelAndGotoScopes and recursively\n/// walking the AST as needed.\nvoid JumpScopeChecker::BuildScopeInformation(Stmt *S, unsigned &origParentScope) {\n case Stmt::ObjCAtTryStmtClass: {\n // Jump from the finally to the try or catch is not valid.\n if (ObjCAtFinallyStmt *AF = AT->getFinallyStmt()) {\n Scopes.push_back(GotoScope(ParentScope, diag::note_protected_by_objc_finally, diag::note_exits_objc_finally, AF->getAtFinallyLoc()));"}} | ||
}, | }, | ||
["note_exits_objc_strong"]={ | ["note_exits_objc_strong"]={ | ||
Line 4,393: | Line 4,393: | ||
[c]=o, | [c]=o, | ||
[m]={"039f2bbd02ce",1445450798,"Some minor ARC diagnostic improvements."}, | [m]={"039f2bbd02ce",1445450798,"Some minor ARC diagnostic improvements."}, | ||
[n]={{x, | [n]={{x,163,"/// GetDiagForGotoScopeDecl - If this decl induces a new goto scope, return a\n/// diagnostic that should be emitted if control goes over it. If not, return 0.\nstatic ScopePair GetDiagForGotoScopeDecl(Sema &S, const Decl *D) {\n if (const VarDecl *VD = dyn_cast<VarDecl>(D)) {\n if (VD->hasLocalStorage()) {\n case QualType::DK_objc_strong_lifetime:\n return ScopePair(diag::note_protected_by_objc_strong_init, diag::note_exits_objc_strong);"}} | ||
}, | }, | ||
["note_exits_objc_synchronized"]={ | ["note_exits_objc_synchronized"]={ | ||
Line 4,405: | Line 4,405: | ||
[c]=o, | [c]=o, | ||
[m]={U,1273625893,X}, | [m]={U,1273625893,X}, | ||
[n]={{x, | [n]={{x,537,"/// BuildScopeInformation - The statements from CI to CE are known to form a\n/// coherent VLA scope with a specified parent node. Walk through the\n/// statements, adding any labels or gotos to LabelAndGotoScopes and recursively\n/// walking the AST as needed.\nvoid JumpScopeChecker::BuildScopeInformation(Stmt *S, unsigned &origParentScope) {\n case Stmt::ObjCAtSynchronizedStmtClass: {\n Scopes.push_back(GotoScope(ParentScope, diag::note_protected_by_objc_synchronized, diag::note_exits_objc_synchronized, AS->getAtSynchronizedLoc()));"}} | ||
}, | }, | ||
["note_exits_objc_try"]={ | ["note_exits_objc_try"]={ | ||
Line 4,417: | Line 4,417: | ||
[c]=o, | [c]=o, | ||
[m]={U,1273625893,X}, | [m]={U,1273625893,X}, | ||
[n]={{x, | [n]={{x,494,"/// BuildScopeInformation - The statements from CI to CE are known to form a\n/// coherent VLA scope with a specified parent node. Walk through the\n/// statements, adding any labels or gotos to LabelAndGotoScopes and recursively\n/// walking the AST as needed.\nvoid JumpScopeChecker::BuildScopeInformation(Stmt *S, unsigned &origParentScope) {\n case Stmt::ObjCAtTryStmtClass: {\n // Recursively walk the AST for the @try part.\n {\n Scopes.push_back(GotoScope(ParentScope, diag::note_protected_by_objc_try, diag::note_exits_objc_try, AT->getAtTryLoc()));"}} | ||
}, | }, | ||
["note_exits_objc_weak"]={ | ["note_exits_objc_weak"]={ | ||
Line 4,429: | Line 4,429: | ||
[c]=o, | [c]=o, | ||
[m]={"039f2bbd02ce",1445450798,"Some minor ARC diagnostic improvements."}, | [m]={"039f2bbd02ce",1445450798,"Some minor ARC diagnostic improvements."}, | ||
[n]={{x, | [n]={{x,167,"/// GetDiagForGotoScopeDecl - If this decl induces a new goto scope, return a\n/// diagnostic that should be emitted if control goes over it. If not, return 0.\nstatic ScopePair GetDiagForGotoScopeDecl(Sema &S, const Decl *D) {\n if (const VarDecl *VD = dyn_cast<VarDecl>(D)) {\n if (VD->hasLocalStorage()) {\n case QualType::DK_objc_weak_lifetime:\n return ScopePair(diag::note_protected_by_objc_weak_init, diag::note_exits_objc_weak);"}} | ||
}, | }, | ||
["note_exits_seh_except"]={ | ["note_exits_seh_except"]={ | ||
Line 4,441: | Line 4,441: | ||
[c]=o, | [c]=o, | ||
[m]={"b14f87226902",1422983168,"Implement jump scope SEHmantic analysis."}, | [m]={"b14f87226902",1422983168,"Implement jump scope SEHmantic analysis."}, | ||
[n]={{x, | [n]={{x,444,"/// BuildScopeInformation - The statements from CI to CE are known to form a\n/// coherent VLA scope with a specified parent node. Walk through the\n/// statements, adding any labels or gotos to LabelAndGotoScopes and recursively\n/// walking the AST as needed.\nvoid JumpScopeChecker::BuildScopeInformation(Stmt *S, unsigned &origParentScope) {\n case Stmt::SEHTryStmtClass: {\n // Jump from __except or __finally into the __try are not allowed either.\n if (SEHExceptStmt *Except = TS->getExceptHandler()) {\n Scopes.push_back(GotoScope(ParentScope, diag::note_protected_by_seh_except, diag::note_exits_seh_except, Except->getSourceRange().getBegin()));"}} | ||
}, | }, | ||
["note_exits_seh_finally"]={ | ["note_exits_seh_finally"]={ | ||
Line 4,453: | Line 4,453: | ||
[c]=o, | [c]=o, | ||
[m]={"b14f87226902",1422983168,"Implement jump scope SEHmantic analysis."}, | [m]={"b14f87226902",1422983168,"Implement jump scope SEHmantic analysis."}, | ||
[n]={{x, | [n]={{x,451,"/// BuildScopeInformation - The statements from CI to CE are known to form a\n/// coherent VLA scope with a specified parent node. Walk through the\n/// statements, adding any labels or gotos to LabelAndGotoScopes and recursively\n/// walking the AST as needed.\nvoid JumpScopeChecker::BuildScopeInformation(Stmt *S, unsigned &origParentScope) {\n case Stmt::SEHTryStmtClass: {\n // Jump from __except or __finally into the __try are not allowed either.\n if (SEHExceptStmt *Except = TS->getExceptHandler()) {\n } else if (SEHFinallyStmt *Finally = TS->getFinallyHandler()) {\n Scopes.push_back(GotoScope(ParentScope, diag::note_protected_by_seh_finally, diag::note_exits_seh_finally, Finally->getSourceRange().getBegin()));"}} | ||
}, | }, | ||
["note_exits_seh_try"]={ | ["note_exits_seh_try"]={ | ||
Line 4,465: | Line 4,465: | ||
[c]=o, | [c]=o, | ||
[m]={"b14f87226902",1422983168,"Implement jump scope SEHmantic analysis."}, | [m]={"b14f87226902",1422983168,"Implement jump scope SEHmantic analysis."}, | ||
[n]={{x, | [n]={{x,433,"/// BuildScopeInformation - The statements from CI to CE are known to form a\n/// coherent VLA scope with a specified parent node. Walk through the\n/// statements, adding any labels or gotos to LabelAndGotoScopes and recursively\n/// walking the AST as needed.\nvoid JumpScopeChecker::BuildScopeInformation(Stmt *S, unsigned &origParentScope) {\n case Stmt::SEHTryStmtClass: {\n {\n Scopes.push_back(GotoScope(ParentScope, diag::note_protected_by_seh_try, diag::note_exits_seh_try, TS->getSourceRange().getBegin()));"}} | ||
}, | }, | ||
["note_exits_temporary_dtor"]={ | ["note_exits_temporary_dtor"]={ | ||
Line 4,477: | Line 4,477: | ||
[c]=o, | [c]=o, | ||
[m]={"c934e4fd2ce2",1386811622,"PR18217: Rewrite JumpDiagnostics\' handling of temporaries, to correctly handle"}, | [m]={"c934e4fd2ce2",1386811622,"PR18217: Rewrite JumpDiagnostics\' handling of temporaries, to correctly handle"}, | ||
[n]={{x, | [n]={{x,588,"/// BuildScopeInformation - The statements from CI to CE are known to form a\n/// coherent VLA scope with a specified parent node. Walk through the\n/// statements, adding any labels or gotos to LabelAndGotoScopes and recursively\n/// walking the AST as needed.\nvoid JumpScopeChecker::BuildScopeInformation(Stmt *S, unsigned &origParentScope) {\n case Stmt::MaterializeTemporaryExprClass: {\n if (MTE->getStorageDuration() == SD_Automatic) {\n if (ExtendedObject->getType().isDestructedType()) {\n Scopes.push_back(GotoScope(ParentScope, 0, diag::note_exits_temporary_dtor, ExtendedObject->getExprLoc()));"}} | ||
}, | }, | ||
["note_explicit_ctor_deduction_guide_here"]={ | ["note_explicit_ctor_deduction_guide_here"]={ | ||
Line 4,489: | Line 4,489: | ||
[c]=o, | [c]=o, | ||
[m]={"60437620db8e",1486667864,"[c++1z] P0091R3: Basic support for deducing class template arguments via deduction-guides."}, | [m]={"60437620db8e",1486667864,"[c++1z] P0091R3: Basic support for deducing class template arguments via deduction-guides."}, | ||
[n]={{D, | [n]={{D,10001,"bool InitializationSequence::Diagnose(Sema &S, const InitializedEntity &Entity, const InitializationKind &Kind, ArrayRef<Expr *> Args) {\n case FK_ExplicitConstructor: {\n S.Diag(CtorDecl->getLocation(), diag::note_explicit_ctor_deduction_guide_here) << false;"},{D,10892,"QualType Sema::DeduceTemplateSpecializationFromInitializer(TypeSourceInfo *TSInfo, const InitializedEntity &Entity, const InitializationKind &Kind, MultiExprArg Inits, ParenListExpr *PL) {\n case OR_Success:\n // C++ [over.match.list]p1:\n // In copy-list-initialization, if an explicit constructor is chosen, the\n // initialization is ill-formed.\n if (Kind.isCopyInit() && ListInit && cast<CXXDeductionGuideDecl>(Best->Function)->isExplicit()) {\n Diag(Best->Function->getLocation(), diag::note_explicit_ctor_deduction_guide_here) << IsDeductionGuide;"}} | ||
}, | }, | ||
["note_explicit_instantiation_candidate"]={ | ["note_explicit_instantiation_candidate"]={ | ||
Line 4,501: | Line 4,501: | ||
[c]=o, | [c]=o, | ||
[m]={"450f0084a27b",1253904180,"WIP implementation of explicit instantiation of function templates,"}, | [m]={"450f0084a27b",1253904180,"WIP implementation of explicit instantiation of function templates,"}, | ||
[n]={{u, | [n]={{u,10649,"DeclResult Sema::ActOnExplicitInstantiation(Scope *S, SourceLocation ExternLoc, SourceLocation TemplateLoc, Declarator &D) {\n if (!Specialization) {\n UnresolvedSetIterator Result = getMostSpecialized(TemplateMatches.begin(), TemplateMatches.end(), FailedCandidates, D.getIdentifierLoc(), PDiag(diag::err_explicit_instantiation_not_known) << Name, PDiag(diag::err_explicit_instantiation_ambiguous) << Name, PDiag(diag::note_explicit_instantiation_candidate));"}} | ||
}, | }, | ||
["note_explicit_instantiation_definition_here"]={ | ["note_explicit_instantiation_definition_here"]={ | ||
Line 4,513: | Line 4,513: | ||
[c]=o, | [c]=o, | ||
[m]={"d6ba93dc6eb6",1255622045,"Check the interactions between explicit instantiations and template"}, | [m]={"d6ba93dc6eb6",1255622045,"Check the interactions between explicit instantiations and template"}, | ||
[n]={{u, | [n]={{u,9243,"/// Diagnose cases where we have an explicit template specialization\n/// before/after an explicit template instantiation, producing diagnostics\n/// for those cases where they are required and determining whether the\n/// new specialization/instantiation will have any effect.\n///\n/// \\param NewLoc the location of the new explicit specialization or\n/// instantiation.\n///\n/// \\param NewTSK the kind of the new explicit specialization or instantiation.\n///\n/// \\param PrevDecl the previous declaration of the entity.\n///\n/// \\param PrevTSK the kind of the old explicit specialization or instantiatin.\n///\n/// \\param PrevPointOfInstantiation if valid, indicates where the previous\n/// declaration was instantiated (either implicitly or explicitly).\n///\n/// \\param HasNoEffect will be set to true to indicate that the new\n/// specialization or instantiation has no effect and should be ignored.\n///\n/// \\returns true if there was an error that should prevent the introduction of\n/// the new declaration into the AST, false otherwise.\nbool Sema::CheckSpecializationInstantiationRedecl(SourceLocation NewLoc, TemplateSpecializationKind NewTSK, NamedDecl *PrevDecl, TemplateSpecializationKind PrevTSK, SourceLocation PrevPointOfInstantiation, bool &HasNoEffect) {\n case TSK_ExplicitInstantiationDeclaration:\n case TSK_ExplicitInstantiationDefinition:\n Diag(DiagLocForExplicitInstantiation(PrevDecl, PrevPointOfInstantiation), diag::note_explicit_instantiation_definition_here);"}} | ||
}, | }, | ||
["note_explicit_instantiation_here"]={ | ["note_explicit_instantiation_here"]={ | ||
Line 4,525: | Line 4,525: | ||
[c]=o, | [c]=o, | ||
[m]={"450f0084a27b",1253904180,"WIP implementation of explicit instantiation of function templates,"}, | [m]={"450f0084a27b",1253904180,"WIP implementation of explicit instantiation of function templates,"}, | ||
[n]={{u, | [n]={{u,839,"/// Determine whether we would be unable to instantiate this template (because\n/// it either has no definition, or is in the process of being instantiated).\nbool Sema::DiagnoseUninstantiableTemplate(SourceLocation PointOfInstantiation, NamedDecl *Instantiation, bool InstantiatedFromMember, const NamedDecl *Pattern, const NamedDecl *PatternDef, TemplateSpecializationKind TSK, bool Complain /*= true*/) {\n if (PatternDef) {\n } else if (InstantiatedFromMember) {\n if (isa<FunctionDecl>(Instantiation)) {\n Note = diag::note_explicit_instantiation_here;"},{u,852,"/// Determine whether we would be unable to instantiate this template (because\n/// it either has no definition, or is in the process of being instantiated).\nbool Sema::DiagnoseUninstantiableTemplate(SourceLocation PointOfInstantiation, NamedDecl *Instantiation, bool InstantiatedFromMember, const NamedDecl *Pattern, const NamedDecl *PatternDef, TemplateSpecializationKind TSK, bool Complain /*= true*/) {\n if (PatternDef) {\n } else if (InstantiatedFromMember) {\n } else {\n if (isa<FunctionDecl>(Instantiation)) {\n Note = diag::note_explicit_instantiation_here;"},{u,870,"/// Determine whether we would be unable to instantiate this template (because\n/// it either has no definition, or is in the process of being instantiated).\nbool Sema::DiagnoseUninstantiableTemplate(SourceLocation PointOfInstantiation, NamedDecl *Instantiation, bool InstantiatedFromMember, const NamedDecl *Pattern, const NamedDecl *PatternDef, TemplateSpecializationKind TSK, bool Complain /*= true*/) {\n if (PatternDef) {\n } else if (InstantiatedFromMember) {\n } else {\n if (isa<FunctionDecl>(Instantiation)) {\n } else if (isa<TagDecl>(Instantiation)) {\n } else {\n Note = diag::note_explicit_instantiation_here;"},{u,9871,"/// Check the scope of an explicit instantiation.\n///\n/// \\returns true if a serious error occurs, false otherwise.\nstatic bool CheckExplicitInstantiationScope(Sema &S, NamedDecl *D, SourceLocation InstLoc, bool WasQualifiedName) {\n S.Diag(D->getLocation(), diag::note_explicit_instantiation_here);"},{u,10459,"DeclResult Sema::ActOnExplicitInstantiation(Scope *S, SourceLocation ExternLoc, SourceLocation TemplateLoc, Declarator &D) {\n if (!R->isFunctionType()) {\n if (!PrevTemplate) {\n if (!Prev || !Prev->isStaticDataMember()) {\n for (LookupResult::iterator P = Previous.begin(), PEnd = Previous.end(); P != PEnd; ++P)\n Diag((*P)->getLocation(), diag::note_explicit_instantiation_here);"},{u,10468,"DeclResult Sema::ActOnExplicitInstantiation(Scope *S, SourceLocation ExternLoc, SourceLocation TemplateLoc, Declarator &D) {\n if (!R->isFunctionType()) {\n if (!PrevTemplate) {\n if (!Prev->getInstantiatedFromStaticDataMember()) {\n Diag(Prev->getLocation(), diag::note_explicit_instantiation_here);"},{u,10494,"DeclResult Sema::ActOnExplicitInstantiation(Scope *S, SourceLocation ExternLoc, SourceLocation TemplateLoc, Declarator &D) {\n if (!R->isFunctionType()) {\n if (!PrevTemplate) {\n } else {\n if (D.getName().getKind() != UnqualifiedIdKind::IK_TemplateId) {\n Diag(PrevTemplate->getLocation(), diag::note_explicit_instantiation_here);"},{u,10672,"DeclResult Sema::ActOnExplicitInstantiation(Scope *S, SourceLocation ExternLoc, SourceLocation TemplateLoc, Declarator &D) {\n // C++11 [except.spec]p4\n // In an explicit instantiation an exception-specification may be specified,\n // but is not required.\n // If an exception-specification is specified in an explicit instantiation\n // directive, it shall be compatible with the exception-specifications of\n // other declarations of that function.\n if (auto *FPT = R->getAs<FunctionProtoType>())\n if (FPT->hasExceptionSpec()) {\n bool Result = CheckEquivalentExceptionSpec(PDiag(DiagID) << Specialization->getType(), PDiag(diag::note_explicit_instantiation_here), Specialization->getType()->getAs<FunctionProtoType>(), Specialization->getLocation(), FPT, D.getBeginLoc());"},{u,10687,"DeclResult Sema::ActOnExplicitInstantiation(Scope *S, SourceLocation ExternLoc, SourceLocation TemplateLoc, Declarator &D) {\n if (Specialization->getTemplateSpecializationKind() == TSK_Undeclared) {\n Diag(Specialization->getLocation(), diag::note_explicit_instantiation_here);"}} | ||
}, | }, | ||
["note_explicit_template_arg_substitution_here"]={ | ["note_explicit_template_arg_substitution_here"]={ | ||
Line 4,537: | Line 4,537: | ||
[c]=o, | [c]=o, | ||
[m]={"ff6cbdf806da",1246485666,"Keep track of more information within the template instantiation stack, e.g.,"}, | [m]={"ff6cbdf806da",1246485666,"Keep track of more information within the template instantiation stack, e.g.,"}, | ||
[n]={{z, | [n]={{z,820,"/// Prints the current instantiation stack through a series of\n/// notes.\nvoid Sema::PrintInstantiationStack() {\n for (SmallVectorImpl<CodeSynthesisContext>::reverse_iterator Active = CodeSynthesisContexts.rbegin(), ActiveEnd = CodeSynthesisContexts.rend(); Active != ActiveEnd; ++Active, ++InstantiationIdx) {\n case CodeSynthesisContext::ExplicitTemplateArgumentSubstitution: {\n Diags.Report(Active->PointOfInstantiation, diag::note_explicit_template_arg_substitution_here) << FnTmpl << getTemplateArgumentBindingsText(FnTmpl->getTemplateParameters(), Active->TemplateArgs, Active->NumTemplateArgs) << Active->InstantiationRange;"}} | ||
}, | }, | ||
["note_explicit_template_spec_does_not_need_header"]={ | ["note_explicit_template_spec_does_not_need_header"]={ | ||
Line 4,549: | Line 4,549: | ||
[c]=o, | [c]=o, | ||
[m]={"65911498eff3",1258978305,"Tolerate extraneous \"template<>\" headers better, downgrading the"}, | [m]={"65911498eff3",1258978305,"Tolerate extraneous \"template<>\" headers better, downgrading the"}, | ||
[n]={{u, | [n]={{u,3591,"/// Match the given template parameter lists to the given scope\n/// specifier, returning the template parameter list that applies to the\n/// name.\n///\n/// \\param DeclStartLoc the start of the declaration that has a scope\n/// specifier or a template parameter list.\n///\n/// \\param DeclLoc The location of the declaration itself.\n///\n/// \\param SS the scope specifier that will be matched to the given template\n/// parameter lists. This scope specifier precedes a qualified name that is\n/// being declared.\n///\n/// \\param TemplateId The template-id following the scope specifier, if there\n/// is one. Used to check for a missing \'template<>\'.\n///\n/// \\param ParamLists the template parameter lists, from the outermost to the\n/// innermost template parameter lists.\n///\n/// \\param IsFriend Whether to apply the slightly different rules for\n/// matching template parameters to scope specifiers in friend\n/// declarations.\n///\n/// \\param IsMemberSpecialization will be set true if the scope specifier\n/// denotes a fully-specialized type, and therefore this is a declaration of\n/// a member specialization.\n///\n/// \\returns the template parameter list, if any, that corresponds to the\n/// name that is preceded by the scope specifier @p SS. This template\n/// parameter list may have template parameters (if we\'re declaring a\n/// template) or may have no template parameters (if we\'re declaring a\n/// template specialization), or may be NULL (if what we\'re declaring isn\'t\n/// itself a template).\nTemplateParameterList *Sema::MatchTemplateParametersToScopeSpecifier(SourceLocation DeclStartLoc, SourceLocation DeclLoc, const CXXScopeSpec &SS, TemplateIdAnnotation *TemplateId, ArrayRef<TemplateParameterList *> ParamLists, bool IsFriend, bool &IsMemberSpecialization, bool &Invalid, bool SuppressDiagnostic) {\n // If there were too many template parameter lists, complain about that now.\n if (ParamIdx < ParamLists.size() - 1) {\n // If there was a specialization somewhere, such that \'template<>\' is\n // not required, and there were any \'template<>\' headers, note where the\n // specialization occurred.\n if (ExplicitSpecLoc.isValid() && HasAnyExplicitSpecHeader && !SuppressDiagnostic)\n Diag(ExplicitSpecLoc, diag::note_explicit_template_spec_does_not_need_header) << NestedTypes.back();"}} | ||
}, | }, | ||
["note_export"]={ | ["note_export"]={ | ||
Line 4,561: | Line 4,561: | ||
[c]=Sb, | [c]=Sb, | ||
[m]={"e181de7f4fe9",1555973411,"[c++2a] Implement semantic restrictions for \'export\' declarations."}, | [m]={"e181de7f4fe9",1555973411,"[c++2a] Implement semantic restrictions for \'export\' declarations."}, | ||
[n]={{cb, | [n]={{cb,811,"/// We have parsed the start of an export declaration, including the \'{\'\n/// (if present).\nDecl *Sema::ActOnStartExportDecl(Scope *S, SourceLocation ExportLoc, SourceLocation LBraceLoc) {\n // [...] its declaration or declaration-seq shall not contain an\n // export-declaration.\n if (auto *ED = getEnclosingExportDecl(D)) {\n if (ED->hasBraces())\n Diag(ED->getLocation(), diag::note_export);"},{cb,844,"/// Check that it\'s valid to export \\p D.\nstatic bool checkExportedDecl(Sema &S, Decl *D, SourceLocation BlockStart) {\n if (auto *ND = dyn_cast<NamedDecl>(D)) {\n if (HasName && ND->getFormalLinkage() == InternalLinkage) {\n if (BlockStart.isValid())\n S.Diag(BlockStart, diag::note_export);"},{cb,860,"/// Check that it\'s valid to export \\p D.\nstatic bool checkExportedDecl(Sema &S, Decl *D, SourceLocation BlockStart) {\n // C++2a [module.interface]p5:\n // all entities to which all of the using-declarators ultimately refer\n // shall have been introduced with a name having external linkage\n if (auto *USD = dyn_cast<UsingShadowDecl>(D)) {\n if (Lk == InternalLinkage || Lk == ModuleLinkage) {\n if (BlockStart.isValid())\n S.Diag(BlockStart, diag::note_export);"},{cb,875,"/// Check that it\'s valid to export \\p D.\nstatic bool checkExportedDecl(Sema &S, Decl *D, SourceLocation BlockStart) {\n // Recurse into namespace-scope DeclContexts. (Only namespace-scope\n // declarations are exported).\n if (auto *DC = dyn_cast<DeclContext>(D)) {\n if (auto *ND = dyn_cast<NamedDecl>(D)) {\n if (!ND->getDeclName()) {\n if (BlockStart.isValid())\n S.Diag(BlockStart, diag::note_export);"}} | ||
}, | }, | ||
["note_expr_divide_by_zero"]={ | ["note_expr_divide_by_zero"]={ | ||
Line 4,573: | Line 4,573: | ||
[c]=a, | [c]=a, | ||
[m]={wb,1236199783,vb}, | [m]={wb,1236199783,vb}, | ||
[n]={{p, | [n]={{p,2805,"/// Perform the given binary integer operation.\nstatic bool handleIntIntBinOp(EvalInfo &Info, const Expr *E, const APSInt &LHS, BinaryOperatorKind Opcode, APSInt RHS, APSInt &Result) {\n case BO_Rem:\n if (RHS == 0) {\n Info.FFDiag(E, diag::note_expr_divide_by_zero);"},{p,2907,"/// Perform the given binary floating-point operation, in-place, on LHS.\nstatic bool handleFloatFloatBinOp(EvalInfo &Info, const BinaryOperator *E, APFloat &LHS, BinaryOperatorKind Opcode, const APFloat &RHS) {\n case BO_Div:\n // [expr.mul]p4:\n // If the second operand of / or % is zero the behavior is undefined.\n if (RHS.isZero())\n Info.CCEDiag(E, diag::note_expr_divide_by_zero);"},{p,14025,"bool FixedPointExprEvaluator::VisitBinaryOperator(const BinaryOperator *E) {\n case BO_Div: {\n if (RHSFX.getValue() == 0) {\n Info.FFDiag(E, diag::note_expr_divide_by_zero);"},{p,14804,"bool ComplexExprEvaluator::VisitBinaryOperator(const BinaryOperator *E) {\n case BO_Div:\n if (Result.isComplexFloat()) {\n } else {\n if (RHS.getComplexIntReal() == 0 && RHS.getComplexIntImag() == 0)\n return Error(E, diag::note_expr_divide_by_zero);"}} | ||
}, | }, | ||
["note_expr_evaluates_to"]={ | ["note_expr_evaluates_to"]={ | ||
Line 4,585: | Line 4,585: | ||
[c]=o, | [c]=o, | ||
[m]={db,1625925174,eb}, | [m]={db,1625925174,eb}, | ||
[n]={{q, | [n]={{q,16928,"/// Try to print more useful information about a failed static_assert\n/// with expression \\E\nvoid Sema::DiagnoseStaticAssertDetails(const Expr *E) {\n if (const auto *Op = dyn_cast<BinaryOperator>(E); Op && Op->getOpcode() != BO_LOr) {\n if (DiagSide[0].Print && DiagSide[1].Print) {\n Diag(Op->getExprLoc(), diag::note_expr_evaluates_to) << DiagSide[0].ValueString << Op->getOpcodeStr() << DiagSide[1].ValueString << Op->getSourceRange();"}} | ||
}, | }, | ||
["note_expr_requirement_constraints_not_satisfied"]={ | ["note_expr_requirement_constraints_not_satisfied"]={ | ||
Line 4,597: | Line 4,597: | ||
[c]=o, | [c]=o, | ||
[m]={ab,1576172311,bb}, | [m]={ab,1576172311,bb}, | ||
[n]={{O, | [n]={{O,970,"static void diagnoseUnsatisfiedRequirement(Sema &S, concepts::ExprRequirement *Req, bool First) {\n case concepts::ExprRequirement::SS_ConstraintsNotSatisfied: {\n if (ConstraintExpr->getTemplateArgsAsWritten()->NumTemplateArgs == 1) {\n } else {\n S.Diag(ConstraintExpr->getBeginLoc(), diag::note_expr_requirement_constraints_not_satisfied) << (int)First << ConstraintExpr;"}} | ||
}, | }, | ||
["note_expr_requirement_constraints_not_satisfied_simple"]={ | ["note_expr_requirement_constraints_not_satisfied_simple"]={ | ||
Line 4,609: | Line 4,609: | ||
[c]=o, | [c]=o, | ||
[m]={ab,1576172311,bb}, | [m]={ab,1576172311,bb}, | ||
[n]={{O, | [n]={{O,965,"static void diagnoseUnsatisfiedRequirement(Sema &S, concepts::ExprRequirement *Req, bool First) {\n case concepts::ExprRequirement::SS_ConstraintsNotSatisfied: {\n if (ConstraintExpr->getTemplateArgsAsWritten()->NumTemplateArgs == 1) {\n S.Diag(e->getBeginLoc(), diag::note_expr_requirement_constraints_not_satisfied_simple) << (int)First << S.Context.getReferenceQualifiedType(e) << ConstraintExpr->getNamedConcept();"}} | ||
}, | }, | ||
["note_expr_requirement_expr_substitution_error"]={ | ["note_expr_requirement_expr_substitution_error"]={ | ||
Line 4,621: | Line 4,621: | ||
[c]=o, | [c]=o, | ||
[m]={ab,1576172311,bb}, | [m]={ab,1576172311,bb}, | ||
[n]={{O, | [n]={{O,929,"static void diagnoseUnsatisfiedRequirement(Sema &S, concepts::ExprRequirement *Req, bool First) {\n case concepts::ExprRequirement::SS_ExprSubstitutionFailure: {\n if (!SubstDiag->DiagMessage.empty())\n S.Diag(SubstDiag->DiagLoc, diag::note_expr_requirement_expr_substitution_error) << (int)First << SubstDiag->SubstitutedEntity << SubstDiag->DiagMessage;"}} | ||
}, | }, | ||
["note_expr_requirement_expr_unknown_substitution_error"]={ | ["note_expr_requirement_expr_unknown_substitution_error"]={ | ||
Line 4,633: | Line 4,633: | ||
[c]=o, | [c]=o, | ||
[m]={ab,1576172311,bb}, | [m]={ab,1576172311,bb}, | ||
[n]={{O, | [n]={{O,934,"static void diagnoseUnsatisfiedRequirement(Sema &S, concepts::ExprRequirement *Req, bool First) {\n case concepts::ExprRequirement::SS_ExprSubstitutionFailure: {\n if (!SubstDiag->DiagMessage.empty())\n else\n S.Diag(SubstDiag->DiagLoc, diag::note_expr_requirement_expr_unknown_substitution_error) << (int)First << SubstDiag->SubstitutedEntity;"}} | ||
}, | }, | ||
["note_expr_requirement_noexcept_not_met"]={ | ["note_expr_requirement_noexcept_not_met"]={ | ||
Line 4,645: | Line 4,645: | ||
[c]=o, | [c]=o, | ||
[m]={ab,1576172311,bb}, | [m]={ab,1576172311,bb}, | ||
[n]={{O, | [n]={{O,940,"static void diagnoseUnsatisfiedRequirement(Sema &S, concepts::ExprRequirement *Req, bool First) {\n case concepts::ExprRequirement::SS_NoexceptNotMet:\n S.Diag(Req->getNoexceptLoc(), diag::note_expr_requirement_noexcept_not_met) << (int)First << Req->getExpr();"}} | ||
}, | }, | ||
["note_expr_requirement_type_requirement_substitution_error"]={ | ["note_expr_requirement_type_requirement_substitution_error"]={ | ||
Line 4,657: | Line 4,657: | ||
[c]=o, | [c]=o, | ||
[m]={ab,1576172311,bb}, | [m]={ab,1576172311,bb}, | ||
[n]={{O, | [n]={{O,948,"static void diagnoseUnsatisfiedRequirement(Sema &S, concepts::ExprRequirement *Req, bool First) {\n case concepts::ExprRequirement::SS_TypeRequirementSubstitutionFailure: {\n if (!SubstDiag->DiagMessage.empty())\n S.Diag(SubstDiag->DiagLoc, diag::note_expr_requirement_type_requirement_substitution_error) << (int)First << SubstDiag->SubstitutedEntity << SubstDiag->DiagMessage;"}} | ||
}, | }, | ||
["note_expr_requirement_type_requirement_unknown_substitution_error"]={ | ["note_expr_requirement_type_requirement_unknown_substitution_error"]={ | ||
Line 4,669: | Line 4,669: | ||
[c]=o, | [c]=o, | ||
[m]={ab,1576172311,bb}, | [m]={ab,1576172311,bb}, | ||
[n]={{O, | [n]={{O,953,"static void diagnoseUnsatisfiedRequirement(Sema &S, concepts::ExprRequirement *Req, bool First) {\n case concepts::ExprRequirement::SS_TypeRequirementSubstitutionFailure: {\n if (!SubstDiag->DiagMessage.empty())\n else\n S.Diag(SubstDiag->DiagLoc, diag::note_expr_requirement_type_requirement_unknown_substitution_error) << (int)First << SubstDiag->SubstitutedEntity;"}} | ||
}, | }, | ||
["note_extern_c_begins_here"]={ | ["note_extern_c_begins_here"]={ | ||
Line 4,681: | Line 4,681: | ||
[c]=o, | [c]=o, | ||
[m]={"560ae565e9fa",1478101594,"Add a note that points to the linkage specifier for the C++ linkage errors"}, | [m]={"560ae565e9fa",1478101594,"Add a note that points to the linkage specifier for the C++ linkage errors"}, | ||
[n]={{q, | [n]={{q,16356,"/// CheckLiteralOperatorDeclaration - Check whether the declaration\n/// of this literal operator function is well-formed. If so, returns\n/// false; otherwise, emits appropriate diagnostics and returns true.\nbool Sema::CheckLiteralOperatorDeclaration(FunctionDecl *FnDecl) {\n if (FnDecl->isExternC()) {\n if (const LinkageSpecDecl *LSD = FnDecl->getDeclContext()->getExternCContext())\n Diag(LSD->getExternLoc(), diag::note_extern_c_begins_here);"},{cb,56,"static void checkModuleImportContext(Sema &S, Module *M, SourceLocation ImportLoc, DeclContext *DC, bool FromInclude = false) {\n if (!isa<TranslationUnitDecl>(DC)) {\n } else if (!M->IsExternC && ExternCLoc.isValid()) {\n S.Diag(ExternCLoc, diag::note_extern_c_begins_here);"},{u,8321,"/// Check whether a template can be declared within this scope.\n///\n/// If the template declaration is valid in this scope, returns\n/// false. Otherwise, issues a diagnostic and returns true.\nbool Sema::CheckTemplateDeclScope(Scope *S, TemplateParameterList *TemplateParams) {\n if (Ctx && Ctx->isExternCContext()) {\n if (const LinkageSpecDecl *LSD = Ctx->getExternCContext())\n Diag(LSD->getExternLoc(), diag::note_extern_c_begins_here);"}} | ||
}, | }, | ||
["note_extern_c_global_conflict"]={ | ["note_extern_c_global_conflict"]={ | ||
Line 4,693: | Line 4,693: | ||
[c]=o, | [c]=o, | ||
[m]={"902befa2773d",1372457031,"PR7927, PR16247: Reimplement handling of matching extern \"C\" declarations"}, | [m]={"902befa2773d",1372457031,"PR7927, PR16247: Reimplement handling of matching extern \"C\" declarations"}, | ||
[n]={{t, | [n]={{t,8465,"/// Check for conflict between this global or extern \"C\" declaration and\n/// previous global or extern \"C\" declarations. This is only used in C++.\ntemplate <typename T> static bool checkGlobalOrExternCConflict(Sema &S, const T *ND, bool IsGlobal, LookupResult &Previous) {\n S.Diag(Prev->getLocation(), diag::note_extern_c_global_conflict) << IsGlobal;"}} | ||
}, | }, | ||
["note_extra_comma_message_arg"]={ | ["note_extra_comma_message_arg"]={ | ||
Line 4,705: | Line 4,705: | ||
[c]=Q, | [c]=Q, | ||
[m]={"945b2f46b154",1337640224,"objective-c: provide a useful \'fixit\' suggestion when"}, | [m]={"945b2f46b154",1337640224,"objective-c: provide a useful \'fixit\' suggestion when"}, | ||
[n]={{Kb, | [n]={{Kb,3328,"/// Parse the remainder of an Objective-C message following the\n/// \'[\' objc-receiver.\n///\n/// This routine handles sends to super, class messages (sent to a\n/// class name), and instance messages (sent to an object), and the\n/// target is represented by \\p SuperLoc, \\p ReceiverType, or \\p\n/// ReceiverExpr, respectively. Only one of these parameters may have\n/// a valid value.\n///\n/// \\param LBracLoc The location of the opening \'[\'.\n///\n/// \\param SuperLoc If this is a send to \'super\', the location of the\n/// \'super\' keyword that indicates a send to the superclass.\n///\n/// \\param ReceiverType If this is a class message, the type of the\n/// class we are sending a message to.\n///\n/// \\param ReceiverExpr If this is an instance message, the expression\n/// used to compute the receiver object.\n///\n/// objc-message-args:\n/// objc-selector\n/// objc-keywordarg-list\n///\n/// objc-keywordarg-list:\n/// objc-keywordarg\n/// objc-keywordarg-list objc-keywordarg\n///\n/// objc-keywordarg:\n/// selector-name[opt] \':\' objc-keywordexpr\n///\n/// objc-keywordexpr:\n/// nonempty-expr-list\n///\n/// nonempty-expr-list:\n/// assignment-expression\n/// nonempty-expr-list , assignment-expression\n///\nExprResult Parser::ParseObjCMessageExpressionBody(SourceLocation LBracLoc, SourceLocation SuperLoc, ParsedType ReceiverType, Expr *ReceiverExpr) {\n if (Tok.is(tok::colon)) {\n // Parse the, optional, argument list, comma separated.\n while (Tok.is(tok::comma)) {\n if (Res.isInvalid()) {\n if (Tok.is(tok::colon)) {\n Diag(commaLoc, diag::note_extra_comma_message_arg) << FixItHint::CreateRemoval(commaLoc);"}} | ||
}, | }, | ||
["note_fallthrough_insert_semi_fixit"]={ | ["note_fallthrough_insert_semi_fixit"]={ | ||
Line 4,717: | Line 4,717: | ||
[c]=o, | [c]=o, | ||
[m]={"84837d5b5aa0",1336069659,"Add -Wimplicit-fallthrough warning flag, which warns on fallthrough between"}, | [m]={"84837d5b5aa0",1336069659,"Add -Wimplicit-fallthrough warning flag, which warns on fallthrough between"}, | ||
[n]={{"clang/lib/Sema/SemaStmtAttr.cpp", | [n]={{"clang/lib/Sema/SemaStmtAttr.cpp",35,"static Attr *handleFallThroughAttr(Sema &S, Stmt *St, const ParsedAttr &A, SourceRange Range) {\n if (isa<SwitchCase>(St)) {\n S.Diag(L, diag::note_fallthrough_insert_semi_fixit) << FixItHint::CreateInsertion(L, \";\");"}} | ||
}, | }, | ||
["note_fe_backend_invalid_loc"]={ | ["note_fe_backend_invalid_loc"]={ | ||
Line 4,729: | Line 4,729: | ||
[c]="Backend Issue", | [c]="Backend Issue", | ||
[m]={"5e03a4b8370d",1453915828,"Add backend dignostic printer for unsupported features"}, | [m]={"5e03a4b8370d",1453915828,"Add backend dignostic printer for unsupported features"}, | ||
[n]={{ec, | [n]={{ec,694,"const FullSourceLoc BackendConsumer::getBestLocationFromDebugLoc(const llvm::DiagnosticInfoWithLocationBase &D, bool &BadDebugInfo, StringRef &Filename, unsigned &Line, unsigned &Column) const {\n if (DILoc.isInvalid() && D.isLocationAvailable())\n Diags.Report(Loc, diag::note_fe_backend_invalid_loc) << Filename << Line << Column;"},{ec,743,"void BackendConsumer::UnsupportedDiagHandler(const llvm::DiagnosticInfoUnsupported &D) {\n if (BadDebugInfo)\n Diags.Report(Loc, diag::note_fe_backend_invalid_loc) << Filename << Line << Column;"},{ec,782,"void BackendConsumer::EmitOptimizationMessage(const llvm::DiagnosticInfoOptimizationBase &D, unsigned DiagID) {\n if (BadDebugInfo)\n Diags.Report(Loc, diag::note_fe_backend_invalid_loc) << Filename << Line << Column;"},{ec,877,"void BackendConsumer::MisExpectDiagHandler(const llvm::DiagnosticInfoMisExpect &D) {\n if (BadDebugInfo)\n Diags.Report(Loc, diag::note_fe_backend_invalid_loc) << Filename << Line << Column;"}} | ||
}, | }, | ||
["note_fe_backend_resource_limit"]={ | ["note_fe_backend_resource_limit"]={ | ||
Line 4,752: | Line 4,752: | ||
[c]=a, | [c]=a, | ||
[m]={"5ec32e7fd845",1270579130,"teach clang to install the inline asm diagnostic handler,"}, | [m]={"5ec32e7fd845",1270579130,"teach clang to install the inline asm diagnostic handler,"}, | ||
[n]={{ec, | [n]={{ec,583,"void BackendConsumer::SrcMgrDiagHandler(const llvm::DiagnosticInfoSrcMgr &DI) {\n // If this problem has clang-level source location information, report the\n // issue in the source with a note showing the instantiated\n // code.\n if (DI.isInlineAsmDiag()) {\n if (LocCookie.isValid()) {\n if (D.getLoc().isValid()) {\n DiagnosticBuilder B = Diags.Report(Loc, diag::note_fe_inline_asm_here);"}} | ||
}, | }, | ||
["note_fe_linking_module"]={ | ["note_fe_linking_module"]={ | ||
Line 4,775: | Line 4,775: | ||
[c]=o, | [c]=o, | ||
[m]={wb,1236199783,vb}, | [m]={wb,1236199783,vb}, | ||
[n]={{D, | [n]={{D,2722,"/// Check the well-formedness of a C99 designated initializer.\n///\n/// Determines whether the designated initializer @p DIE, which\n/// resides at the given @p Index within the initializer list @p\n/// IList, is well-formed for a current object of type @p DeclType\n/// (C99 6.7.8). The actual subobject that this designator refers to\n/// within the current subobject is returned in either\n/// @p NextField or @p NextElementIndex (whichever is appropriate).\n///\n/// @param IList The initializer list in which this designated\n/// initializer occurs.\n///\n/// @param DIE The designated initializer expression.\n///\n/// @param DesigIdx The index of the current designator.\n///\n/// @param CurrentObjectType The type of the \"current object\" (C99 6.7.8p17),\n/// into which the designation in @p DIE should refer.\n///\n/// @param NextField If non-NULL and the first designator in @p DIE is\n/// a field, this will be set to the field declaration corresponding\n/// to the field named by the designator. On input, this is expected to be\n/// the next field that would be initialized in the absence of designation,\n/// if the complete object being initialized is a struct.\n///\n/// @param NextElementIndex If non-NULL and the first designator in @p\n/// DIE is an array designator or GNU array-range designator, this\n/// will be set to the last index initialized by this designator.\n///\n/// @param Index Index into @p IList where the designated initializer\n/// @p DIE occurs.\n///\n/// @param StructuredList The initializer list expression that\n/// describes all of the subobject initializers in the order they\'ll\n/// actually be initialized.\n///\n/// @returns true if there was an error, false otherwise.\nbool InitListChecker::CheckDesignatedInitializer(const InitializedEntity &Entity, InitListExpr *IList, DesignatedInitExpr *DIE, unsigned DesigIdx, QualType &CurrentObjectType, RecordDecl::field_iterator *NextField, llvm::APSInt *NextElementIndex, unsigned &Index, InitListExpr *StructuredList, unsigned &StructuredIndex, bool FinishSubobjectInit, bool TopLevelObject) {\n if (D->isFieldDesignator()) {\n if (!KnownField) {\n if (!KnownField) {\n // Name lookup found something, but it wasn\'t a field.\n if (!Lookup.empty()) {\n SemaRef.Diag(Lookup.front()->getLocation(), diag::note_field_designator_found);"}} | ||
}, | }, | ||
["note_file_misc_sloc_usage"]={ | ["note_file_misc_sloc_usage"]={ | ||
Line 4,787: | Line 4,787: | ||
[c]=a, | [c]=a, | ||
[m]={"9e52db182794",1668037554,"When we run out of source locations, try to produce useful information"}, | [m]={"9e52db182794",1668037554,"When we run out of source locations, try to produce useful information"}, | ||
[n]={{"clang/lib/Basic/SourceManager.cpp", | [n]={{"clang/lib/Basic/SourceManager.cpp",2320,"void SourceManager::noteSLocAddressSpaceUsage(DiagnosticsEngine &Diag, std::optional<unsigned> MaxNotes) const {\n // Describe any remaining usage not reported in the per-file usage.\n if (ReportedSize != CountedSize) {\n Diag.Report(SourceLocation(), diag::note_file_misc_sloc_usage) << (SortedUsage.end() - SortedEnd) << CountedSize - ReportedSize;"}} | ||
}, | }, | ||
["note_file_sloc_usage"]={ | ["note_file_sloc_usage"]={ | ||
Line 4,799: | Line 4,799: | ||
[c]=a, | [c]=a, | ||
[m]={"9e52db182794",1668037554,"When we run out of source locations, try to produce useful information"}, | [m]={"9e52db182794",1668037554,"When we run out of source locations, try to produce useful information"}, | ||
[n]={{"clang/lib/Basic/SourceManager.cpp", | [n]={{"clang/lib/Basic/SourceManager.cpp",2312,"void SourceManager::noteSLocAddressSpaceUsage(DiagnosticsEngine &Diag, std::optional<unsigned> MaxNotes) const {\n for (auto &[Entry, FileInfo] : llvm::make_range(SortedUsage.begin(), SortedEnd)) {\n Diag.Report(FileInfo.Loc, diag::note_file_sloc_usage) << FileInfo.Inclusions << FileInfo.DirectSize << (FileInfo.TotalSize - FileInfo.DirectSize);"}} | ||
}, | }, | ||
["note_final_dtor_non_final_class_silence"]={ | ["note_final_dtor_non_final_class_silence"]={ | ||
Line 4,811: | Line 4,811: | ||
[c]=o, | [c]=o, | ||
[m]={"94f3f3e7f46a",1567276544,"[NFC] Fix for rL370594"}, | [m]={"94f3f3e7f46a",1567276544,"[NFC] Fix for rL370594"}, | ||
[n]={{q, | [n]={{q,6990,"/// Perform semantic checks on a class definition that has been\n/// completing, introducing implicitly-declared members, checking for\n/// abstract types, etc.\n///\n/// \\param S The scope in which the class was parsed. Null if we didn\'t just\n/// parse a class definition.\n/// \\param Record The completed class.\nvoid Sema::CheckCompletedCXXClass(Scope *S, CXXRecordDecl *Record) {\n // Warn if the class has a final destructor but is not itself marked final.\n if (!Record->hasAttr<FinalAttr>()) {\n if (const CXXDestructorDecl *dtor = Record->getDestructor()) {\n if (const FinalAttr *FA = dtor->getAttr<FinalAttr>()) {\n Diag(Record->getLocation(), diag::note_final_dtor_non_final_class_silence) << Context.getRecordType(Record) << FA->isSpelledAsSealed();"}} | ||
}, | }, | ||
["note_final_overrider"]={ | ["note_final_overrider"]={ | ||
Line 4,823: | Line 4,823: | ||
[c]=o, | [c]=o, | ||
[m]={"4165bd677248",1269388076,"Implement computation of the final overriders for each virtual"}, | [m]={"4165bd677248",1269388076,"Implement computation of the final overriders for each virtual"}, | ||
[n]={{t, | [n]={{t,19007,"void Sema::ActOnFields(Scope *S, SourceLocation RecLoc, Decl *EnclosingDecl, ArrayRef<Decl *> Fields, SourceLocation LBrac, SourceLocation RBrac, const ParsedAttributesView &Attrs) {\n // Okay, we successfully defined \'Record\'.\n if (Record) {\n if (CXXRecord) {\n if (!CXXRecord->isDependentType()) {\n if (!CXXRecord->isInvalidDecl()) {\n // If we have virtual base classes, we may end up finding multiple\n // final overriders for a given virtual function. Check for this\n // problem now.\n if (CXXRecord->getNumVBases()) {\n for (CXXFinalOverriderMap::iterator M = FinalOverriders.begin(), MEnd = FinalOverriders.end(); M != MEnd; ++M) {\n for (OverridingMethods::iterator SO = M->second.begin(), SOEnd = M->second.end(); SO != SOEnd; ++SO) {\n for (OverridingMethods::overriding_iterator OM = SO->second.begin(), OMEnd = SO->second.end(); OM != OMEnd; ++OM)\n Diag(OM->Method->getLocation(), diag::note_final_overrider) << (const NamedDecl *)M->first << OM->Method->getParent();"}} | ||
}, | }, | ||
["note_first_module_difference"]={ | ["note_first_module_difference"]={ | ||
Line 4,835: | Line 4,835: | ||
[c]=a, | [c]=a, | ||
[m]={"ca48d369bac3",1498009393,"[ODRHash] Supply more information when generic error message is emitted."}, | [m]={"ca48d369bac3",1498009393,"[ODRHash] Supply more information when generic error message is emitted."}, | ||
[n]={{G, | [n]={{G,657,"void ODRDiagsEmitter::diagnoseSubMismatchUnexpected(DiffResult &DR, const NamedDecl *FirstRecord, StringRef FirstModule, const NamedDecl *SecondRecord, StringRef SecondModule) const {\n if (DR.FirstDecl) {\n Diag(DR.FirstDecl->getLocation(), diag::note_first_module_difference) << FirstRecord << DR.FirstDecl->getSourceRange();"}} | ||
}, | }, | ||
["note_fixit_applied"]={ | ["note_fixit_applied"]={ | ||
Line 4,847: | Line 4,847: | ||
[c]=a, | [c]=a, | ||
[m]={"a42bd8433d56",1238692380,"Provide FIX-IT notes to describe what fix-it is doing behind the"}, | [m]={"a42bd8433d56",1238692380,"Provide FIX-IT notes to describe what fix-it is doing behind the"}, | ||
[n]={{"clang/lib/Frontend/Rewrite/FixItRewriter.cpp", | [n]={{"clang/lib/Frontend/Rewrite/FixItRewriter.cpp",196,"void FixItRewriter::HandleDiagnostic(DiagnosticsEngine::Level DiagLevel, const Diagnostic &Info) {\n Diag(Info.getLocation(), diag::note_fixit_applied);"}} | ||
}, | }, | ||
["note_fixit_failed"]={ | ["note_fixit_failed"]={ | ||
Line 4,859: | Line 4,859: | ||
[c]=a, | [c]=a, | ||
[m]={"a42bd8433d56",1238692380,"Provide FIX-IT notes to describe what fix-it is doing behind the"}, | [m]={"a42bd8433d56",1238692380,"Provide FIX-IT notes to describe what fix-it is doing behind the"}, | ||
[n]={{"clang/lib/Frontend/Rewrite/FixItRewriter.cpp", | [n]={{"clang/lib/Frontend/Rewrite/FixItRewriter.cpp",192,"void FixItRewriter::HandleDiagnostic(DiagnosticsEngine::Level DiagLevel, const Diagnostic &Info) {\n if (!Editor.commit(commit)) {\n Diag(Info.getLocation(), diag::note_fixit_failed);"}} | ||
}, | }, | ||
["note_fixit_in_macro"]={ | ["note_fixit_in_macro"]={ | ||
Line 4,871: | Line 4,871: | ||
[c]=a, | [c]=a, | ||
[m]={"a42bd8433d56",1238692380,"Provide FIX-IT notes to describe what fix-it is doing behind the"}, | [m]={"a42bd8433d56",1238692380,"Provide FIX-IT notes to describe what fix-it is doing behind the"}, | ||
[n]={{"clang/lib/Frontend/Rewrite/FixItRewriter.cpp", | [n]={{"clang/lib/Frontend/Rewrite/FixItRewriter.cpp",180,"void FixItRewriter::HandleDiagnostic(DiagnosticsEngine::Level DiagLevel, const Diagnostic &Info) {\n if (!CanRewrite) {\n if (Info.getNumFixItHints() > 0)\n Diag(Info.getLocation(), diag::note_fixit_in_macro);"}} | ||
}, | }, | ||
["note_fixit_unfixed_error"]={ | ["note_fixit_unfixed_error"]={ | ||
Line 4,883: | Line 4,883: | ||
[c]=a, | [c]=a, | ||
[m]={"a42bd8433d56",1238692380,"Provide FIX-IT notes to describe what fix-it is doing behind the"}, | [m]={"a42bd8433d56",1238692380,"Provide FIX-IT notes to describe what fix-it is doing behind the"}, | ||
[n]={{"clang/lib/Frontend/Rewrite/FixItRewriter.cpp", | [n]={{"clang/lib/Frontend/Rewrite/FixItRewriter.cpp",185,"void FixItRewriter::HandleDiagnostic(DiagnosticsEngine::Level DiagLevel, const Diagnostic &Info) {\n if (!CanRewrite) {\n // If this was an error, refuse to perform any rewriting.\n if (DiagLevel >= DiagnosticsEngine::Error) {\n if (++NumFailures == 1)\n Diag(Info.getLocation(), diag::note_fixit_unfixed_error);"}} | ||
}, | }, | ||
["note_flexible_array_member"]={ | ["note_flexible_array_member"]={ | ||
Line 4,895: | Line 4,895: | ||
[c]=o, | [c]=o, | ||
[m]={wb,1236199783,vb}, | [m]={wb,1236199783,vb}, | ||
[n]={{D, | [n]={{D,2121,"bool InitListChecker::CheckFlexibleArrayInit(const InitializedEntity &Entity, Expr *InitExpr, FieldDecl *Field, bool TopLevelObject) {\n if (!VerifyOnly) {\n SemaRef.Diag(Field->getLocation(), diag::note_flexible_array_member) << Field;"},{D,2884,"/// Check the well-formedness of a C99 designated initializer.\n///\n/// Determines whether the designated initializer @p DIE, which\n/// resides at the given @p Index within the initializer list @p\n/// IList, is well-formed for a current object of type @p DeclType\n/// (C99 6.7.8). The actual subobject that this designator refers to\n/// within the current subobject is returned in either\n/// @p NextField or @p NextElementIndex (whichever is appropriate).\n///\n/// @param IList The initializer list in which this designated\n/// initializer occurs.\n///\n/// @param DIE The designated initializer expression.\n///\n/// @param DesigIdx The index of the current designator.\n///\n/// @param CurrentObjectType The type of the \"current object\" (C99 6.7.8p17),\n/// into which the designation in @p DIE should refer.\n///\n/// @param NextField If non-NULL and the first designator in @p DIE is\n/// a field, this will be set to the field declaration corresponding\n/// to the field named by the designator. On input, this is expected to be\n/// the next field that would be initialized in the absence of designation,\n/// if the complete object being initialized is a struct.\n///\n/// @param NextElementIndex If non-NULL and the first designator in @p\n/// DIE is an array designator or GNU array-range designator, this\n/// will be set to the last index initialized by this designator.\n///\n/// @param Index Index into @p IList where the designated initializer\n/// @p DIE occurs.\n///\n/// @param StructuredList The initializer list expression that\n/// describes all of the subobject initializers in the order they\'ll\n/// actually be initialized.\n///\n/// @returns true if there was an error, false otherwise.\nbool InitListChecker::CheckDesignatedInitializer(const InitializedEntity &Entity, InitListExpr *IList, DesignatedInitExpr *DIE, unsigned DesigIdx, QualType &CurrentObjectType, RecordDecl::field_iterator *NextField, llvm::APSInt *NextElementIndex, unsigned &Index, InitListExpr *StructuredList, unsigned &StructuredIndex, bool FinishSubobjectInit, bool TopLevelObject) {\n if (D->isFieldDesignator()) {\n // This designator names a flexible array member.\n if (Field->getType()->isIncompleteArrayType()) {\n if ((DesigIdx + 1) != DIE->size()) {\n // We can\'t designate an object within the flexible array\n // member (because GCC doesn\'t allow it).\n if (!VerifyOnly) {\n SemaRef.Diag(Field->getLocation(), diag::note_flexible_array_member) << *Field;"},{D,2897,"/// Check the well-formedness of a C99 designated initializer.\n///\n/// Determines whether the designated initializer @p DIE, which\n/// resides at the given @p Index within the initializer list @p\n/// IList, is well-formed for a current object of type @p DeclType\n/// (C99 6.7.8). The actual subobject that this designator refers to\n/// within the current subobject is returned in either\n/// @p NextField or @p NextElementIndex (whichever is appropriate).\n///\n/// @param IList The initializer list in which this designated\n/// initializer occurs.\n///\n/// @param DIE The designated initializer expression.\n///\n/// @param DesigIdx The index of the current designator.\n///\n/// @param CurrentObjectType The type of the \"current object\" (C99 6.7.8p17),\n/// into which the designation in @p DIE should refer.\n///\n/// @param NextField If non-NULL and the first designator in @p DIE is\n/// a field, this will be set to the field declaration corresponding\n/// to the field named by the designator. On input, this is expected to be\n/// the next field that would be initialized in the absence of designation,\n/// if the complete object being initialized is a struct.\n///\n/// @param NextElementIndex If non-NULL and the first designator in @p\n/// DIE is an array designator or GNU array-range designator, this\n/// will be set to the last index initialized by this designator.\n///\n/// @param Index Index into @p IList where the designated initializer\n/// @p DIE occurs.\n///\n/// @param StructuredList The initializer list expression that\n/// describes all of the subobject initializers in the order they\'ll\n/// actually be initialized.\n///\n/// @returns true if there was an error, false otherwise.\nbool InitListChecker::CheckDesignatedInitializer(const InitializedEntity &Entity, InitListExpr *IList, DesignatedInitExpr *DIE, unsigned DesigIdx, QualType &CurrentObjectType, RecordDecl::field_iterator *NextField, llvm::APSInt *NextElementIndex, unsigned &Index, InitListExpr *StructuredList, unsigned &StructuredIndex, bool FinishSubobjectInit, bool TopLevelObject) {\n if (D->isFieldDesignator()) {\n // This designator names a flexible array member.\n if (Field->getType()->isIncompleteArrayType()) {\n if (!hadError && !isa<InitListExpr>(DIE->getInit()) && !isa<StringLiteral>(DIE->getInit())) {\n // The initializer is not an initializer list.\n if (!VerifyOnly) {\n SemaRef.Diag(Field->getLocation(), diag::note_flexible_array_member) << *Field;"},{D,5568,"static void TryOrBuildParenListInitialization(Sema &S, const InitializedEntity &Entity, const InitializationKind &Kind, ArrayRef<Expr *> Args, InitializationSequence &Sequence, bool VerifyOnly, ExprResult *Result = nullptr) {\n if (const ArrayType *AT = S.getASTContext().getAsArrayType(Entity.getType())) {\n } else if (auto *RT = Entity.getType()->getAs<RecordType>()) {\n for (FieldDecl *FD : RD->fields()) {\n if (EntityIndexToProcess < Args.size()) {\n // Incomplete array types indicate flexible array members. Do not allow\n // paren list initializations of structs with these members, as GCC\n // doesn\'t either.\n if (FD->getType()->isIncompleteArrayType()) {\n if (!VerifyOnly) {\n S.Diag(FD->getLocation(), diag::note_flexible_array_member) << FD;"}} | ||
}, | }, | ||
["note_for_range_begin_end"]={ | ["note_for_range_begin_end"]={ | ||
Line 4,907: | Line 4,907: | ||
[c]=o, | [c]=o, | ||
[m]={"02e85f3bc5fc",1302818966,"Add support for C++0x\'s range-based for loops, as specified by the C++11 draft standard (N3291)."}, | [m]={"02e85f3bc5fc",1302818966,"Add support for C++0x\'s range-based for loops, as specified by the C++11 draft standard (N3291)."}, | ||
[n]={{A, | [n]={{A,2442,"/// Produce a note indicating which begin/end function was implicitly called\n/// by a C++11 for-range statement. This is often not obvious from the code,\n/// nor from the diagnostics produced when analysing the implicit expressions\n/// required in a for-range statement.\nvoid NoteForRangeBeginEndFunction(Sema &SemaRef, Expr *E, BeginEndFunction BEF) {\n SemaRef.Diag(Loc, diag::note_for_range_begin_end) << BEF << IsTemplate << Description << E->getType();"},{"clang/unittests/Format/FormatTest.cpp",10174,"TEST_F(FormatTest, AlignsPipes) {\n verifyFormat(\"SemaRef.Diag(Loc, diag::note_for_range_begin_end)\\n\""}} | ||
}, | }, | ||
["note_for_range_invalid_iterator"]={ | ["note_for_range_invalid_iterator"]={ | ||
Line 4,919: | Line 4,919: | ||
[c]=o, | [c]=o, | ||
[m]={"22a3fe1b9c95",1346968208,"Clarified diagnostics for range-based for loops with invalid ranges"}, | [m]={"22a3fe1b9c95",1346968208,"Clarified diagnostics for range-based for loops with invalid ranges"}, | ||
[n]={{A, | [n]={{A,3000,"/// BuildCXXForRangeStmt - Build or instantiate a C++11 for-range statement.\nStmtResult Sema::BuildCXXForRangeStmt(SourceLocation ForLoc, SourceLocation CoawaitLoc, Stmt *InitStmt, SourceLocation ColonLoc, Stmt *RangeDecl, Stmt *Begin, Stmt *End, Expr *Cond, Expr *Inc, Stmt *LoopVarDecl, SourceLocation RParenLoc, BuildForRangeKind Kind) {\n if (RangeVarType->isDependentType()) {\n } else if (!BeginDeclStmt.get()) {\n if (NotEqExpr.isInvalid()) {\n Diag(RangeLoc, diag::note_for_range_invalid_iterator) << RangeLoc << 0 << BeginRangeRef.get()->getType();"},{A,3023,"/// BuildCXXForRangeStmt - Build or instantiate a C++11 for-range statement.\nStmtResult Sema::BuildCXXForRangeStmt(SourceLocation ForLoc, SourceLocation CoawaitLoc, Stmt *InitStmt, SourceLocation ColonLoc, Stmt *RangeDecl, Stmt *Begin, Stmt *End, Expr *Cond, Expr *Inc, Stmt *LoopVarDecl, SourceLocation RParenLoc, BuildForRangeKind Kind) {\n if (RangeVarType->isDependentType()) {\n } else if (!BeginDeclStmt.get()) {\n if (IncrExpr.isInvalid()) {\n Diag(RangeLoc, diag::note_for_range_invalid_iterator) << RangeLoc << 2 << BeginRangeRef.get()->getType();"},{A,3037,"/// BuildCXXForRangeStmt - Build or instantiate a C++11 for-range statement.\nStmtResult Sema::BuildCXXForRangeStmt(SourceLocation ForLoc, SourceLocation CoawaitLoc, Stmt *InitStmt, SourceLocation ColonLoc, Stmt *RangeDecl, Stmt *Begin, Stmt *End, Expr *Cond, Expr *Inc, Stmt *LoopVarDecl, SourceLocation RParenLoc, BuildForRangeKind Kind) {\n if (RangeVarType->isDependentType()) {\n } else if (!BeginDeclStmt.get()) {\n if (DerefExpr.isInvalid()) {\n Diag(RangeLoc, diag::note_for_range_invalid_iterator) << RangeLoc << 1 << BeginRangeRef.get()->getType();"}} | ||
}, | }, | ||
["note_for_range_member_begin_end_ignored"]={ | ["note_for_range_member_begin_end_ignored"]={ | ||
Line 4,931: | Line 4,931: | ||
[c]=o, | [c]=o, | ||
[m]={"236ffdeeb2e0",1537831064,"P0962R1: only use the member form of \'begin\' and \'end\' in a range-based"}, | [m]={"236ffdeeb2e0",1537831064,"P0962R1: only use the member form of \'begin\' and \'end\' in a range-based"}, | ||
[n]={{A, | [n]={{A,2678,"/// Create the initialization, compare, and increment steps for\n/// the range-based for loop expression.\n/// This function does not handle array-based for loops,\n/// which are created in Sema::BuildCXXForRangeStmt.\n///\n/// \\returns a ForRangeStatus indicating success or what kind of error occurred.\n/// BeginExpr and EndExpr are set and FRS_Success is returned on success;\n/// CandidateSet and BEF are set and some non-success value is returned on\n/// failure.\nstatic Sema::ForRangeStatus BuildNonArrayForRange(Sema &SemaRef, Expr *BeginRange, Expr *EndRange, QualType RangeType, VarDecl *BeginVar, VarDecl *EndVar, SourceLocation ColonLoc, SourceLocation CoawaitLoc, OverloadCandidateSet *CandidateSet, ExprResult *BeginExpr, ExprResult *EndExpr, BeginEndFunction *BEF) {\n if (CXXRecordDecl *D = RangeType->getAsCXXRecordDecl()) {\n if (BeginMemberLookup.empty() != EndMemberLookup.empty()) {\n // Look up the non-member form of the member we didn\'t find, first.\n // This way we prefer a \"no viable \'end\'\" diagnostic over a \"i found\n // a \'begin\' but ignored it because there was no member \'end\'\"\n // diagnostic.\n auto BuildNonmember = [&](BeginEndFunction BEFFound, LookupResult &Found, llvm::function_ref<Sema::ForRangeStatus()> BuildFound, llvm::function_ref<Sema::ForRangeStatus()> BuildNotFound) {\n case Sema::FRS_DiagnosticIssued:\n for (NamedDecl *D : OldFound) {\n SemaRef.Diag(D->getLocation(), diag::note_for_range_member_begin_end_ignored) << BeginRange->getType() << BEFFound;"}} | ||
}, | }, | ||
["note_force_empty_selector_name"]={ | ["note_force_empty_selector_name"]={ | ||
Line 4,943: | Line 4,943: | ||
[c]=Q, | [c]=Q, | ||
[m]={"84f498433116",1347923399,"objective-C: improve on warnings about misplacement of method"}, | [m]={"84f498433116",1347923399,"objective-C: improve on warnings about misplacement of method"}, | ||
[n]={{Kb, | [n]={{Kb,1511,"/// objc-method-decl:\n/// objc-selector\n/// objc-keyword-selector objc-parmlist[opt]\n/// objc-type-name objc-selector\n/// objc-type-name objc-keyword-selector objc-parmlist[opt]\n///\n/// objc-keyword-selector:\n/// objc-keyword-decl\n/// objc-keyword-selector objc-keyword-decl\n///\n/// objc-keyword-decl:\n/// objc-selector \':\' objc-type-name objc-keyword-attributes[opt] identifier\n/// objc-selector \':\' objc-keyword-attributes[opt] identifier\n/// \':\' objc-type-name objc-keyword-attributes[opt] identifier\n/// \':\' objc-keyword-attributes[opt] identifier\n///\n/// objc-parmlist:\n/// objc-parms objc-ellipsis[opt]\n///\n/// objc-parms:\n/// objc-parms , parameter-declaration\n///\n/// objc-ellipsis:\n/// , ...\n///\n/// objc-keyword-attributes: [OBJC2]\n/// __attribute__((unused))\n///\nDecl *Parser::ParseObjCMethodDecl(SourceLocation mLoc, tok::TokenKind mType, tok::ObjCKeywordKind MethodImplKind, bool MethodDefinition) {\n while (true) {\n if (!SelIdent) {\n if (PP.getLocForEndOfToken(ArgInfo.NameLoc) == ColonLoc) {\n Diag(ColonLoc, diag::note_force_empty_selector_name) << ArgInfo.Name;"}} | ||
}, | }, | ||
["note_format_fix_specifier"]={ | ["note_format_fix_specifier"]={ | ||
Line 4,955: | Line 4,955: | ||
[c]=o, | [c]=o, | ||
[m]={"92303592c324",1347076803,"Format strings: %Ld isn\'t available on Darwin or Windows."}, | [m]={"92303592c324",1347076803,"Format strings: %Ld isn\'t available on Darwin or Windows."}, | ||
[n]={{y, | [n]={{y,10140,"void CheckFormatHandler::HandleInvalidLengthModifier(const analyze_format_string::FormatSpecifier &FS, const analyze_format_string::ConversionSpecifier &CS, const char *startSpecifier, unsigned specifierLen, unsigned DiagID) {\n if (FixedLM) {\n S.Diag(getLocationOfByte(LM.getStart()), diag::note_format_fix_specifier) << FixedLM->toString() << FixItHint::CreateReplacement(LMRange, FixedLM->toString());"},{y,10174,"void CheckFormatHandler::HandleNonStandardLengthModifier(const analyze_format_string::FormatSpecifier &FS, const char *startSpecifier, unsigned specifierLen) {\n if (FixedLM) {\n S.Diag(getLocationOfByte(LM.getStart()), diag::note_format_fix_specifier) << FixedLM->toString() << FixItHint::CreateReplacement(LMRange, FixedLM->toString());"},{y,10202,"void CheckFormatHandler::HandleNonStandardConversionSpecifier(const analyze_format_string::ConversionSpecifier &CS, const char *startSpecifier, unsigned specifierLen) {\n if (FixedCS) {\n S.Diag(getLocationOfByte(CS.getStart()), diag::note_format_fix_specifier) << FixedCS->toString() << FixItHint::CreateReplacement(CSRange, FixedCS->toString());"}} | ||
}, | }, | ||
["note_format_security_fixit"]={ | ["note_format_security_fixit"]={ | ||
Line 4,967: | Line 4,967: | ||
[c]=o, | [c]=o, | ||
[m]={"57819fc809d1",1458075398,"Move the fixit for -Wformat-security to a note."}, | [m]={"57819fc809d1",1458075398,"Move the fixit for -Wformat-security to a note."}, | ||
[n]={{y, | [n]={{y,9973,"bool Sema::CheckFormatArguments(ArrayRef<const Expr *> Args, Sema::FormatArgumentPassingKind APK, unsigned format_idx, unsigned firstDataArg, FormatStringType Type, VariadicCallType CallType, SourceLocation Loc, SourceRange Range, llvm::SmallBitVector &CheckedVarArgs) {\n // If there are no arguments specified, warn with -Wformat-security, otherwise\n // warn only with -Wformat-nonliteral.\n if (Args.size() == firstDataArg) {\n case FST_Printf:\n Diag(FormatLoc, diag::note_format_security_fixit) << FixItHint::CreateInsertion(FormatLoc, \"\\\"%s\\\", \");"},{y,9977,"bool Sema::CheckFormatArguments(ArrayRef<const Expr *> Args, Sema::FormatArgumentPassingKind APK, unsigned format_idx, unsigned firstDataArg, FormatStringType Type, VariadicCallType CallType, SourceLocation Loc, SourceRange Range, llvm::SmallBitVector &CheckedVarArgs) {\n // If there are no arguments specified, warn with -Wformat-security, otherwise\n // warn only with -Wformat-nonliteral.\n if (Args.size() == firstDataArg) {\n case FST_NSString:\n Diag(FormatLoc, diag::note_format_security_fixit) << FixItHint::CreateInsertion(FormatLoc, \"@\\\"%@\\\", \");"}} | ||
}, | }, | ||
["note_format_string_defined"]={ | ["note_format_string_defined"]={ | ||
Line 4,979: | Line 4,979: | ||
[c]=o, | [c]=o, | ||
[m]={"03cf7b70e0d6",1319762485,"Fix for PR9751 to change the behavior of -Wformat warnings. If the format"}, | [m]={"03cf7b70e0d6",1319762485,"Fix for PR9751 to change the behavior of -Wformat warnings. If the format"}, | ||
[n]={{y, | [n]={{y,10437,"/// If the format string is not within the function call, emit a note\n/// so that the function call and string are in diagnostic messages.\n///\n/// \\param InFunctionCall if true, the format string is within the function\n/// call and only one diagnostic message will be produced. Otherwise, an\n/// extra note will be emitted pointing to location of the format string.\n///\n/// \\param ArgumentExpr the expression that is passed as the format string\n/// argument in the function call. Used for getting locations when two\n/// diagnostics are emitted.\n///\n/// \\param PDiag the callee should already have provided any strings for the\n/// diagnostic message. This function only adds locations and fixits\n/// to diagnostics.\n///\n/// \\param Loc primary location for diagnostic. If two diagnostics are\n/// required, one will be at Loc and a new SourceLocation will be created for\n/// the other one.\n///\n/// \\param IsStringLocation if true, Loc points to the format string should be\n/// used for the note. Otherwise, Loc points to the argument list and will\n/// be used with PDiag.\n///\n/// \\param StringRange some or all of the string to highlight. This is\n/// templated so it can accept either a CharSourceRange or a SourceRange.\n///\n/// \\param FixIt optional fix it hint for the format string.\ntemplate <typename Range> void CheckFormatHandler::EmitFormatDiagnostic(Sema &S, bool InFunctionCall, const Expr *ArgumentExpr, const PartialDiagnostic &PDiag, SourceLocation Loc, bool IsStringLocation, Range StringRange, ArrayRef<FixItHint> FixIt) {\n if (InFunctionCall) {\n } else {\n const Sema::SemaDiagnosticBuilder &Note = S.Diag(IsStringLocation ? Loc : StringRange.getBegin(), diag::note_format_string_defined);"}} | ||
}, | }, | ||
["note_forward_class"]={ | ["note_forward_class"]={ | ||
Line 4,991: | Line 4,991: | ||
[c]=o, | [c]=o, | ||
[m]={"7cabbe04ebdd",1292460988,"Improve diagnostics when property being looked up"}, | [m]={"7cabbe04ebdd",1292460988,"Improve diagnostics when property being looked up"}, | ||
[n]={{V, | [n]={{V,552,"/// Actually emit an availability diagnostic for a reference to an unavailable\n/// decl.\n///\n/// \\param Ctx The context that the reference occurred in\n/// \\param ReferringDecl The exact declaration that was referenced.\n/// \\param OffendingDecl A related decl to \\c ReferringDecl that has an\n/// availability attribute corresponding to \\c K attached to it. Note that this\n/// may not be the same as ReferringDecl, i.e. if an EnumDecl is annotated and\n/// we refer to a member EnumConstantDecl, ReferringDecl is the EnumConstantDecl\n/// and OffendingDecl is the EnumDecl.\nstatic void DoEmitAvailabilityWarning(Sema &S, AvailabilityResult K, Decl *Ctx, const NamedDecl *ReferringDecl, const NamedDecl *OffendingDecl, StringRef Message, ArrayRef<SourceLocation> Locs, const ObjCInterfaceDecl *UnknownObjCClass, const ObjCPropertyDecl *ObjCProperty, bool ObjCPropertyAccess) {\n if (!Message.empty()) {\n } else if (!UnknownObjCClass) {\n } else {\n S.Diag(UnknownObjCClass->getLocation(), diag::note_forward_class);"},{s,210,"/// Validates ObjCInterfaceDecl availability.\n/// ObjCInterfaceDecl, used to create ObjC literals, should be defined\n/// if clang not in a debugger mode.\nstatic bool ValidateObjCLiteralInterfaceDecl(Sema &S, ObjCInterfaceDecl *Decl, SourceLocation Loc, Sema::ObjCLiteralKind LiteralKind) {\n if (!Decl) {\n } else if (!Decl->hasDefinition() && !S.getLangOpts().DebuggerObjCLiteral) {\n S.Diag(Decl->getLocation(), diag::note_forward_class);"},{B,9253,"/// The implementation of RequireCompleteType\nbool Sema::RequireCompleteTypeImpl(SourceLocation Loc, QualType T, CompleteTypeKind Kind, TypeDiagnoser *Diagnoser) {\n // If the Objective-C class was a forward declaration, produce a note.\n if (IFace && !IFace->isInvalidDecl() && !IFace->getLocation().isInvalid())\n Diag(IFace->getLocation(), diag::note_forward_class);"}} | ||
}, | }, | ||
["note_forward_class_conversion"]={ | ["note_forward_class_conversion"]={ | ||
Line 5,003: | Line 5,003: | ||
[c]=o, | [c]=o, | ||
[m]={Y,1582847864,W}, | [m]={Y,1582847864,W}, | ||
[n]={{D, | [n]={{D,9493,"/// Emit notes associated with an initialization that failed due to a\n/// \"simple\" conversion failure.\nstatic void emitBadConversionNotes(Sema &S, const InitializedEntity &entity, Expr *op) {\n if (fromDecl && destDecl && fromDecl->getDeclKind() == Decl::CXXRecord && destDecl->getDeclKind() == Decl::CXXRecord && !fromDecl->isInvalidDecl() && !destDecl->isInvalidDecl() && !fromDecl->hasDefinition() && destPointeeType.getQualifiers().compatiblyIncludes(fromPointeeType.getQualifiers()))\n S.Diag(fromDecl->getLocation(), diag::note_forward_class_conversion) << S.getASTContext().getTagDeclType(fromDecl) << S.getASTContext().getTagDeclType(destDecl);"}} | ||
}, | }, | ||
["note_forward_declaration"]={ | ["note_forward_declaration"]={ | ||
Line 5,015: | Line 5,015: | ||
[c]=a, | [c]=a, | ||
[m]={wb,1236199783,vb}, | [m]={wb,1236199783,vb}, | ||
[n]={{u, | [n]={{u,10328,"// Explicit instantiation of a member class of a class template.\nDeclResult Sema::ActOnExplicitInstantiation(Scope *S, SourceLocation ExternLoc, SourceLocation TemplateLoc, unsigned TagSpec, SourceLocation KWLoc, CXXScopeSpec &SS, IdentifierInfo *Name, SourceLocation NameLoc, const ParsedAttributesView &Attr) {\n if (!RecordDef) {\n if (!Def) {\n Diag(Pattern->getLocation(), diag::note_forward_declaration) << Pattern;"},{B,9248,"/// The implementation of RequireCompleteType\nbool Sema::RequireCompleteTypeImpl(SourceLocation Loc, QualType T, CompleteTypeKind Kind, TypeDiagnoser *Diagnoser) {\n // If the type was a forward declaration of a class/struct/union\n // type, produce a note.\n if (Tag && !Tag->isInvalidDecl() && !Tag->getLocation().isInvalid())\n Diag(Tag->getLocation(), Tag->isBeingDefined() ? diag::note_type_being_defined : diag::note_forward_declaration) << Context.getTagDeclType(Tag);"},{B,9531,"QualType Sema::BuiltinEnumUnderlyingType(QualType BaseType, SourceLocation Loc) {\n if (BaseType->isIncompleteType(&FwdDecl)) {\n Diag(FwdDecl->getLocation(), diag::note_forward_declaration) << FwdDecl;"}} | ||
}, | }, | ||
["note_forward_template_decl"]={ | ["note_forward_template_decl"]={ | ||
Line 5,027: | Line 5,027: | ||
[c]=o, | [c]=o, | ||
[m]={"7dcc97e7ac0a",1461046792,"Warn if function or variable cannot be implicitly instantiated"}, | [m]={"7dcc97e7ac0a",1461046792,"Warn if function or variable cannot be implicitly instantiated"}, | ||
[n]={{dc, | [n]={{dc,4903,"/// Instantiate the definition of the given function from its\n/// template.\n///\n/// \\param PointOfInstantiation the point at which the instantiation was\n/// required. Note that this is not precisely a \"point of instantiation\"\n/// for the function, but it\'s close.\n///\n/// \\param Function the already-instantiated declaration of a\n/// function template specialization or member function of a class template\n/// specialization.\n///\n/// \\param Recursive if true, recursively instantiates any functions that\n/// are required by this instantiation.\n///\n/// \\param DefinitionRequired if true, then we are performing an explicit\n/// instantiation where the body of the function is required. Complain if\n/// there is no such body.\nvoid Sema::InstantiateFunctionDefinition(SourceLocation PointOfInstantiation, FunctionDecl *Function, bool Recursive, bool DefinitionRequired, bool AtEndOfTU) {\n // FIXME: We need to track the instantiation stack in order to know which\n // definitions should be visible within this instantiation.\n if (DiagnoseUninstantiableTemplate(PointOfInstantiation, Function, Function->getInstantiatedFromMemberFunction(), PatternDecl, PatternDef, TSK,\n if (DefinitionRequired)\n else if (TSK == TSK_ExplicitInstantiationDefinition || (Function->isConstexpr() && !Recursive)) {\n } else if (TSK == TSK_ImplicitInstantiation) {\n if (AtEndOfTU && !getDiagnostics().hasErrorOccurred() && !getSourceManager().isInSystemHeader(PatternDecl->getBeginLoc())) {\n Diag(PatternDecl->getLocation(), diag::note_forward_template_decl);"},{dc,5529,"/// Instantiate the definition of the given variable from its\n/// template.\n///\n/// \\param PointOfInstantiation the point at which the instantiation was\n/// required. Note that this is not precisely a \"point of instantiation\"\n/// for the variable, but it\'s close.\n///\n/// \\param Var the already-instantiated declaration of a templated variable.\n///\n/// \\param Recursive if true, recursively instantiates any functions that\n/// are required by this instantiation.\n///\n/// \\param DefinitionRequired if true, then we are performing an explicit\n/// instantiation where a definition of the variable is required. Complain\n/// if there is no such definition.\nvoid Sema::InstantiateVariableDefinition(SourceLocation PointOfInstantiation, VarDecl *Var, bool Recursive, bool DefinitionRequired, bool AtEndOfTU) {\n // If we don\'t have a definition of the variable template, we won\'t perform\n // any instantiation. Rather, we rely on the user to instantiate this\n // definition (or provide a specialization for it) in another translation\n // unit.\n if (!Def && !DefinitionRequired) {\n if (TSK == TSK_ExplicitInstantiationDefinition) {\n } else if (TSK == TSK_ImplicitInstantiation) {\n // Warn about missing definition at the end of translation unit.\n if (AtEndOfTU && !getDiagnostics().hasErrorOccurred() && !getSourceManager().isInSystemHeader(PatternDecl->getBeginLoc())) {\n Diag(PatternDecl->getLocation(), diag::note_forward_template_decl);"}} | ||
}, | }, | ||
["note_found_mutex_near_match"]={ | ["note_found_mutex_near_match"]={ | ||
Line 5,039: | Line 5,039: | ||
[c]=o, | [c]=o, | ||
[m]={"5ff1644e624e",1347307103,"Thread-safety analysis: differentiate between two forms of analysis; a precise"}, | [m]={"5ff1644e624e",1347307103,"Thread-safety analysis: differentiate between two forms of analysis; a precise"}, | ||
[n]={{Z, | [n]={{Z,1979,"class ThreadSafetyReporter : public clang::threadSafety::ThreadSafetyHandler {\n void handleMutexNotHeld(StringRef Kind, const NamedDecl *D, ProtectedOperationKind POK, Name LockName, LockKind LK, SourceLocation Loc, Name *PossibleMatch) override {\n if (PossibleMatch) {\n PartialDiagnosticAt Note(Loc, S.PDiag(diag::note_found_mutex_near_match) << *PossibleMatch);"}} | ||
}, | }, | ||
["note_from_diagnose_if"]={ | ["note_from_diagnose_if"]={ | ||
Line 5,051: | Line 5,051: | ||
[c]=o, | [c]=o, | ||
[m]={"177399e2277c",1483935134,"Add the diagnose_if attribute to clang."}, | [m]={"177399e2277c",1483935134,"Add the diagnose_if attribute to clang."}, | ||
[n]={{P, | [n]={{P,6953,"template <typename CheckFn> static bool diagnoseDiagnoseIfAttrsWith(Sema &S, const NamedDecl *ND, bool ArgDependent, SourceLocation Loc, CheckFn &&IsSuccessful) {\n if (ErrAttr != WarningBegin) {\n S.Diag(DIA->getLocation(), diag::note_from_diagnose_if) << DIA->getParent() << DIA->getCond()->getSourceRange();"},{P,6961,"template <typename CheckFn> static bool diagnoseDiagnoseIfAttrsWith(Sema &S, const NamedDecl *ND, bool ArgDependent, SourceLocation Loc, CheckFn &&IsSuccessful) {\n for (const auto *DIA : llvm::make_range(WarningBegin, Attrs.end()))\n if (IsSuccessful(DIA)) {\n S.Diag(DIA->getLocation(), diag::note_from_diagnose_if) << DIA->getParent() << DIA->getCond()->getSourceRange();"}} | ||
}, | }, | ||
["note_function_style_cast_add_parentheses"]={ | ["note_function_style_cast_add_parentheses"]={ | ||
Line 5,063: | Line 5,063: | ||
[c]=o, | [c]=o, | ||
[m]={"ac63d63543ca",1506729445,"Add a \"vexing parse\" warning for ambiguity between a variable declaration and a"}, | [m]={"ac63d63543ca",1506729445,"Add a \"vexing parse\" warning for ambiguity between a variable declaration and a"}, | ||
[n]={{B, | [n]={{B,4031,"/// Produce an appropriate diagnostic for a declarator with top-level\n/// parentheses.\nstatic void warnAboutRedundantParens(Sema &S, Declarator &D, QualType T) {\n S.Diag(D.getBeginLoc(), diag::note_function_style_cast_add_parentheses) << FixItHint::CreateInsertion(D.getBeginLoc(), \"(\") << FixItHint::CreateInsertion(S.getLocForEndOfToken(D.getEndLoc()), \")\");"}} | ||
}, | }, | ||
["note_function_suggestion"]={ | ["note_function_suggestion"]={ | ||
Line 5,075: | Line 5,075: | ||
[c]=o, | [c]=o, | ||
[m]={"2fb8b91f6f96",1323164772,"Suggest typo corrections for implicit function declarations."}, | [m]={"2fb8b91f6f96",1323164772,"Suggest typo corrections for implicit function declarations."}, | ||
[n]={{t, | [n]={{t,16078,"/// ImplicitlyDefineFunction - An undeclared identifier was used in a function\n/// call, forming a call to an implicitly defined function (per C99 6.5.1p2).\nNamedDecl *Sema::ImplicitlyDefineFunction(SourceLocation Loc, IdentifierInfo &II, Scope *S) {\n if (Corrected) {\n if (Diagnose)\n diagnoseTypo(Corrected, PDiag(diag::note_function_suggestion),"}} | ||
}, | }, | ||
["note_function_template_deduction_instantiation_here"]={ | ["note_function_template_deduction_instantiation_here"]={ | ||
Line 5,087: | Line 5,087: | ||
[c]=o, | [c]=o, | ||
[m]={"ff6cbdf806da",1246485666,"Keep track of more information within the template instantiation stack, e.g.,"}, | [m]={"ff6cbdf806da",1246485666,"Keep track of more information within the template instantiation stack, e.g.,"}, | ||
[n]={{z, | [n]={{z,833,"/// Prints the current instantiation stack through a series of\n/// notes.\nvoid Sema::PrintInstantiationStack() {\n for (SmallVectorImpl<CodeSynthesisContext>::reverse_iterator Active = CodeSynthesisContexts.rbegin(), ActiveEnd = CodeSynthesisContexts.rend(); Active != ActiveEnd; ++Active, ++InstantiationIdx) {\n case CodeSynthesisContext::DeducedTemplateArgumentSubstitution: {\n if (FunctionTemplateDecl *FnTmpl = dyn_cast<FunctionTemplateDecl>(Active->Entity)) {\n Diags.Report(Active->PointOfInstantiation, diag::note_function_template_deduction_instantiation_here) << FnTmpl << getTemplateArgumentBindingsText(FnTmpl->getTemplateParameters(), Active->TemplateArgs, Active->NumTemplateArgs) << Active->InstantiationRange;"}} | ||
}, | }, | ||
["note_function_template_spec_here"]={ | ["note_function_template_spec_here"]={ | ||
Line 5,099: | Line 5,099: | ||
[c]=o, | [c]=o, | ||
[m]={"4adbc6d947b0",1245975003,"Implicit instantiation for function template specializations."}, | [m]={"4adbc6d947b0",1245975003,"Implicit instantiation for function template specializations."}, | ||
[n]={{z, | [n]={{z,772,"/// Prints the current instantiation stack through a series of\n/// notes.\nvoid Sema::PrintInstantiationStack() {\n for (SmallVectorImpl<CodeSynthesisContext>::reverse_iterator Active = CodeSynthesisContexts.rbegin(), ActiveEnd = CodeSynthesisContexts.rend(); Active != ActiveEnd; ++Active, ++InstantiationIdx) {\n case CodeSynthesisContext::TemplateInstantiation: {\n if (CXXRecordDecl *Record = dyn_cast<CXXRecordDecl>(D)) {\n } else if (FunctionDecl *Function = dyn_cast<FunctionDecl>(D)) {\n if (Function->getPrimaryTemplate())\n DiagID = diag::note_function_template_spec_here;"}} | ||
}, | }, | ||
["note_function_template_spec_matched"]={ | ["note_function_template_spec_matched"]={ | ||
Line 5,111: | Line 5,111: | ||
[c]=o, | [c]=o, | ||
[m]={"3a923c2d3799",1253834087,"WIP implementation of explicit function template specialization. This"}, | [m]={"3a923c2d3799",1253834087,"WIP implementation of explicit function template specialization. This"}, | ||
[n]={{u, | [n]={{u,9500,"/// Perform semantic analysis for the given function template\n/// specialization.\n///\n/// This routine performs all of the semantic analysis required for an\n/// explicit function template specialization. On successful completion,\n/// the function declaration \\p FD will become a function template\n/// specialization.\n///\n/// \\param FD the function declaration, which will be updated to become a\n/// function template specialization.\n///\n/// \\param ExplicitTemplateArgs the explicitly-provided template arguments,\n/// if any. Note that this may be valid info even when 0 arguments are\n/// explicitly provided as in, e.g., \\c void sort<>(char*, char*);\n/// as it anyway contains info on the angle brackets locations.\n///\n/// \\param Previous the set of declarations that may be specialized by\n/// this function specialization.\n///\n/// \\param QualifiedFriend whether this is a lookup for a qualified friend\n/// declaration with no explicit template argument list that might be\n/// befriending a function template specialization.\nbool Sema::CheckFunctionTemplateSpecialization(FunctionDecl *FD, TemplateArgumentListInfo *ExplicitTemplateArgs, LookupResult &Previous, bool QualifiedFriend) {\n UnresolvedSetIterator Result = getMostSpecialized(Candidates.begin(), Candidates.end(), FailedCandidates, FD->getLocation(), PDiag(diag::err_function_template_spec_no_match) << FD->getDeclName(), PDiag(diag::err_function_template_spec_ambiguous) << FD->getDeclName() << (ExplicitTemplateArgs != nullptr), PDiag(diag::note_function_template_spec_matched));"}} | ||
}, | }, | ||
["note_function_to_function_call"]={ | ["note_function_to_function_call"]={ | ||
Line 5,123: | Line 5,123: | ||
[c]=o, | [c]=o, | ||
[m]={"3bb8b56a5d90",1393382166,"PR16074, implement warnings to catch pointer to boolean true and pointer to"}, | [m]={"3bb8b56a5d90",1393382166,"PR16074, implement warnings to catch pointer to boolean true and pointer to"}, | ||
[n]={{y, | [n]={{y,15621,"/// Diagnose pointers that are always non-null.\n/// \\param E the expression containing the pointer\n/// \\param NullKind NPCK_NotNull if E is a cast to bool, otherwise, E is\n/// compared to a null pointer\n/// \\param IsEqual True when the comparison is equal to a null pointer\n/// \\param Range Extra SourceRange to highlight in the diagnostic\nvoid Sema::DiagnoseAlwaysNonNullPointer(Expr *E, Expr::NullPointerConstantKind NullKind, bool IsEqual, SourceRange Range) {\n Diag(E->getExprLoc(), diag::note_function_to_function_call) << FixItHint::CreateInsertion(getLocForEndOfToken(E->getEndLoc()), \"()\");"}} | ||
}, | }, | ||
["note_function_warning_silence"]={ | ["note_function_warning_silence"]={ | ||
Line 5,135: | Line 5,135: | ||
[c]=o, | [c]=o, | ||
[m]={"3bb8b56a5d90",1393382166,"PR16074, implement warnings to catch pointer to boolean true and pointer to"}, | [m]={"3bb8b56a5d90",1393382166,"PR16074, implement warnings to catch pointer to boolean true and pointer to"}, | ||
[n]={{y, | [n]={{y,15592,"/// Diagnose pointers that are always non-null.\n/// \\param E the expression containing the pointer\n/// \\param NullKind NPCK_NotNull if E is a cast to bool, otherwise, E is\n/// compared to a null pointer\n/// \\param IsEqual True when the comparison is equal to a null pointer\n/// \\param Range Extra SourceRange to highlight in the diagnostic\nvoid Sema::DiagnoseAlwaysNonNullPointer(Expr *E, Expr::NullPointerConstantKind NullKind, bool IsEqual, SourceRange Range) {\n Diag(E->getExprLoc(), diag::note_function_warning_silence) << FixItHint::CreateInsertion(E->getBeginLoc(), \"&\");"}} | ||
}, | }, | ||
["note_getter_unavailable"]={ | ["note_getter_unavailable"]={ | ||
Line 5,147: | Line 5,147: | ||
[c]=o, | [c]=o, | ||
[m]={"c5d61df0a96e",1266604230,"Issue extended diagnostic when property dot-syntax is used and "}, | [m]={"c5d61df0a96e",1266604230,"Issue extended diagnostic when property dot-syntax is used and "}, | ||
[n]={{s, | [n]={{s,2152,"/// HandleExprPropertyRefExpr - Handle foo.bar where foo is a pointer to an\n/// objective C interface. This is a property reference expression.\nExprResult Sema::HandleExprPropertyRefExpr(const ObjCObjectPointerType *OPT, Expr *BaseExpr, SourceLocation OpLoc, DeclarationName MemberName, SourceLocation MemberLoc, SourceLocation SuperLoc, QualType SuperType, bool Super) {\n if (Setter)\n Diag(Setter->getLocation(), diag::note_getter_unavailable) << MemberName << BaseExpr->getSourceRange();"}} | ||
}, | }, | ||
["note_global_module_introducer_missing"]={ | ["note_global_module_introducer_missing"]={ | ||
Line 5,159: | Line 5,159: | ||
[c]=Sb, | [c]=Sb, | ||
[m]={"d652bdd05f1c",1555229219,"[c++20] Parsing support for module-declarations, import-declarations,"}, | [m]={"d652bdd05f1c",1555229219,"[c++20] Parsing support for module-declarations, import-declarations,"}, | ||
[n]={{cb, | [n]={{cb,255,"Sema::DeclGroupPtrTy Sema::ActOnModuleDecl(SourceLocation StartLoc, SourceLocation ModuleLoc, ModuleDeclKind MDK, ModuleIdPath Path, ModuleIdPath Partition, ModuleImportState &ImportState) {\n // In C++20, the module-declaration must be the first declaration if there\n // is no global module fragment.\n if (getLangOpts().CPlusPlusModules && !IsFirstDecl && !SeenGMF) {\n if (BeginLoc.isValid()) {\n Diag(BeginLoc, diag::note_global_module_introducer_missing) << FixItHint::CreateInsertion(BeginLoc, \"module;\\n\");"}} | ||
}, | }, | ||
["note_goto_ms_asm_label"]={ | ["note_goto_ms_asm_label"]={ | ||
Line 5,171: | Line 5,171: | ||
[c]=o, | [c]=o, | ||
[m]={"31097581aad8",1411352514,"ms-inline-asm: Scope inline asm labels to functions"}, | [m]={"31097581aad8",1411352514,"ms-inline-asm: Scope inline asm labels to functions"}, | ||
[n]={{x, | [n]={{x,997,"void JumpScopeChecker::CheckGotoStmt(GotoStmt *GS) {\n if (GS->getLabel()->isMSAsmLabel()) {\n S.Diag(GS->getLabel()->getLocation(), diag::note_goto_ms_asm_label) << GS->getLabel()->getIdentifier();"}} | ||
}, | }, | ||
["note_guarded_by_declared_here"]={ | ["note_guarded_by_declared_here"]={ | ||
Line 5,183: | Line 5,183: | ||
[c]=o, | [c]=o, | ||
[m]={"eb0ea5f40a48",1408052415,"Thread safety analysis: add -Wthread-safety-verbose flag, which adds additional notes that are helpf..."}, | [m]={"eb0ea5f40a48",1408052415,"Thread safety analysis: add -Wthread-safety-verbose flag, which adds additional notes that are helpf..."}, | ||
[n]={{Z, | [n]={{Z,1983,"class ThreadSafetyReporter : public clang::threadSafety::ThreadSafetyHandler {\n void handleMutexNotHeld(StringRef Kind, const NamedDecl *D, ProtectedOperationKind POK, Name LockName, LockKind LK, SourceLocation Loc, Name *PossibleMatch) override {\n if (PossibleMatch) {\n if (Verbose && POK == POK_VarAccess) {\n PartialDiagnosticAt VNote(D->getLocation(), S.PDiag(diag::note_guarded_by_declared_here) << D->getDeclName());"},{Z,2011,"class ThreadSafetyReporter : public clang::threadSafety::ThreadSafetyHandler {\n void handleMutexNotHeld(StringRef Kind, const NamedDecl *D, ProtectedOperationKind POK, Name LockName, LockKind LK, SourceLocation Loc, Name *PossibleMatch) override {\n if (PossibleMatch) {\n } else {\n if (Verbose && POK == POK_VarAccess) {\n PartialDiagnosticAt Note(D->getLocation(), S.PDiag(diag::note_guarded_by_declared_here));"}} | ||
}, | }, | ||
["note_header_guard"]={ | ["note_header_guard"]={ | ||
Line 5,195: | Line 5,195: | ||
[c]=R, | [c]=R, | ||
[m]={"33a4b3db0de5",1371072057,"Introducing -Wheader-guard, a warning that checks header guards actually work"}, | [m]={"33a4b3db0de5",1371072057,"Introducing -Wheader-guard, a warning that checks header guards actually work"}, | ||
[n]={{"clang/lib/Lex/PPLexerChange.cpp", | [n]={{"clang/lib/Lex/PPLexerChange.cpp",399,"/// HandleEndOfFile - This callback is invoked when the lexer hits the end of\n/// the current file. This either returns the EOF token or pops a level off\n/// the include stack and keeps going.\nbool Preprocessor::HandleEndOfFile(Token &Result, bool isEndOfMacro) {\n // See if this file had a controlling macro.\n if (CurPPLexer) { // Not ending a macro, ignore it.\n if (const IdentifierInfo *ControllingMacro = CurPPLexer->MIOpt.GetControllingMacroAtEndOfFile()) {\n // Okay, this has a controlling macro, remember in HeaderFileInfo.\n if (const FileEntry *FE = CurPPLexer->getFileEntry()) {\n if (const IdentifierInfo *DefinedMacro = CurPPLexer->MIOpt.GetDefinedMacro()) {\n if (!isMacroDefined(ControllingMacro) && DefinedMacro != ControllingMacro && CurLexer->isFirstTimeLexingFile()) {\n if (ED <= MaxHalfLength) {\n Diag(CurPPLexer->MIOpt.GetDefinedLocation(), diag::note_header_guard) << CurPPLexer->MIOpt.GetDefinedLocation() << DefinedMacro << ControllingMacro << FixItHint::CreateReplacement(CurPPLexer->MIOpt.GetDefinedLocation(), ControllingMacro->getName());"}} | ||
}, | }, | ||
["note_hidden_overloaded_virtual_declared_here"]={ | ["note_hidden_overloaded_virtual_declared_here"]={ | ||
Line 5,207: | Line 5,207: | ||
[c]=o, | [c]=o, | ||
[m]={"7272d9cf36cd",1296756075,"Implement -Woverloaded-virtual."}, | [m]={"7272d9cf36cd",1296756075,"Implement -Woverloaded-virtual."}, | ||
[n]={{q, | [n]={{q,10272,"void Sema::NoteHiddenVirtualMethods(CXXMethodDecl *MD, SmallVectorImpl<CXXMethodDecl *> &OverloadedMethods) {\n for (unsigned i = 0, e = OverloadedMethods.size(); i != e; ++i) {\n PartialDiagnostic PD = PDiag(diag::note_hidden_overloaded_virtual_declared_here) << overloadedMD;"}} | ||
}, | }, | ||
["note_hidden_tag"]={ | ["note_hidden_tag"]={ | ||
Line 5,219: | Line 5,219: | ||
[c]=o, | [c]=o, | ||
[m]={"6538c930503a",1255153699,"Qualified lookup through using declarations. Diagnose a new type of ambiguity."}, | [m]={"6538c930503a",1255153699,"Qualified lookup through using declarations. Diagnose a new type of ambiguity."}, | ||
[n]={{zb, | [n]={{zb,2845,"/// Produce a diagnostic describing the ambiguity that resulted\n/// from name lookup.\n///\n/// \\param Result The result of the ambiguous lookup to be diagnosed.\nvoid Sema::DiagnoseAmbiguousLookup(LookupResult &Result) {\n case LookupResult::AmbiguousTagHiding: {\n for (auto *D : Result)\n if (TagDecl *TD = dyn_cast<TagDecl>(D)) {\n Diag(TD->getLocation(), diag::note_hidden_tag);"}} | ||
}, | }, | ||
["note_hiding_object"]={ | ["note_hiding_object"]={ | ||
Line 5,231: | Line 5,231: | ||
[c]=o, | [c]=o, | ||
[m]={"6538c930503a",1255153699,"Qualified lookup through using declarations. Diagnose a new type of ambiguity."}, | [m]={"6538c930503a",1255153699,"Qualified lookup through using declarations. Diagnose a new type of ambiguity."}, | ||
[n]={{zb, | [n]={{zb,2850,"/// Produce a diagnostic describing the ambiguity that resulted\n/// from name lookup.\n///\n/// \\param Result The result of the ambiguous lookup to be diagnosed.\nvoid Sema::DiagnoseAmbiguousLookup(LookupResult &Result) {\n case LookupResult::AmbiguousTagHiding: {\n for (auto *D : Result)\n if (!isa<TagDecl>(D))\n Diag(D->getLocation(), diag::note_hiding_object);"}} | ||
}, | }, | ||
["note_ice_conversion_here"]={ | ["note_ice_conversion_here"]={ | ||
Line 5,243: | Line 5,243: | ||
[c]=o, | [c]=o, | ||
[m]={"f4c51d9d7613",1328349193,"In C++11 mode, when an integral constant expression is desired and we have a"}, | [m]={"f4c51d9d7613",1328349193,"In C++11 mode, when an integral constant expression is desired and we have a"}, | ||
[n]={{r, | [n]={{r,17877,"ExprResult Sema::VerifyIntegerConstantExpression(Expr *E, llvm::APSInt *Result, VerifyICEDiagnoser &Diagnoser, AllowFoldKind CanFold) {\n if (getLangOpts().CPlusPlus11) {\n class CXX11ConvertDiagnoser : public ICEConvertDiagnoser {\n SemaDiagnosticBuilder noteExplicitConv(Sema &S, CXXConversionDecl *Conv, QualType ConvTy) override { return S.Diag(Conv->getLocation(), diag::note_ice_conversion_here) << ConvTy->isEnumeralType() << ConvTy; }"},{r,17950,"ExprResult Sema::VerifyIntegerConstantExpression(Expr *E, llvm::APSInt *Result, VerifyICEDiagnoser &Diagnoser, AllowFoldKind CanFold) {\n if (getLangOpts().CPlusPlus11) {\n class CXX11ConvertDiagnoser : public ICEConvertDiagnoser {\n SemaDiagnosticBuilder noteAmbiguous(Sema &S, CXXConversionDecl *Conv, QualType ConvTy) override { return S.Diag(Conv->getLocation(), diag::note_ice_conversion_here) << ConvTy->isEnumeralType() << ConvTy; }"}} | ||
}, | }, | ||
["note_illegal_field_declared_here"]={ | ["note_illegal_field_declared_here"]={ | ||
Line 5,255: | Line 5,255: | ||
[c]=o, | [c]=o, | ||
[m]={"efb38192b0b2",1374542616,"Error on more illegal kernel argument types for OpenCL"}, | [m]={"efb38192b0b2",1374542616,"Error on more illegal kernel argument types for OpenCL"}, | ||
[n]={{t, | [n]={{t,9599,"static void checkIsValidOpenCLKernelParameter(Sema &S, Declarator &D, ParmVarDecl *Param, llvm::SmallPtrSetImpl<const Type *> &ValidTypes) {\n do {\n for (const auto *FD : RD->fields()) {\n S.Diag(FD->getLocation(), diag::note_illegal_field_declared_here) << QT->isPointerType() << QT;"},{"clang/lib/Sema/SemaSYCL.cpp",63,"void Sema::deepTypeCheckForSYCLDevice(SourceLocation UsedAt, llvm::DenseSet<QualType> Visited, ValueDecl *DeclToCheck) {\n auto Check = [&](QualType TypeToCheck, const ValueDecl *D) {\n // Checks for other types can also be done here.\n if (ErrorFound) {\n if (NeedToEmitNotes) {\n if (auto *FD = dyn_cast<FieldDecl>(D))\n SYCLDiagIfDeviceCode(FD->getLocation(), diag::note_illegal_field_declared_here) << FD->getType()->isPointerType() << FD->getType();"}} | ||
}, | }, | ||
["note_immediate_function_reason"]={ | ["note_immediate_function_reason"]={ | ||
Line 5,267: | Line 5,267: | ||
[c]=o, | [c]=o, | ||
[m]={db,1625925174,eb}, | [m]={db,1625925174,eb}, | ||
[n]={{q, | [n]={{q,2492,"void Sema::DiagnoseImmediateEscalatingReason(FunctionDecl *FD) {\n struct ImmediateEscalatingExpressionsVisitor : public RecursiveASTVisitor<ImmediateEscalatingExpressionsVisitor> {\n void Diag(const Expr *E, const FunctionDecl *Fn, bool IsCall) {\n SemaRef.Diag(Loc, diag::note_immediate_function_reason) << ImmediateFn << Fn << Fn->isConsteval() << IsCall << isa<CXXConstructorDecl>(Fn) << ImmediateFnIsConstructor << (CurrentInit != nullptr) << (CurrentInit && !CurrentInit->isWritten()) << (CurrentInit ? CurrentInit->getAnyMember() : nullptr) << Range;"}} | ||
}, | }, | ||
["note_implementation_declared"]={ | ["note_implementation_declared"]={ | ||
Line 5,279: | Line 5,279: | ||
[c]=o, | [c]=o, | ||
[m]={"e16cdb407a3f",1270241585,"diagnose declaring class extension after its implementation"}, | [m]={"e16cdb407a3f",1270241585,"diagnose declaring class extension after its implementation"}, | ||
[n]={{E, | [n]={{E,1853,"ObjCCategoryDecl *Sema::ActOnStartCategoryInterface(SourceLocation AtInterfaceLoc, IdentifierInfo *ClassName, SourceLocation ClassLoc, ObjCTypeParamList *typeParamList, IdentifierInfo *CategoryName, SourceLocation CategoryLoc, Decl *const *ProtoRefs, unsigned NumProtoRefs, const SourceLocation *ProtoLocs, SourceLocation EndProtoLoc, const ParsedAttributesView &AttrList) {\n if (!CategoryName && IDecl->getImplementation()) {\n Diag(IDecl->getImplementation()->getLocation(), diag::note_implementation_declared);"}} | ||
}, | }, | ||
["note_implemented_by_class"]={ | ["note_implemented_by_class"]={ | ||
Line 5,291: | Line 5,291: | ||
[c]="ARC Weak References", | [c]="ARC Weak References", | ||
[m]={"6a41337132b6",1366830785,"Objective-C arc: Improve disgnostics when \'weak\'"}, | [m]={"6a41337132b6",1366830785,"Objective-C arc: Improve disgnostics when \'weak\'"}, | ||
[n]={{N, | [n]={{N,1267,"/// ActOnPropertyImplDecl - This routine performs semantic checks and\n/// builds the AST node for a property implementation declaration; declared\n/// as \\@synthesize or \\@dynamic.\n///\nDecl *Sema::ActOnPropertyImplDecl(Scope *S, SourceLocation AtLoc, SourceLocation PropertyLoc, bool Synthesize, IdentifierInfo *PropertyId, IdentifierInfo *PropertyIvar, SourceLocation PropertyIvarLoc, ObjCPropertyQueryKind QueryKind) {\n // Check that we have a valid, previously declared ivar for @synthesize\n if (Synthesize) {\n if (kind & ObjCPropertyAttribute::kind_weak) {\n // Add GC __weak to the ivar type if the property is weak.\n if (getLangOpts().getGC() != LangOptions::NonGC) {\n } else {\n if (!getLangOpts().ObjCWeak) {\n } else {\n if (const ObjCObjectPointerType *ObjT = PropertyIvarType->getAs<ObjCObjectPointerType>()) {\n if (ObjI && ObjI->isArcWeakrefUnavailable()) {\n Diag(ClassImpDecl->getLocation(), diag::note_implemented_by_class) << ClassImpDecl->getName();"}} | ||
}, | }, | ||
["note_implicit_delete_this_in_destructor_here"]={ | ["note_implicit_delete_this_in_destructor_here"]={ | ||
Line 5,303: | Line 5,303: | ||
[c]=o, | [c]=o, | ||
[m]={"5b34958b46dc",1507859736,"Support for destroying operator delete, per C++2a proposal P0722."}, | [m]={"5b34958b46dc",1507859736,"Support for destroying operator delete, per C++2a proposal P0722."}, | ||
[n]={{q, | [n]={{q,10838,"/// CheckDestructor - Checks a fully-formed destructor definition for\n/// well-formedness, issuing any diagnostics required. Returns true\n/// on error.\nbool Sema::CheckDestructor(CXXDestructorDecl *Destructor) {\n if (!Destructor->getOperatorDelete() && Destructor->isVirtual()) {\n // If we have a virtual destructor, look up the deallocation function\n if (FunctionDecl *OperatorDelete = FindDeallocationFunctionForDestructor(Loc, RD)) {\n // If the notional \'delete this\' expression requires a non-trivial\n // conversion from \'this\' to the type of a destroying operator delete\'s\n // first parameter, perform that conversion now.\n if (OperatorDelete->isDestroyingOperatorDelete()) {\n if (!declaresSameEntity(ParamType->getAsCXXRecordDecl(), RD)) {\n if (This.isInvalid()) {\n Diag(Loc, diag::note_implicit_delete_this_in_destructor_here);"}} | ||
}, | }, | ||
["note_implicit_member_target_infer_collision"]={ | ["note_implicit_member_target_infer_collision"]={ | ||
Line 5,315: | Line 5,315: | ||
[c]=o, | [c]=o, | ||
[m]={"9a220fca4a6f",1412023109,"CUDA: Fix incorrect target inference for implicit members."}, | [m]={"9a220fca4a6f",1412023109,"CUDA: Fix incorrect target inference for implicit members."}, | ||
[n]={{"clang/lib/Sema/SemaCUDA.cpp", | [n]={{"clang/lib/Sema/SemaCUDA.cpp",389,"bool Sema::inferCUDATargetForImplicitSpecialMember(CXXRecordDecl *ClassDecl, CXXSpecialMember CSM, CXXMethodDecl *MemberDecl, bool ConstRHS, bool Diagnose) {\n for (const auto *B : Bases) {\n if (!InferredTarget) {\n } else {\n if (ResolutionError) {\n if (Diagnose) {\n Diag(ClassDecl->getLocation(), diag::note_implicit_member_target_infer_collision) << (unsigned)CSM << *InferredTarget << BaseMethodTarget;"},{"clang/lib/Sema/SemaCUDA.cpp",432,"bool Sema::inferCUDATargetForImplicitSpecialMember(CXXRecordDecl *ClassDecl, CXXSpecialMember CSM, CXXMethodDecl *MemberDecl, bool ConstRHS, bool Diagnose) {\n // Same as for bases, but now for special members of fields.\n for (const auto *F : ClassDecl->fields()) {\n if (!InferredTarget) {\n } else {\n if (ResolutionError) {\n if (Diagnose) {\n Diag(ClassDecl->getLocation(), diag::note_implicit_member_target_infer_collision) << (unsigned)CSM << *InferredTarget << FieldMethodTarget;"}} | ||
}, | }, | ||
["note_implicit_param_decl"]={ | ["note_implicit_param_decl"]={ | ||
Line 5,327: | Line 5,327: | ||
[c]=o, | [c]=o, | ||
[m]={"c6ebda167f52",1361482844,"Teach serialized diagnostics about notes without locations."}, | [m]={"c6ebda167f52",1361482844,"Teach serialized diagnostics about notes without locations."}, | ||
[n]={{r, | [n]={{r,2288,"static void emitEmptyLookupTypoDiagnostic(const TypoCorrection &TC, Sema &SemaRef, const CXXScopeSpec &SS, DeclarationName Typo, SourceLocation TypoLoc, ArrayRef<Expr *> Args, unsigned DiagnosticID, unsigned DiagnosticSuggestID) {\n unsigned NoteID = TC.getCorrectionDeclAs<ImplicitParamDecl>() ? diag::note_implicit_param_decl : diag::note_previous_decl;"},{r,2505,"/// Diagnose an empty lookup.\n///\n/// \\return false if new lookup candidates were found\nbool Sema::DiagnoseEmptyLookup(Scope *S, CXXScopeSpec &SS, LookupResult &R, CorrectionCandidateCallback &CCC, TemplateArgumentListInfo *ExplicitTemplateArgs, ArrayRef<Expr *> Args, TypoExpr **Out) {\n if (S && Out) {\n } else if (S && (Corrected = CorrectTypo(R.getLookupNameInfo(), R.getLookupKind(), S, &SS, CCC, CTK_ErrorRecovery))) {\n if (AcceptableWithRecovery || AcceptableWithoutRecovery) {\n unsigned NoteID = Corrected.getCorrectionDeclAs<ImplicitParamDecl>() ? diag::note_implicit_param_decl : diag::note_previous_decl;"}} | ||
}, | }, | ||
["note_implicit_top_level_module_import_here"]={ | ["note_implicit_top_level_module_import_here"]={ | ||
Line 5,339: | Line 5,339: | ||
[c]=R, | [c]=R, | ||
[m]={"8b7c0398b6a3",1439829570,"[modules] PR20507: Avoid silent textual inclusion."}, | [m]={"8b7c0398b6a3",1439829570,"[modules] PR20507: Avoid silent textual inclusion."}, | ||
[n]={{"clang/lib/Lex/PPDirectives.cpp", | [n]={{"clang/lib/Lex/PPDirectives.cpp",2265,"/// Handle either a #include-like directive or an import declaration that names\n/// a header file.\n///\n/// \\param HashLoc The location of the \'#\' token for an include, or\n/// SourceLocation() for an import declaration.\n/// \\param IncludeTok The include / include_next / import token.\n/// \\param FilenameTok The header-name token.\n/// \\param EndLoc The location at which any imported macros become visible.\n/// \\param LookupFrom For #include_next, the starting directory for the\n/// directory lookup.\n/// \\param LookupFromFile For #include_next, the starting file for the directory\n/// lookup.\nPreprocessor::ImportAction Preprocessor::HandleHeaderIncludeOrImport(SourceLocation HashLoc, Token &IncludeTok, Token &FilenameTok, SourceLocation EndLoc, ConstSearchDirIterator LookupFrom, const FileEntry *LookupFromFile) {\n // Determine whether we should try to import the module for this #include, if\n // there is one. Don\'t do so if precompiled module support is disabled or we\n // are processing this module textually (because we\'re building the module).\n if (MaybeTranslateInclude && (UsableHeaderUnit || UsableClangHeaderModule)) {\n // If this include corresponds to a module but that module is\n // unavailable, diagnose the situation and bail out.\n // FIXME: Remove this; loadModule does the same check (but produces\n // slightly worse diagnostics).\n if (checkModuleIsAvailable(getLangOpts(), getTargetInfo(), getDiagnostics(), SuggestedModule.getModule())) {\n Diag(FilenameTok.getLocation(), diag::note_implicit_top_level_module_import_here) << SuggestedModule.getModule()->getTopLevelModuleName();"}} | ||
}, | }, | ||
["note_implicitly_deleted"]={ | ["note_implicitly_deleted"]={ | ||
Line 5,351: | Line 5,351: | ||
[c]=o, | [c]=o, | ||
[m]={"6f1e2c6d19a7",1333400365,"Finish PR10217: Ensure we say that a special member was implicitly, not"}, | [m]={"6f1e2c6d19a7",1333400365,"Finish PR10217: Ensure we say that a special member was implicitly, not"}, | ||
[n]={{r, | [n]={{r,123,"/// Emit a note explaining that this function is deleted.\nvoid Sema::NoteDeletedFunction(FunctionDecl *Decl) {\n if (Decl->isDefaulted()) {\n // If the method was explicitly defaulted, point at that declaration.\n if (!Decl->isImplicit())\n Diag(Decl->getLocation(), diag::note_implicitly_deleted);"}} | ||
}, | }, | ||
["note_imported_by_pch_module_not_found"]={ | ["note_imported_by_pch_module_not_found"]={ | ||
Line 5,363: | Line 5,363: | ||
[c]=Wb, | [c]=Wb, | ||
[m]={"a66a325bbc51",1510889051,"[PCH+Modules] Improve diagnosticts to help out users pass an extra header search path"}, | [m]={"a66a325bbc51",1510889051,"[PCH+Modules] Improve diagnosticts to help out users pass an extra header search path"}, | ||
[n]={{Ub, | [n]={{Ub,4023,"ASTReader::ASTReadResult ASTReader::ReadModuleMapFileBlock(RecordData &Record, ModuleFile &F, const ModuleFile *ImportedBy, unsigned ClientLoadCapabilities) {\n if (PP.getPreprocessorOpts().ModulesCheckRelocated && F.Kind == MK_ImplicitModule && ModuleMgr.begin()->Kind != MK_MainFile) {\n // Don\'t emit module relocation error if we have -fno-validate-pch\n if (!bool(PP.getPreprocessorOpts().DisablePCHOrModuleValidation & DisableValidationForModuleKind::Module) && !ModMap) {\n if (!canRecoverFromOutOfDate(F.FileName, ClientLoadCapabilities)) {\n if (auto ASTFE = M ? M->getASTFile() : std::nullopt) {\n } else {\n // In case it was imported by a PCH, there\'s a chance the user is\n // just missing to include the search path to the directory containing\n // the modulemap.\n if (ImportedBy && ImportedBy->Kind == MK_PCH)\n Diag(diag::note_imported_by_pch_module_not_found) << llvm::sys::path::parent_path(F.ModuleMapPath);"}} | ||
}, | }, | ||
["note_in_binding_decl_init"]={ | ["note_in_binding_decl_init"]={ | ||
Line 5,375: | Line 5,375: | ||
[c]=o, | [c]=o, | ||
[m]={"7873de0cf65f",1470954346,"P0217R3: Perform semantic checks and initialization for the bindings in a"}, | [m]={"7873de0cf65f",1470954346,"P0217R3: Perform semantic checks and initialization for the bindings in a"}, | ||
[n]={{z, | [n]={{z,997,"/// Prints the current instantiation stack through a series of\n/// notes.\nvoid Sema::PrintInstantiationStack() {\n for (SmallVectorImpl<CodeSynthesisContext>::reverse_iterator Active = CodeSynthesisContexts.rbegin(), ActiveEnd = CodeSynthesisContexts.rend(); Active != ActiveEnd; ++Active, ++InstantiationIdx) {\n case CodeSynthesisContext::InitializingStructuredBinding:\n Diags.Report(Active->PointOfInstantiation, diag::note_in_binding_decl_init) << cast<BindingDecl>(Active->Entity);"}} | ||
}, | }, | ||
["note_in_class_initializer_float_type_cxx11"]={ | ["note_in_class_initializer_float_type_cxx11"]={ | ||
Line 5,387: | Line 5,387: | ||
[c]=o, | [c]=o, | ||
[m]={"8505c29593fb",1359498368,"Move -Wstatic-float-init fixit into a note & don\'t recover as if constexpr"}, | [m]={"8505c29593fb",1359498368,"Move -Wstatic-float-init fixit into a note & don\'t recover as if constexpr"}, | ||
[n]={{t, | [n]={{t,13518,"/// AddInitializerToDecl - Adds the initializer Init to the\n/// declaration dcl. If DirectInit is true, this is C++ direct\n/// initialization rather than copy initialization.\nvoid Sema::AddInitializerToDecl(Decl *RealDecl, Expr *Init, bool DirectInit) {\n if (VDecl->isLocalVarDecl()) {\n } else if (VDecl->isStaticDataMember() && !VDecl->isInline() && VDecl->getLexicalDeclContext()->isRecord()) {\n // Do nothing on dependent types.\n if (DclT->isDependentType()) {\n } else if (VDecl->isConstexpr()) {\n } else if (!DclT.isConstQualified()) {\n } else if (DclT->isIntegralOrEnumerationType()) {\n } else if (DclT->isFloatingType()) { // also permits complex, which is ok\n // In C++98, this is a GNU extension. In C++11, it is not, but we support\n // it anyway and provide a fixit to add the \'constexpr\'.\n if (getLangOpts().CPlusPlus11) {\n Diag(VDecl->getBeginLoc(), diag::note_in_class_initializer_float_type_cxx11) << FixItHint::CreateInsertion(VDecl->getBeginLoc(), \"constexpr \");"}} | ||
}, | }, | ||
["note_in_declaration_of_implicit_equality_comparison"]={ | ["note_in_declaration_of_implicit_equality_comparison"]={ | ||
Line 5,399: | Line 5,399: | ||
[c]=o, | [c]=o, | ||
[m]={"fe17b30a7957",1575504770,"[attributes][analyzer] Add annotations for handles."}, | [m]={"fe17b30a7957",1575504770,"[attributes][analyzer] Add annotations for handles."}, | ||
[n]={{z, | [n]={{z,963,"/// Prints the current instantiation stack through a series of\n/// notes.\nvoid Sema::PrintInstantiationStack() {\n for (SmallVectorImpl<CodeSynthesisContext>::reverse_iterator Active = CodeSynthesisContexts.rbegin(), ActiveEnd = CodeSynthesisContexts.rend(); Active != ActiveEnd; ++Active, ++InstantiationIdx) {\n case CodeSynthesisContext::DeclaringImplicitEqualityComparison:\n Diags.Report(Active->Entity->getLocation(), diag::note_in_declaration_of_implicit_equality_comparison);"}} | ||
}, | }, | ||
["note_in_declaration_of_implicit_special_member"]={ | ["note_in_declaration_of_implicit_special_member"]={ | ||
Line 5,411: | Line 5,411: | ||
[c]=o, | [c]=o, | ||
[m]={"1338122b255e",1487886223,"Add context note to diagnostics that occur while declaring an implicit special member function."}, | [m]={"1338122b255e",1487886223,"Add context note to diagnostics that occur while declaring an implicit special member function."}, | ||
[n]={{z, | [n]={{z,957,"/// Prints the current instantiation stack through a series of\n/// notes.\nvoid Sema::PrintInstantiationStack() {\n for (SmallVectorImpl<CodeSynthesisContext>::reverse_iterator Active = CodeSynthesisContexts.rbegin(), ActiveEnd = CodeSynthesisContexts.rend(); Active != ActiveEnd; ++Active, ++InstantiationIdx) {\n case CodeSynthesisContext::DeclaringSpecialMember:\n Diags.Report(Active->PointOfInstantiation, diag::note_in_declaration_of_implicit_special_member) << cast<CXXRecordDecl>(Active->Entity) << Active->SpecialMember;"}} | ||
}, | }, | ||
["note_in_for_range"]={ | ["note_in_for_range"]={ | ||
Line 5,423: | Line 5,423: | ||
[c]=o, | [c]=o, | ||
[m]={"0f38443616f5",1345510321,"Better diagnostics for range-based for loops with bad range types."}, | [m]={"0f38443616f5",1345510321,"Better diagnostics for range-based for loops with bad range types."}, | ||
[n]={{A, | [n]={{A,2593,"/// Create the initialization, compare, and increment steps for\n/// the range-based for loop expression.\n/// This function does not handle array-based for loops,\n/// which are created in Sema::BuildCXXForRangeStmt.\n///\n/// \\returns a ForRangeStatus indicating success or what kind of error occurred.\n/// BeginExpr and EndExpr are set and FRS_Success is returned on success;\n/// CandidateSet and BEF are set and some non-success value is returned on\n/// failure.\nstatic Sema::ForRangeStatus BuildNonArrayForRange(Sema &SemaRef, Expr *BeginRange, Expr *EndRange, QualType RangeType, VarDecl *BeginVar, VarDecl *EndVar, SourceLocation ColonLoc, SourceLocation CoawaitLoc, OverloadCandidateSet *CandidateSet, ExprResult *BeginExpr, ExprResult *EndExpr, BeginEndFunction *BEF) {\n auto BuildBegin = [&] {\n if (RangeStatus != Sema::FRS_Success) {\n if (RangeStatus == Sema::FRS_DiagnosticIssued)\n SemaRef.Diag(BeginRange->getBeginLoc(), diag::note_in_for_range) << ColonLoc << BEF_begin << BeginRange->getType();"},{A,2622,"/// Create the initialization, compare, and increment steps for\n/// the range-based for loop expression.\n/// This function does not handle array-based for loops,\n/// which are created in Sema::BuildCXXForRangeStmt.\n///\n/// \\returns a ForRangeStatus indicating success or what kind of error occurred.\n/// BeginExpr and EndExpr are set and FRS_Success is returned on success;\n/// CandidateSet and BEF are set and some non-success value is returned on\n/// failure.\nstatic Sema::ForRangeStatus BuildNonArrayForRange(Sema &SemaRef, Expr *BeginRange, Expr *EndRange, QualType RangeType, VarDecl *BeginVar, VarDecl *EndVar, SourceLocation ColonLoc, SourceLocation CoawaitLoc, OverloadCandidateSet *CandidateSet, ExprResult *BeginExpr, ExprResult *EndExpr, BeginEndFunction *BEF) {\n auto BuildEnd = [&] {\n if (RangeStatus != Sema::FRS_Success) {\n if (RangeStatus == Sema::FRS_DiagnosticIssued)\n SemaRef.Diag(EndRange->getBeginLoc(), diag::note_in_for_range) << ColonLoc << BEF_end << EndRange->getType();"}} | ||
}, | }, | ||
["note_in_omitted_aggregate_initializer"]={ | ["note_in_omitted_aggregate_initializer"]={ | ||
Line 5,435: | Line 5,435: | ||
[c]=o, | [c]=o, | ||
[m]={"6c3bbf42712e",1401780534,"PR11410: Extend diagnostic to cover all cases of aggregate initialization, not"}, | [m]={"6c3bbf42712e",1401780534,"PR11410: Extend diagnostic to cover all cases of aggregate initialization, not"}, | ||
[n]={{D, | [n]={{D,620,"ExprResult InitListChecker::PerformEmptyInit(SourceLocation Loc, const InitializedEntity &Entity) {\n if (!InitSeq) {\n if (!VerifyOnly) {\n if (Entity.getKind() == InitializedEntity::EK_Member)\n SemaRef.Diag(Entity.getDecl()->getLocation(), diag::note_in_omitted_aggregate_initializer) << /*field*/ 1 << Entity.getDecl();"},{D,626,"ExprResult InitListChecker::PerformEmptyInit(SourceLocation Loc, const InitializedEntity &Entity) {\n if (!InitSeq) {\n if (!VerifyOnly) {\n if (Entity.getKind() == InitializedEntity::EK_Member)\n else if (Entity.getKind() == InitializedEntity::EK_ArrayElement) {\n SemaRef.Diag(Loc, diag::note_in_omitted_aggregate_initializer) << (IsTrailingArrayNewMember ? 2 : /*array element*/ 0) << Entity.getElementIndex();"}} | ||
}, | }, | ||
["note_in_reference_temporary_list_initializer"]={ | ["note_in_reference_temporary_list_initializer"]={ | ||
Line 5,447: | Line 5,447: | ||
[c]=o, | [c]=o, | ||
[m]={"8d082d187e57",1409868819,"PR20844: If we fail to list-initialize a reference, map to the referenced type"}, | [m]={"8d082d187e57",1409868819,"PR20844: If we fail to list-initialize a reference, map to the referenced type"}, | ||
[n]={{D, | [n]={{D,9523,"static void diagnoseListInit(Sema &S, const InitializedEntity &Entity, InitListExpr *InitList) {\n if (DestType->isReferenceType()) {\n S.Diag(Loc, diag::note_in_reference_temporary_list_initializer) << T;"}} | ||
}, | }, | ||
["note_include_header_or_declare"]={ | ["note_include_header_or_declare"]={ | ||
Line 5,459: | Line 5,459: | ||
[c]=o, | [c]=o, | ||
[m]={"5d96e0a3a795",1405112031,"Consolidate header inclusion diagnostics"}, | [m]={"5d96e0a3a795",1405112031,"Consolidate header inclusion diagnostics"}, | ||
[n]={{y, | [n]={{y,11989,"// If the replacement is valid, emit a note with replacement function.\n// Additionally, suggest including the proper header if not already included.\nstatic void emitReplacement(Sema &S, SourceLocation Loc, SourceRange Range, unsigned AbsKind, QualType ArgType) {\n S.Diag(Loc, diag::note_include_header_or_declare) << HeaderName << FunctionName;"},{t,2471,"/// LazilyCreateBuiltin - The specified Builtin-ID was first used at\n/// file scope. lazily create a decl for it. ForRedeclaration is true\n/// if we\'re creating this built-in in anticipation of redeclaring the\n/// built-in.\nNamedDecl *Sema::LazilyCreateBuiltin(IdentifierInfo *II, unsigned ID, Scope *S, bool ForRedeclaration, SourceLocation Loc) {\n if (!ForRedeclaration && (Context.BuiltinInfo.isPredefinedLibFunction(ID) || Context.BuiltinInfo.isHeaderDependentFunction(ID))) {\n if (const char *Header = Context.BuiltinInfo.getHeaderName(ID))\n Diag(Loc, diag::note_include_header_or_declare) << Header << Context.BuiltinInfo.getName(ID);"}} | ||
}, | }, | ||
["note_incompatible_analyzer_plugin_api"]={ | ["note_incompatible_analyzer_plugin_api"]={ | ||
Line 5,471: | Line 5,471: | ||
[c]=a, | [c]=a, | ||
[m]={"075d73bcced3",1313556963,"[analyzer] Add a warning for an incompatible plugin version."}, | [m]={"075d73bcced3",1313556963,"[analyzer] Add a warning for an incompatible plugin version."}, | ||
[n]={{"clang/lib/StaticAnalyzer/Frontend/CheckerRegistry.cpp", | [n]={{"clang/lib/StaticAnalyzer/Frontend/CheckerRegistry.cpp",90,"#include \"clang/StaticAnalyzer/Checkers/Checkers.inc\"\n // Register checkers from plugins.\n for (const std::string &Plugin : Plugins) {\n if (!isCompatibleAPIVersion(PluginAPIVersion)) {\n Diags.Report(diag::note_incompatible_analyzer_plugin_api) << CLANG_ANALYZER_API_VERSION_STRING << PluginAPIVersion;"}} | ||
}, | }, | ||
["note_incomplete_class_and_qualified_id"]={ | ["note_incomplete_class_and_qualified_id"]={ | ||
Line 5,483: | Line 5,483: | ||
[c]=o, | [c]=o, | ||
[m]={"01d96986d843",1480719628,"More diagnostic name fixups: w_ -> warn_, warning_ -> warn_, not_ -> note_."}, | [m]={"01d96986d843",1480719628,"More diagnostic name fixups: w_ -> warn_, warning_ -> warn_, not_ -> note_."}, | ||
[n]={{r, | [n]={{r,17792,"bool Sema::DiagnoseAssignmentResult(AssignConvertType ConvTy, SourceLocation Loc, QualType DstType, QualType SrcType, Expr *SrcExpr, AssignmentAction Action, bool *Complained) {\n if ((DiagKind == diag::warn_incompatible_qualified_id || DiagKind == diag::err_incompatible_qualified_id) && PDecl && IFace && !IFace->hasDefinition())\n Diag(IFace->getLocation(), diag::note_incomplete_class_and_qualified_id) << IFace << PDecl;"}} | ||
}, | }, | ||
["note_indirect_goto_target"]={ | ["note_indirect_goto_target"]={ | ||
Line 5,495: | Line 5,495: | ||
[c]=o, | [c]=o, | ||
[m]={U,1273625893,X}, | [m]={U,1273625893,X}, | ||
[n]={{x, | [n]={{x,865,"/// Produce primary diagnostic for an indirect jump statement.\nstatic void DiagnoseIndirectOrAsmJumpStmt(Sema &S, Stmt *Jump, LabelDecl *Target, bool &Diagnosed) {\n S.Diag(Target->getStmt()->getIdentLoc(), diag::note_indirect_goto_target) << IsAsmGoto;"},{x,913,"/// Diagnose an indirect jump which is known to cross scopes.\nvoid JumpScopeChecker::DiagnoseIndirectOrAsmJump(Stmt *Jump, unsigned JumpScope, LabelDecl *Target, unsigned TargetScope) {\n // Diagnose this jump if it would be ill-formed in C++98.\n if (!Diagnosed && !ToScopesCXX98Compat.empty()) {\n S.Diag(Target->getStmt()->getIdentLoc(), diag::note_indirect_goto_target) << IsAsmGoto;"}} | ||
}, | }, | ||
["note_indirection_through_null"]={ | ["note_indirection_through_null"]={ | ||
Line 5,507: | Line 5,507: | ||
[c]=o, | [c]=o, | ||
[m]={"395610654363",1278483263,"implement PR7569, warning about assignment to null, which "}, | [m]={"395610654363",1278483263,"implement PR7569, warning about assignment to null, which "}, | ||
[n]={{r, | [n]={{r,579,"static void CheckForNullPointerDereference(Sema &S, Expr *E) {\n if (UO && UO->getOpcode() == UO_Deref && UO->getSubExpr()->getType()->isPointerType()) {\n if ((!isTargetAddressSpace(AS) || (isTargetAddressSpace(AS) && toTargetAddressSpace(AS) == 0)) && UO->getSubExpr()->IgnoreParenCasts()->isNullPointerConstant(S.Context, Expr::NPC_ValueDependentIsNotNull) && !UO->getType().isVolatileQualified()) {\n S.DiagRuntimeBehavior(UO->getOperatorLoc(), UO, S.PDiag(diag::note_indirection_through_null));"}} | ||
}, | }, | ||
["note_inequality_comparison_to_or_assign"]={ | ["note_inequality_comparison_to_or_assign"]={ | ||
Line 5,519: | Line 5,519: | ||
[c]=o, | [c]=o, | ||
[m]={"ae51ecc57b34",1313570284,"Introduce a new warning, -Wtop-level-comparison. This warning is"}, | [m]={"ae51ecc57b34",1313570284,"Introduce a new warning, -Wtop-level-comparison. This warning is"}, | ||
[n]={{A, | [n]={{A,192,"/// Diagnose unused comparisons, both builtin and overloaded operators.\n/// For \'==\' and \'!=\', suggest fixits for \'=\' or \'|=\'.\n///\n/// Adding a cast to void (or other expression wrappers) will prevent the\n/// warning from firing.\nstatic bool DiagnoseUnusedComparison(Sema &S, const Expr *E) {\n // If the LHS is a plausible entity to assign to, provide a fixit hint to\n // correct common typos.\n if (CanAssign) {\n if (Kind == Inequality)\n S.Diag(Loc, diag::note_inequality_comparison_to_or_assign) << FixItHint::CreateReplacement(Loc, \"|=\");"}} | ||
}, | }, | ||
["note_init_list_at_beginning_of_macro_argument"]={ | ["note_init_list_at_beginning_of_macro_argument"]={ | ||
Line 5,531: | Line 5,531: | ||
[c]=R, | [c]=R, | ||
[m]={"79b45389c3cd",1374602509,"Add new diagnostic messages when too many arguments are presented to a"}, | [m]={"79b45389c3cd",1374602509,"Add new diagnostic messages when too many arguments are presented to a"}, | ||
[n]={{ib, | [n]={{ib,946,"/// ReadFunctionLikeMacroArgs - After reading \"MACRO\" and knowing that the next\n/// token is the \'(\' of the macro, this method is invoked to read all of the\n/// actual arguments specified for the macro invocation. This returns null on\n/// error.\nMacroArgs *Preprocessor::ReadMacroCallArgumentList(Token &MacroName, MacroInfo *MI, SourceLocation &MacroEnd) {\n // If this is not a variadic macro, and too many args were specified, emit\n // an error.\n if (!isVariadic && NumActuals > MinArgsExpected && !ContainsCodeCompletionTok) {\n if (!GenerateNewArgTokens(*this, ArgTokens, FixedArgTokens, FixedNumArgs, ParenHints, InitLists)) {\n if (!InitLists.empty()) {\n DiagnosticBuilder DB = Diag(MacroName, diag::note_init_list_at_beginning_of_macro_argument);"}} | ||
}, | }, | ||
["note_init_list_narrowing_silence"]={ | ["note_init_list_narrowing_silence"]={ | ||
Line 5,543: | Line 5,543: | ||
[c]=o, | [c]=o, | ||
[m]={"b0869036c114",1400289198,"Tweak diagnostic wording for init list narrowing"}, | [m]={"b0869036c114",1400289198,"Tweak diagnostic wording for init list narrowing"}, | ||
[n]={{D, | [n]={{D,10463,"static void DiagnoseNarrowingInInitList(Sema &S, const ImplicitConversionSequence &ICS, QualType PreNarrowingType, QualType EntityType, const Expr *PostInit) {\n S.Diag(PostInit->getBeginLoc(), diag::note_init_list_narrowing_silence) << PostInit->getSourceRange() << FixItHint::CreateInsertion(PostInit->getBeginLoc(), OS.str()) << FixItHint::CreateInsertion(S.getLocForEndOfToken(PostInit->getEndLoc()), \")\");"}} | ||
}, | }, | ||
["note_init_with_default_member_initializer"]={ | ["note_init_with_default_member_initializer"]={ | ||
Line 5,555: | Line 5,555: | ||
[c]=o, | [c]=o, | ||
[m]={"47ccfd7a89e2",1667306232,"[Clang] Implement P2741R3 - user-generated static_assert messages"}, | [m]={"47ccfd7a89e2",1667306232,"[Clang] Implement P2741R3 - user-generated static_assert messages"}, | ||
[n]={{D, | [n]={{D,8295,"void Sema::checkInitializerLifetime(const InitializedEntity &Entity, Expr *Init) {\n auto TemporaryVisitor = [&](IndirectLocalPath &Path, Local L, ReferenceKind RK) -> bool {\n for (unsigned I = 0; I != Path.size(); ++I) {\n case IndirectLocalPathEntry::DefaultInit: {\n Diag(FD->getLocation(), diag::note_init_with_default_member_initializer) << FD << nextPathEntryRange(Path, I + 1, L);"}} | ||
}, | }, | ||
["note_initializer_out_of_order"]={ | ["note_initializer_out_of_order"]={ | ||
Line 5,567: | Line 5,567: | ||
[c]=o, | [c]=o, | ||
[m]={T,1590001902,S}, | [m]={T,1590001902,S}, | ||
[n]={{q, | [n]={{q,5616,"static void DiagnoseBaseOrMemInitializerOrder(Sema &SemaRef, const CXXConstructorDecl *Constructor, ArrayRef<CXXCtorInitializer *> Inits) {\n // More than 1 item to warn, create notes letting the user know which ones\n // are bad.\n for (unsigned WarnIndex : WarnIndexes) {\n auto D = SemaRef.Diag(PrevInit->getSourceLocation(), diag::note_initializer_out_of_order);"}} | ||
}, | }, | ||
["note_insert_break_fixit"]={ | ["note_insert_break_fixit"]={ | ||
Line 5,579: | Line 5,579: | ||
[c]=o, | [c]=o, | ||
[m]={"84837d5b5aa0",1336069659,"Add -Wimplicit-fallthrough warning flag, which warns on fallthrough between"}, | [m]={"84837d5b5aa0",1336069659,"Add -Wimplicit-fallthrough warning flag, which warns on fallthrough between"}, | ||
[n]={{Z, | [n]={{Z,1328,"static void DiagnoseSwitchLabelsFallthrough(Sema &S, AnalysisDeclContext &AC, bool PerFunction) {\n for (const CFGBlock *B : llvm::reverse(*Cfg)) {\n if (!AnnotatedCnt) {\n S.Diag(L, diag::note_insert_break_fixit) << FixItHint::CreateInsertion(L, \"break; \");"}} | ||
}, | }, | ||
["note_insert_fallthrough_fixit"]={ | ["note_insert_fallthrough_fixit"]={ | ||
Line 5,591: | Line 5,591: | ||
[c]=o, | [c]=o, | ||
[m]={"84837d5b5aa0",1336069659,"Add -Wimplicit-fallthrough warning flag, which warns on fallthrough between"}, | [m]={"84837d5b5aa0",1336069659,"Add -Wimplicit-fallthrough warning flag, which warns on fallthrough between"}, | ||
[n]={{Z, | [n]={{Z,1324,"static void DiagnoseSwitchLabelsFallthrough(Sema &S, AnalysisDeclContext &AC, bool PerFunction) {\n for (const CFGBlock *B : llvm::reverse(*Cfg)) {\n if (!AnnotatedCnt) {\n if (!(B->empty() && Term && isa<BreakStmt>(Term))) {\n S.Diag(L, diag::note_insert_fallthrough_fixit) << AnnotationSpelling << FixItHint::CreateInsertion(L, TextToInsert);"}} | ||
}, | }, | ||
["note_inst_declaration_hint"]={ | ["note_inst_declaration_hint"]={ | ||
Line 5,603: | Line 5,603: | ||
[c]=o, | [c]=o, | ||
[m]={"7dcc97e7ac0a",1461046792,"Warn if function or variable cannot be implicitly instantiated"}, | [m]={"7dcc97e7ac0a",1461046792,"Warn if function or variable cannot be implicitly instantiated"}, | ||
[n]={{dc, | [n]={{dc,4905,"/// Instantiate the definition of the given function from its\n/// template.\n///\n/// \\param PointOfInstantiation the point at which the instantiation was\n/// required. Note that this is not precisely a \"point of instantiation\"\n/// for the function, but it\'s close.\n///\n/// \\param Function the already-instantiated declaration of a\n/// function template specialization or member function of a class template\n/// specialization.\n///\n/// \\param Recursive if true, recursively instantiates any functions that\n/// are required by this instantiation.\n///\n/// \\param DefinitionRequired if true, then we are performing an explicit\n/// instantiation where the body of the function is required. Complain if\n/// there is no such body.\nvoid Sema::InstantiateFunctionDefinition(SourceLocation PointOfInstantiation, FunctionDecl *Function, bool Recursive, bool DefinitionRequired, bool AtEndOfTU) {\n // FIXME: We need to track the instantiation stack in order to know which\n // definitions should be visible within this instantiation.\n if (DiagnoseUninstantiableTemplate(PointOfInstantiation, Function, Function->getInstantiatedFromMemberFunction(), PatternDecl, PatternDef, TSK,\n if (DefinitionRequired)\n else if (TSK == TSK_ExplicitInstantiationDefinition || (Function->isConstexpr() && !Recursive)) {\n } else if (TSK == TSK_ImplicitInstantiation) {\n if (AtEndOfTU && !getDiagnostics().hasErrorOccurred() && !getSourceManager().isInSystemHeader(PatternDecl->getBeginLoc())) {\n if (getLangOpts().CPlusPlus11)\n Diag(PointOfInstantiation, diag::note_inst_declaration_hint) << Function;"},{dc,5531,"/// Instantiate the definition of the given variable from its\n/// template.\n///\n/// \\param PointOfInstantiation the point at which the instantiation was\n/// required. Note that this is not precisely a \"point of instantiation\"\n/// for the variable, but it\'s close.\n///\n/// \\param Var the already-instantiated declaration of a templated variable.\n///\n/// \\param Recursive if true, recursively instantiates any functions that\n/// are required by this instantiation.\n///\n/// \\param DefinitionRequired if true, then we are performing an explicit\n/// instantiation where a definition of the variable is required. Complain\n/// if there is no such definition.\nvoid Sema::InstantiateVariableDefinition(SourceLocation PointOfInstantiation, VarDecl *Var, bool Recursive, bool DefinitionRequired, bool AtEndOfTU) {\n // If we don\'t have a definition of the variable template, we won\'t perform\n // any instantiation. Rather, we rely on the user to instantiate this\n // definition (or provide a specialization for it) in another translation\n // unit.\n if (!Def && !DefinitionRequired) {\n if (TSK == TSK_ExplicitInstantiationDefinition) {\n } else if (TSK == TSK_ImplicitInstantiation) {\n // Warn about missing definition at the end of translation unit.\n if (AtEndOfTU && !getDiagnostics().hasErrorOccurred() && !getSourceManager().isInSystemHeader(PatternDecl->getBeginLoc())) {\n if (getLangOpts().CPlusPlus11)\n Diag(PointOfInstantiation, diag::note_inst_declaration_hint) << Var;"}} | ||
}, | }, | ||
["note_instantiation_contexts_suppressed"]={ | ["note_instantiation_contexts_suppressed"]={ | ||
Line 5,615: | Line 5,615: | ||
[c]=o, | [c]=o, | ||
[m]={"ffed1cb33910",1271747904,"Introduce a limit on the depth of the template instantiation backtrace"}, | [m]={"ffed1cb33910",1271747904,"Introduce a limit on the depth of the template instantiation backtrace"}, | ||
[n]={{z, | [n]={{z,754,"/// Prints the current instantiation stack through a series of\n/// notes.\nvoid Sema::PrintInstantiationStack() {\n for (SmallVectorImpl<CodeSynthesisContext>::reverse_iterator Active = CodeSynthesisContexts.rbegin(), ActiveEnd = CodeSynthesisContexts.rend(); Active != ActiveEnd; ++Active, ++InstantiationIdx) {\n // Skip this instantiation?\n if (InstantiationIdx >= SkipStart && InstantiationIdx < SkipEnd) {\n if (InstantiationIdx == SkipStart) {\n Diags.Report(Active->PointOfInstantiation, diag::note_instantiation_contexts_suppressed) << unsigned(CodeSynthesisContexts.size() - Limit);"}} | ||
}, | }, | ||
["note_instantiation_required_here"]={ | ["note_instantiation_required_here"]={ | ||
Line 5,627: | Line 5,627: | ||
[c]=o, | [c]=o, | ||
[m]={"06db9f50a2d6",1255378708,"Diagnose the declaration of explicit specializations after an implicit"}, | [m]={"06db9f50a2d6",1255378708,"Diagnose the declaration of explicit specializations after an implicit"}, | ||
[n]={{u, | [n]={{u,4678,"DeclResult Sema::ActOnVarTemplateSpecialization(Scope *S, Declarator &D, TypeSourceInfo *DI, SourceLocation TemplateKWLoc, TemplateParameterList *TemplateParams, StorageClass SC, bool IsPartialSpecialization) {\n // C++ [temp.expl.spec]p6:\n // If a template, a member template or the member of a class template is\n // explicitly specialized then that specialization shall be declared\n // before the first use of that specialization that would cause an implicit\n // instantiation to take place, in every translation unit in which such a\n // use occurs; no diagnostic is required.\n if (PrevDecl && PrevDecl->getPointOfInstantiation().isValid()) {\n if (!Okay) {\n Diag(PrevDecl->getPointOfInstantiation(), diag::note_instantiation_required_here) << (PrevDecl->getTemplateSpecializationKind() != TSK_ImplicitInstantiation);"},{u,8883,"DeclResult Sema::ActOnClassTemplateSpecialization(Scope *S, unsigned TagSpec, TagUseKind TUK, SourceLocation KWLoc, SourceLocation ModulePrivateLoc, CXXScopeSpec &SS, TemplateIdAnnotation &TemplateId, const ParsedAttributesView &Attr, MultiTemplateParamsArg TemplateParameterLists, SkipBodyInfo *SkipBody) {\n // C++ [temp.expl.spec]p6:\n // If a template, a member template or the member of a class template is\n // explicitly specialized then that specialization shall be declared\n // before the first use of that specialization that would cause an implicit\n // instantiation to take place, in every translation unit in which such a\n // use occurs; no diagnostic is required.\n if (PrevDecl && PrevDecl->getPointOfInstantiation().isValid()) {\n if (!Okay) {\n Diag(PrevDecl->getPointOfInstantiation(), diag::note_instantiation_required_here) << (PrevDecl->getTemplateSpecializationKind() != TSK_ImplicitInstantiation);"},{u,9202,"/// Diagnose cases where we have an explicit template specialization\n/// before/after an explicit template instantiation, producing diagnostics\n/// for those cases where they are required and determining whether the\n/// new specialization/instantiation will have any effect.\n///\n/// \\param NewLoc the location of the new explicit specialization or\n/// instantiation.\n///\n/// \\param NewTSK the kind of the new explicit specialization or instantiation.\n///\n/// \\param PrevDecl the previous declaration of the entity.\n///\n/// \\param PrevTSK the kind of the old explicit specialization or instantiatin.\n///\n/// \\param PrevPointOfInstantiation if valid, indicates where the previous\n/// declaration was instantiated (either implicitly or explicitly).\n///\n/// \\param HasNoEffect will be set to true to indicate that the new\n/// specialization or instantiation has no effect and should be ignored.\n///\n/// \\returns true if there was an error that should prevent the introduction of\n/// the new declaration into the AST, false otherwise.\nbool Sema::CheckSpecializationInstantiationRedecl(SourceLocation NewLoc, TemplateSpecializationKind NewTSK, NamedDecl *PrevDecl, TemplateSpecializationKind PrevTSK, SourceLocation PrevPointOfInstantiation, bool &HasNoEffect) {\n case TSK_ExplicitSpecialization:\n case TSK_ExplicitInstantiationDefinition:\n Diag(PrevPointOfInstantiation, diag::note_instantiation_required_here) << (PrevTSK != TSK_ImplicitInstantiation);"}} | ||
}, | }, | ||
["note_invalid_consteval_initializer"]={ | ["note_invalid_consteval_initializer"]={ | ||
Line 5,639: | Line 5,639: | ||
[c]=o, | [c]=o, | ||
[m]={db,1625925174,eb}, | [m]={db,1625925174,eb}, | ||
[n]={{r, | [n]={{r,18268,"static void EvaluateAndDiagnoseImmediateInvocation(Sema &SemaRef, Sema::ImmediateInvocationCandidate Candidate) {\n if (!Result || !Notes.empty()) {\n if (auto Context = SemaRef.InnermostDeclarationWithDelayedImmediateInvocations()) {\n SemaRef.Diag(Context->Loc, diag::note_invalid_consteval_initializer) << Context->Decl;"},{r,18451,"static void HandleImmediateInvocations(Sema &SemaRef, Sema::ExpressionEvaluationContextRecord &Rec) {\n for (auto *DR : Rec.ReferenceToConsteval) {\n if (!Rec.InImmediateEscalatingFunctionContext || (SemaRef.inTemplateInstantiation() && !ImmediateEscalating)) {\n if (auto Context = SemaRef.InnermostDeclarationWithDelayedImmediateInvocations()) {\n SemaRef.Diag(Context->Loc, diag::note_invalid_consteval_initializer) << Context->Decl;"}} | ||
}, | }, | ||
["note_invalid_consteval_initializer_here"]={ | ["note_invalid_consteval_initializer_here"]={ | ||
Line 5,662: | Line 5,662: | ||
[c]=a, | [c]=a, | ||
[m]={"f57d8cb13121",1323471481,"C++11 constant expressions: Don\'t use CheckICE in C++11; instead, determine"}, | [m]={"f57d8cb13121",1323471481,"C++11 constant expressions: Don\'t use CheckICE in C++11; instead, determine"}, | ||
[n]={{p, | [n]={{p,2372,"/// Check that this core constant expression is of literal type, and if not,\n/// produce an appropriate diagnostic.\nstatic bool CheckLiteralType(EvalInfo &Info, const Expr *E, const LValue *This = nullptr) {\n // Prvalue constant expressions must be of literal types.\n if (Info.getLangOpts().CPlusPlus11)\n else\n Info.FFDiag(E, diag::note_invalid_subexpr_in_const_expr);"},{p,2739,"static bool EvalAndBitcastToAPInt(EvalInfo &Info, const Expr *E, llvm::APInt &Res) {\n if (SVal.isVector()) {\n for (unsigned i = 0; i < SVal.getVectorLength(); i++) {\n if (Elt.isInt()) {\n } else if (Elt.isFloat()) {\n } else {\n Info.FFDiag(E, diag::note_invalid_subexpr_in_const_expr);"},{p,2752,"static bool EvalAndBitcastToAPInt(EvalInfo &Info, const Expr *E, llvm::APInt &Res) {\n Info.FFDiag(E, diag::note_invalid_subexpr_in_const_expr);"},{p,3723,"/// Find the designated sub-object of an rvalue.\ntemplate <typename SubobjectHandler> typename SubobjectHandler::result_type findSubobject(EvalInfo &Info, const Expr *E, const CompleteObject &Obj, const SubobjectDesignator &Sub, SubobjectHandler &handler) {\n // Walk the designator\'s path to find the subobject.\n for (unsigned I = 0, N = Sub.Entries.size(); /**/; ++I) {\n // If this is our last pass, check that the final object type is OK.\n if (I == N || (I == N - 1 && ObjType->isAnyComplexType())) {\n // Accesses to volatile objects are prohibited.\n if (ObjType.isVolatileQualified() && isFormalAccess(handler.AccessKind)) {\n if (Info.getLangOpts().CPlusPlus) {\n } else {\n Info.FFDiag(E, diag::note_invalid_subexpr_in_const_expr);"},{p,5561,"/// CheckTrivialDefaultConstructor - Check whether a constructor is a trivial\n/// default constructor. If so, we\'ll fold it whether or not it\'s marked as\n/// constexpr. If it is marked as constexpr, we will never implicitly define it,\n/// so we need special handling.\nstatic bool CheckTrivialDefaultConstructor(EvalInfo &Info, SourceLocation Loc, const CXXConstructorDecl *CD, bool IsValueInitialization) {\n // Value-initialization does not call a trivial default constructor, so such a\n // call is a core constant expression whether or not the constructor is\n // constexpr.\n if (!CD->isConstexpr() && !IsValueInitialization) {\n if (Info.getLangOpts().CPlusPlus11) {\n } else {\n Info.CCEDiag(Loc, diag::note_invalid_subexpr_in_const_expr);"},{p,5583,"/// CheckConstexprFunction - Check that a function can be called in a constant\n/// expression.\nstatic bool CheckConstexprFunction(EvalInfo &Info, SourceLocation CallLoc, const FunctionDecl *Declaration, const FunctionDecl *Definition, const Stmt *Body) {\n // Bail out if the function declaration itself is invalid. We will\n // have produced a relevant diagnostic while parsing it, so just\n // note the problematic sub-expression.\n if (Declaration->isInvalidDecl()) {\n Info.FFDiag(CallLoc, diag::note_invalid_subexpr_in_const_expr);"},{p,5595,"/// CheckConstexprFunction - Check that a function can be called in a constant\n/// expression.\nstatic bool CheckConstexprFunction(EvalInfo &Info, SourceLocation CallLoc, const FunctionDecl *Declaration, const FunctionDecl *Definition, const Stmt *Body) {\n if (Definition && Definition->isInvalidDecl()) {\n Info.FFDiag(CallLoc, diag::note_invalid_subexpr_in_const_expr);"},{p,5626,"/// CheckConstexprFunction - Check that a function can be called in a constant\n/// expression.\nstatic bool CheckConstexprFunction(EvalInfo &Info, SourceLocation CallLoc, const FunctionDecl *Declaration, const FunctionDecl *Definition, const Stmt *Body) {\n if (Info.getLangOpts().CPlusPlus11) {\n } else {\n Info.FFDiag(CallLoc, diag::note_invalid_subexpr_in_const_expr);"},{p,7481,"template <class Derived> class ExprEvaluatorBase : public ConstStmtVisitor<Derived, bool> {\n bool Error(const Expr *E) { return Error(E, diag::note_invalid_subexpr_in_const_expr); }"},{p,9304,"bool PointerExprEvaluator::VisitBuiltinCallExpr(const CallExpr *E, unsigned BuiltinOp) {\n case Builtin::BIwmemchr:\n if (Info.getLangOpts().CPlusPlus11)\n else\n Info.CCEDiag(E, diag::note_invalid_subexpr_in_const_expr);"},{p,9412,"bool PointerExprEvaluator::VisitBuiltinCallExpr(const CallExpr *E, unsigned BuiltinOp) {\n case Builtin::BIwmemmove:\n if (Info.getLangOpts().CPlusPlus11)\n else\n Info.CCEDiag(E, diag::note_invalid_subexpr_in_const_expr);"},{p,11242,"static bool EvaluateInteger(const Expr *E, APSInt &Result, EvalInfo &Info) {\n if (!Val.isInt()) {\n Info.FFDiag(E, diag::note_invalid_subexpr_in_const_expr);"},{p,12116,"bool IntExprEvaluator::VisitBuiltinCallExpr(const CallExpr *E, unsigned BuiltinOp) {\n case Builtin::BI__builtin_constant_p: {\n Info.FFDiag(E, diag::note_invalid_subexpr_in_const_expr);"},{p,12289,"bool IntExprEvaluator::VisitBuiltinCallExpr(const CallExpr *E, unsigned BuiltinOp) {\n case Builtin::BIwcslen:\n // A call to strlen is not a constant expression.\n if (Info.getLangOpts().CPlusPlus11)\n else\n Info.CCEDiag(E, diag::note_invalid_subexpr_in_const_expr);"},{p,12314,"bool IntExprEvaluator::VisitBuiltinCallExpr(const CallExpr *E, unsigned BuiltinOp) {\n case Builtin::BIwmemcmp:\n // A call to strlen is not a constant expression.\n if (Info.getLangOpts().CPlusPlus11)\n else\n Info.CCEDiag(E, diag::note_invalid_subexpr_in_const_expr);"},{p,12937,"template <class SuccessCB, class AfterCB> static bool EvaluateComparisonBinaryOperator(EvalInfo &Info, const BinaryOperator *E, SuccessCB &&Success, AfterCB &&DoAfter) {\n auto Error = [&](const Expr *E) {\n Info.FFDiag(E, diag::note_invalid_subexpr_in_const_expr);"},{p,15148,"static bool Evaluate(APValue &Result, EvalInfo &Info, const Expr *E) {\n if (E->isGLValue() || T->isFunctionType()) {\n } else if (T->isVectorType()) {\n } else if (T->isIntegralOrEnumerationType()) {\n } else if (T->hasPointerRepresentation()) {\n } else if (T->isRealFloatingType()) {\n } else if (T->isAnyComplexType()) {\n } else if (T->isFixedPointType()) {\n } else if (T->isMemberPointerType()) {\n } else if (T->isArrayType()) {\n } else if (T->isRecordType()) {\n } else if (T->isVoidType()) {\n } else if (T->isAtomicType()) {\n } else if (Info.getLangOpts().CPlusPlus11) {\n } else {\n Info.FFDiag(E, diag::note_invalid_subexpr_in_const_expr);"},{w,337,"bool CheckCallable(InterpState &S, CodePtr OpPC, const Function *F) {\n if (!F->isConstexpr()) {\n if (S.getLangOpts().CPlusPlus11) {\n } else {\n S.FFDiag(Loc, diag::note_invalid_subexpr_in_const_expr);"},{t,14202,"void Sema::CheckCompleteVariableDeclaration(VarDecl *var) {\n // Check whether the initializer is sufficiently constant.\n if (getLangOpts().CPlusPlus && !type->isDependentType() && Init && !Init->isValueDependent() && (GlobalStorage || var->isConstexpr() || var->mightBeUsableInConstantExpressions(Context))) {\n if (!getLangOpts().CPlusPlus11) {\n // Compute and cache the constant value, and remember that we have a\n // constant initializer.\n if (HasConstInit) {\n } else if (CacheCulprit) {\n Notes.emplace_back(CacheCulprit->getExprLoc(), PDiag(diag::note_invalid_subexpr_in_const_expr));"},{t,14217,"void Sema::CheckCompleteVariableDeclaration(VarDecl *var) {\n // Check whether the initializer is sufficiently constant.\n if (getLangOpts().CPlusPlus && !type->isDependentType() && Init && !Init->isValueDependent() && (GlobalStorage || var->isConstexpr() || var->mightBeUsableInConstantExpressions(Context))) {\n if (HasConstInit) {\n } else if (var->isConstexpr()) {\n if (Notes.size() == 1 && Notes[0].second.getDiagID() == diag::note_invalid_subexpr_in_const_expr) {"},{r,17998,"ExprResult Sema::VerifyIntegerConstantExpression(Expr *E, llvm::APSInt *Result, VerifyICEDiagnoser &Diagnoser, AllowFoldKind CanFold) {\n if (Notes.size() == 1 && Notes[0].second.getDiagID() == diag::note_invalid_subexpr_in_const_expr) {"},{P,5986,"/// EvaluateConvertedConstantExpression - Evaluate an Expression\n/// That is a converted constant expression\n/// (which was built with BuildConvertedConstantExpression)\nstatic ExprResult EvaluateConvertedConstantExpression(Sema &S, Expr *E, QualType T, APValue &Value, Sema::CCEKind CCE, bool RequireInt, const APValue &PreNarrowingValue) {\n if (Notes.size() == 1 && Notes[0].second.getDiagID() == diag::note_invalid_subexpr_in_const_expr) {"},{u,6573,"/// Determine whether the given template argument is a null pointer\n/// value of the appropriate type.\nstatic NullPointerValueKind isNullPointerValueTemplateArgument(Sema &S, NonTypeTemplateParmDecl *Param, QualType ParamType, Expr *Arg, Decl *Entity = nullptr) {\n if (!Arg->EvaluateAsRValue(EvalResult, S.Context) || EvalResult.HasSideEffects) {\n if (Notes.size() == 1 && Notes[0].second.getDiagID() == diag::note_invalid_subexpr_in_const_expr) {"}} | ||
}, | }, | ||
["note_invalid_ucn_name_candidate"]={ | ["note_invalid_ucn_name_candidate"]={ | ||
Line 5,674: | Line 5,674: | ||
[c]=R, | [c]=R, | ||
[m]={db,1625925174,eb}, | [m]={db,1625925174,eb}, | ||
[n]={{"clang/lib/Lex/LiteralSupport.cpp", | [n]={{"clang/lib/Lex/LiteralSupport.cpp",574,"static void DiagnoseInvalidUnicodeCharacterName(DiagnosticsEngine *Diags, const LangOptions &Features, FullSourceLoc Loc, const char *TokBegin, const char *TokRangeBegin, const char *TokRangeEnd, llvm::StringRef Name) {\n for (const auto &Match : Matches) {\n Diag(Diags, Features, Loc, TokBegin, TokRangeBegin, TokRangeEnd,\n diag::note_invalid_ucn_name_candidate)"}} | ||
}, | }, | ||
["note_invalid_ucn_name_loose_matching"]={ | ["note_invalid_ucn_name_loose_matching"]={ | ||
Line 5,686: | Line 5,686: | ||
[c]=R, | [c]=R, | ||
[m]={db,1625925174,eb}, | [m]={db,1625925174,eb}, | ||
[n]={{"clang/lib/Lex/Lexer.cpp", | [n]={{"clang/lib/Lex/Lexer.cpp",3428,"std::optional<uint32_t> Lexer::tryReadNamedUCN(const char *&StartPtr, const char *SlashLoc, Token *Result) {\n if (!Match) {\n if (Diagnose) {\n if (LooseMatch) {\n Diag(StartName, diag::note_invalid_ucn_name_loose_matching) << FixItHint::CreateReplacement(makeCharRange(*this, StartName, CurPtr - CharSize), LooseMatch->Name);"},{"clang/lib/Lex/LiteralSupport.cpp",544,"static void DiagnoseInvalidUnicodeCharacterName(DiagnosticsEngine *Diags, const LangOptions &Features, FullSourceLoc Loc, const char *TokBegin, const char *TokRangeBegin, const char *TokRangeEnd, llvm::StringRef Name) {\n if (Res) {\n Diag(Diags, Features, Loc, TokBegin, TokRangeBegin, TokRangeEnd, diag::note_invalid_ucn_name_loose_matching) << FixItHint::CreateReplacement(MakeCharSourceRange(Features, Loc, TokBegin, TokRangeBegin, TokRangeEnd), Res->Name);"}} | ||
}, | }, | ||
["note_it_delegates_to"]={ | ["note_it_delegates_to"]={ | ||
Line 5,698: | Line 5,698: | ||
[c]=o, | [c]=o, | ||
[m]={"6118d6642b8f",1304488644,"Implement a better version of delegating constructor cycle detection."}, | [m]={"6118d6642b8f",1304488644,"Implement a better version of delegating constructor cycle detection."}, | ||
[n]={{q, | [n]={{q,18544,"static void DelegatingCycleHelper(CXXConstructorDecl *Ctor, llvm::SmallPtrSet<CXXConstructorDecl *, 4> &Valid, llvm::SmallPtrSet<CXXConstructorDecl *, 4> &Invalid, llvm::SmallPtrSet<CXXConstructorDecl *, 4> &Current, Sema &S) {\n // We know that beyond here, we aren\'t chaining into a cycle.\n if (!Target || !Target->isDelegatingConstructor() || Target->isInvalidDecl() || Valid.count(TCanonical)) {\n } else if (TCanonical == Canonical || Invalid.count(TCanonical) || Current.count(TCanonical)) {\n // If we haven\'t diagnosed this cycle yet, do so now.\n if (!Invalid.count(TCanonical)) {\n // Don\'t add a note for a function delegating directly to itself.\n if (TCanonical != Canonical)\n S.Diag(Target->getLocation(), diag::note_it_delegates_to);"}} | ||
}, | }, | ||
["note_ivar_decl"]={ | ["note_ivar_decl"]={ | ||
Line 5,710: | Line 5,710: | ||
[c]=o, | [c]=o, | ||
[m]={"5921b83f5413",1269370942,"Improve diagnostic for @property/ivar type mismatch by including the types of the"}, | [m]={"5921b83f5413",1269370942,"Improve diagnostic for @property/ivar type mismatch by including the types of the"}, | ||
[n]={{r, | [n]={{r,636,"static void DiagnoseDirectIsaAccess(Sema &S, const ObjCIvarRefExpr *OIRE, SourceLocation AssignLoc, const Expr *RHS) {\n if (const ObjCObjectType *OTy = BaseType->getAs<ObjCObjectType>())\n if (ObjCInterfaceDecl *IDecl = OTy->getInterface()) {\n if (!ClassDeclared->getSuperClass() && (*ClassDeclared->ivar_begin()) == IV) {\n S.Diag(IV->getLocation(), diag::note_ivar_decl);"},{N,1290,"/// ActOnPropertyImplDecl - This routine performs semantic checks and\n/// builds the AST node for a property implementation declaration; declared\n/// as \\@synthesize or \\@dynamic.\n///\nDecl *Sema::ActOnPropertyImplDecl(Scope *S, SourceLocation AtLoc, SourceLocation PropertyLoc, bool Synthesize, IdentifierInfo *PropertyId, IdentifierInfo *PropertyIvar, SourceLocation PropertyIvarLoc, ObjCPropertyQueryKind QueryKind) {\n // Check that we have a valid, previously declared ivar for @synthesize\n if (Synthesize) {\n if (AtLoc.isInvalid()) {\n if (originalIvar) {\n Diag(originalIvar->getLocation(), diag::note_ivar_decl);"},{N,1379,"/// ActOnPropertyImplDecl - This routine performs semantic checks and\n/// builds the AST node for a property implementation declaration; declared\n/// as \\@synthesize or \\@dynamic.\n///\nDecl *Sema::ActOnPropertyImplDecl(Scope *S, SourceLocation AtLoc, SourceLocation PropertyLoc, bool Synthesize, IdentifierInfo *PropertyId, IdentifierInfo *PropertyIvar, SourceLocation PropertyIvarLoc, ObjCPropertyQueryKind QueryKind) {\n // Check that we have a valid, previously declared ivar for @synthesize\n if (Synthesize) {\n // Check that type of property and its ivar are type compatible.\n if (!Context.hasSameType(PropertyIvarType, IvarType)) {\n if (!compat) {\n Diag(Ivar->getLocation(), diag::note_ivar_decl);"},{N,1394,"/// ActOnPropertyImplDecl - This routine performs semantic checks and\n/// builds the AST node for a property implementation declaration; declared\n/// as \\@synthesize or \\@dynamic.\n///\nDecl *Sema::ActOnPropertyImplDecl(Scope *S, SourceLocation AtLoc, SourceLocation PropertyLoc, bool Synthesize, IdentifierInfo *PropertyId, IdentifierInfo *PropertyIvar, SourceLocation PropertyIvarLoc, ObjCPropertyQueryKind QueryKind) {\n // Check that we have a valid, previously declared ivar for @synthesize\n if (Synthesize) {\n // Check that type of property and its ivar are type compatible.\n if (!Context.hasSameType(PropertyIvarType, IvarType)) {\n if (!compat) {\n } else {\n if (lhsType != rhsType && lhsType->isArithmeticType()) {\n Diag(Ivar->getLocation(), diag::note_ivar_decl);"},{N,1403,"/// ActOnPropertyImplDecl - This routine performs semantic checks and\n/// builds the AST node for a property implementation declaration; declared\n/// as \\@synthesize or \\@dynamic.\n///\nDecl *Sema::ActOnPropertyImplDecl(Scope *S, SourceLocation AtLoc, SourceLocation PropertyLoc, bool Synthesize, IdentifierInfo *PropertyId, IdentifierInfo *PropertyIvar, SourceLocation PropertyIvarLoc, ObjCPropertyQueryKind QueryKind) {\n // Check that we have a valid, previously declared ivar for @synthesize\n if (Synthesize) {\n // Check that type of property and its ivar are type compatible.\n if (!Context.hasSameType(PropertyIvarType, IvarType)) {\n // __weak is explicit. So it works on Canonical type.\n if ((PropType.isObjCGCWeak() && !IvarType.isObjCGCWeak() && getLangOpts().getGC() != LangOptions::NonGC)) {\n Diag(Ivar->getLocation(), diag::note_ivar_decl);"}} | ||
}, | }, | ||
["note_lambda_capture_initializer"]={ | ["note_lambda_capture_initializer"]={ | ||
Line 5,722: | Line 5,722: | ||
[c]=o, | [c]=o, | ||
[m]={T,1590001902,S}, | [m]={T,1590001902,S}, | ||
[n]={{D, | [n]={{D,8315,"void Sema::checkInitializerLifetime(const InitializedEntity &Entity, Expr *Init) {\n auto TemporaryVisitor = [&](IndirectLocalPath &Path, Local L, ReferenceKind RK) -> bool {\n for (unsigned I = 0; I != Path.size(); ++I) {\n case IndirectLocalPathEntry::LambdaCaptureInit:\n Diag(Elem.Capture->getLocation(), diag::note_lambda_capture_initializer) << VD << VD->isInitCapture() << Elem.Capture->isExplicit() << (Elem.Capture->getCaptureKind() == LCK_ByRef) << VD << nextPathEntryRange(Path, I + 1, L);"}} | ||
}, | }, | ||
["note_lambda_decl"]={ | ["note_lambda_decl"]={ | ||
Line 5,734: | Line 5,734: | ||
[c]=ac, | [c]=ac, | ||
[m]={"24af85047046",1328309257,"Implement implicit capture for lambda expressions."}, | [m]={"24af85047046",1328309257,"Implement implicit capture for lambda expressions."}, | ||
[n]={{q, | [n]={{q,1446,"static bool checkMemberDecomposition(Sema &S, ArrayRef<BindingDecl *> Bindings, ValueDecl *Src, QualType DecompType, const CXXRecordDecl *OrigRD) {\n for (auto *FD : RD->fields()) {\n // All the non-static data members are required to be nameable, so they\n // must all have names.\n if (!FD->getDeclName()) {\n if (RD->isLambda()) {\n S.Diag(RD->getLocation(), diag::note_lambda_decl);"},{q,9599,"/// Determine whether a defaulted special member function should be defined as\n/// deleted, as specified in C++11 [class.ctor]p5, C++11 [class.copy]p11,\n/// C++11 [class.copy]p23, and C++11 [class.dtor]p5.\nbool Sema::ShouldDeleteSpecialMember(CXXMethodDecl *MD, CXXSpecialMember CSM, InheritedConstructorInfo *ICI, bool Diagnose) {\n // C++11 [expr.lambda.prim]p19:\n // The closure type associated with a lambda-expression has a\n // deleted (8.4.3) default constructor and a deleted copy\n // assignment operator.\n // C++2a adds back these operators if the lambda has no lambda-capture.\n if (RD->isLambda() && !RD->lambdaIsDefaultConstructibleAndAssignable() && (CSM == CXXDefaultConstructor || CSM == CXXCopyAssignment)) {\n if (Diagnose)\n Diag(RD->getLocation(), diag::note_lambda_decl);"},{r,19745,"bool Sema::tryCaptureVariable(ValueDecl *Var, SourceLocation ExprLoc, TryCaptureKind Kind, SourceLocation EllipsisLoc, bool BuildAndDiagnose, QualType &CaptureType, QualType &DeclRefType, const unsigned *const FunctionScopeIndexToStopAt) {\n do {\n // If we are instantiating a generic lambda call operator body,\n // we do not want to capture new variables. What was captured\n // during either a lambdas transformation or initial parsing\n // should be used.\n if (isGenericLambdaCallOperatorSpecialization(DC)) {\n if (BuildAndDiagnose) {\n if (LSI->ImpCaptureStyle == CapturingScopeInfo::ImpCap_None) {\n Diag(LSI->Lambda->getBeginLoc(), diag::note_lambda_decl);"},{r,20814,"bool Sema::tryCaptureVariable(ValueDecl *Var, SourceLocation ExprLoc, TryCaptureKind Kind, SourceLocation EllipsisLoc, bool BuildAndDiagnose, QualType &CaptureType, QualType &DeclRefType, const unsigned *const FunctionScopeIndexToStopAt) {\n do {\n if (CSI->ImpCaptureStyle == CapturingScopeInfo::ImpCap_None && !Explicit) {\n // No capture-default, and this is not an explicit capture\n // so cannot capture this variable.\n if (BuildAndDiagnose) {\n if (LSI->Lambda) {\n Diag(LSI->Lambda->getBeginLoc(), diag::note_lambda_decl);"}} | ||
}, | }, | ||
["note_lambda_default_capture_fixit"]={ | ["note_lambda_default_capture_fixit"]={ | ||
Line 5,746: | Line 5,746: | ||
[c]=ac, | [c]=ac, | ||
[m]={T,1590001902,S}, | [m]={T,1590001902,S}, | ||
[n]={{r, | [n]={{r,19534,"/// Create up to 4 fix-its for explicit reference and value capture of \\p Var or\n/// default capture. Fixes may be omitted if they aren\'t allowed by the\n/// standard, for example we can\'t emit a default copy capture fix-it if we\n/// already explicitly copy capture capture another variable.\nstatic void buildLambdaCaptureFixit(Sema &Sema, LambdaScopeInfo *LSI, ValueDecl *Var) {\n if (ShouldOfferCopyFix) {\n // We can\'t use default capture by copy if any captures already specified\n // capture by copy.\n if (CanDefaultCopyCapture && llvm::none_of(LSI->Captures, [](Capture &C) { return !C.isThisCapture() && !C.isInitCapture() && C.isCopyCapture(); })) {\n Sema.Diag(DefaultInsertLoc, diag::note_lambda_default_capture_fixit) << /*value*/ 0 << FixItHint::CreateInsertion(DefaultInsertLoc, FixBuffer);"},{r,19665,"/// Create up to 4 fix-its for explicit reference and value capture of \\p Var or\n/// default capture. Fixes may be omitted if they aren\'t allowed by the\n/// standard, for example we can\'t emit a default copy capture fix-it if we\n/// already explicitly copy capture capture another variable.\nstatic void buildLambdaCaptureFixit(Sema &Sema, LambdaScopeInfo *LSI, ValueDecl *Var) {\n // We can\'t use default capture by reference if any captures already specified\n // capture by reference.\n if (llvm::none_of(LSI->Captures, [](Capture &C) { return !C.isInitCapture() && C.isReferenceCapture() && !C.isThisCapture(); })) {\n Sema.Diag(DefaultInsertLoc, diag::note_lambda_default_capture_fixit) << /*reference*/ 1 << FixItHint::CreateInsertion(DefaultInsertLoc, FixBuffer);"}} | ||
}, | }, | ||
["note_lambda_substitution_here"]={ | ["note_lambda_substitution_here"]={ | ||
Line 5,758: | Line 5,758: | ||
[c]=o, | [c]=o, | ||
[m]={db,1625925174,eb}, | [m]={db,1625925174,eb}, | ||
[n]={{z, | [n]={{z,1019,"/// Prints the current instantiation stack through a series of\n/// notes.\nvoid Sema::PrintInstantiationStack() {\n for (SmallVectorImpl<CodeSynthesisContext>::reverse_iterator Active = CodeSynthesisContexts.rbegin(), ActiveEnd = CodeSynthesisContexts.rend(); Active != ActiveEnd; ++Active, ++InstantiationIdx) {\n case CodeSynthesisContext::LambdaExpressionSubstitution:\n Diags.Report(Active->PointOfInstantiation, diag::note_lambda_substitution_here);"}} | ||
}, | }, | ||
["note_lambda_this_capture_fixit"]={ | ["note_lambda_this_capture_fixit"]={ | ||
Line 5,770: | Line 5,770: | ||
[c]=ac, | [c]=ac, | ||
[m]={T,1590001902,S}, | [m]={T,1590001902,S}, | ||
[n]={{K, | [n]={{K,1276,"static void buildLambdaThisCaptureFixit(Sema &Sema, LambdaScopeInfo *LSI) {\n Sema.Diag(DiagLoc, diag::note_lambda_this_capture_fixit) << FixItHint::CreateInsertion(DiagLoc, LSI->NumExplicitCaptures > 0 ? \", this\" : \"this\");"}} | ||
}, | }, | ||
["note_lambda_to_block_conv"]={ | ["note_lambda_to_block_conv"]={ | ||
Line 5,782: | Line 5,782: | ||
[c]=ac, | [c]=ac, | ||
[m]={"d3b672c38545",1329354376,"Implicitly define a lambda\'s conversion functions (to function"}, | [m]={"d3b672c38545",1329354376,"Implicitly define a lambda\'s conversion functions (to function"}, | ||
[n]={{q, | [n]={{q,15692,"void Sema::DefineImplicitLambdaToBlockPointerConversion(SourceLocation CurrentLocation, CXXConversionDecl *Conv) {\n if (BuildBlock.isInvalid()) {\n Diag(CurrentLocation, diag::note_lambda_to_block_conv);"},{q,15701,"void Sema::DefineImplicitLambdaToBlockPointerConversion(SourceLocation CurrentLocation, CXXConversionDecl *Conv) {\n if (Return.isInvalid()) {\n Diag(CurrentLocation, diag::note_lambda_to_block_conv);"},{K,8078,"ExprResult Sema::BuildCXXMemberCallExpr(Expr *E, NamedDecl *FoundDecl, CXXConversionDecl *Method, bool HadMultipleCandidates) {\n if (Method->getParent()->isLambda() && Method->getConversionType()->isBlockPointerType()) {\n if (isa<LambdaExpr>(SubE)) {\n // FIXME: This note should be produced by a CodeSynthesisContext.\n if (BlockExp.isInvalid())\n Diag(Exp.get()->getExprLoc(), diag::note_lambda_to_block_conv);"}} | ||
}, | }, | ||
["note_lambda_variable_capture_fixit"]={ | ["note_lambda_variable_capture_fixit"]={ | ||
Line 5,794: | Line 5,794: | ||
[c]=ac, | [c]=ac, | ||
[m]={T,1590001902,S}, | [m]={T,1590001902,S}, | ||
[n]={{r, | [n]={{r,19486,"/// Create up to 4 fix-its for explicit reference and value capture of \\p Var or\n/// default capture. Fixes may be omitted if they aren\'t allowed by the\n/// standard, for example we can\'t emit a default copy capture fix-it if we\n/// already explicitly copy capture capture another variable.\nstatic void buildLambdaCaptureFixit(Sema &Sema, LambdaScopeInfo *LSI, ValueDecl *Var) {\n if (Var->getDeclName().isIdentifier() && !Var->getName().empty()) {\n if (ShouldOfferCopyFix) {\n Sema.Diag(VarInsertLoc, diag::note_lambda_variable_capture_fixit) << Var << /*value*/ 0 << FixItHint::CreateInsertion(VarInsertLoc, FixBuffer);"},{r,19521,"/// Create up to 4 fix-its for explicit reference and value capture of \\p Var or\n/// default capture. Fixes may be omitted if they aren\'t allowed by the\n/// standard, for example we can\'t emit a default copy capture fix-it if we\n/// already explicitly copy capture capture another variable.\nstatic void buildLambdaCaptureFixit(Sema &Sema, LambdaScopeInfo *LSI, ValueDecl *Var) {\n if (Var->getDeclName().isIdentifier() && !Var->getName().empty()) {\n Sema.Diag(VarInsertLoc, diag::note_lambda_variable_capture_fixit) << Var << /*reference*/ 1 << FixItHint::CreateInsertion(VarInsertLoc, FixBuffer);"}} | ||
}, | }, | ||
["note_lifetime_extending_member_declared_here"]={ | ["note_lifetime_extending_member_declared_here"]={ | ||
Line 5,806: | Line 5,806: | ||
[c]=o, | [c]=o, | ||
[m]={"0a9969b36b16",1531786301,"Restructure checking for, and warning on, lifetime extension."}, | [m]={"0a9969b36b16",1531786301,"Restructure checking for, and warning on, lifetime extension."}, | ||
[n]={{D, | [n]={{D,8190,"void Sema::checkInitializerLifetime(const InitializedEntity &Entity, Expr *Init) {\n auto TemporaryVisitor = [&](IndirectLocalPath &Path, Local L, ReferenceKind RK) -> bool {\n case LK_MemInitializer: {\n if (isa<MaterializeTemporaryExpr>(L)) {\n // Under C++ DR1696, if a mem-initializer (or a default member\n // initializer used by the absence of one) would lifetime-extend a\n // temporary, the program is ill-formed.\n if (auto *ExtendingDecl = ExtendingEntity ? ExtendingEntity->getDecl() : nullptr) {\n // Don\'t bother adding a note pointing to the field if we\'re inside\n // its default member initializer; our primary diagnostic points to\n // the same place in that case.\n if (Path.empty() || Path.back().Kind != IndirectLocalPathEntry::DefaultInit) {\n Diag(ExtendingDecl->getLocation(), diag::note_lifetime_extending_member_declared_here) << RK << IsSubobjectMember;"}} | ||
}, | }, | ||
["note_local_decl_close_match"]={ | ["note_local_decl_close_match"]={ | ||
Line 5,818: | Line 5,818: | ||
[c]=o, | [c]=o, | ||
[m]={"114394f8246f",1376022901,"Implement [class.friend]p11\'s special name lookup rules for friend declarations"}, | [m]={"114394f8246f",1376022901,"Implement [class.friend]p11\'s special name lookup rules for friend declarations"}, | ||
[n]={{t, | [n]={{t,9092,"/// Generate diagnostics for an invalid function redeclaration.\n///\n/// This routine handles generating the diagnostic messages for an invalid\n/// function redeclaration, including finding possible similar declarations\n/// or performing typo correction if there are no previous declarations with\n/// the same name.\n///\n/// Returns a NamedDecl iff typo correction was performed and substituting in\n/// the new declaration name does not cause new errors.\nstatic NamedDecl *DiagnoseInvalidRedeclaration(Sema &SemaRef, LookupResult &Previous, FunctionDecl *NewFD, ActOnFDArgs &ExtraArgs, bool IsLocalFriend, Scope *S) {\n for (SmallVectorImpl<std::pair<FunctionDecl *, unsigned>>::iterator NearMatch = NearMatches.begin(), NearMatchEnd = NearMatches.end(); NearMatch != NearMatchEnd; ++NearMatch) {\n // FIXME: These notes are poorly worded for the local friend case.\n if (unsigned Idx = NearMatch->second) {\n } else if (FDisConst != NewFDisConst) {\n } else\n SemaRef.Diag(FD->getLocation(), IsMember ? diag::note_member_def_close_match : diag::note_local_decl_close_match);"}} | ||
}, | }, | ||
["note_local_decl_close_param_match"]={ | ["note_local_decl_close_param_match"]={ | ||
Line 5,830: | Line 5,830: | ||
[c]=o, | [c]=o, | ||
[m]={"114394f8246f",1376022901,"Implement [class.friend]p11\'s special name lookup rules for friend declarations"}, | [m]={"114394f8246f",1376022901,"Implement [class.friend]p11\'s special name lookup rules for friend declarations"}, | ||
[n]={{t, | [n]={{t,9076,"/// Generate diagnostics for an invalid function redeclaration.\n///\n/// This routine handles generating the diagnostic messages for an invalid\n/// function redeclaration, including finding possible similar declarations\n/// or performing typo correction if there are no previous declarations with\n/// the same name.\n///\n/// Returns a NamedDecl iff typo correction was performed and substituting in\n/// the new declaration name does not cause new errors.\nstatic NamedDecl *DiagnoseInvalidRedeclaration(Sema &SemaRef, LookupResult &Previous, FunctionDecl *NewFD, ActOnFDArgs &ExtraArgs, bool IsLocalFriend, Scope *S) {\n for (SmallVectorImpl<std::pair<FunctionDecl *, unsigned>>::iterator NearMatch = NearMatches.begin(), NearMatchEnd = NearMatches.end(); NearMatch != NearMatchEnd; ++NearMatch) {\n // FIXME: These notes are poorly worded for the local friend case.\n if (unsigned Idx = NearMatch->second) {\n SemaRef.Diag(Loc, IsMember ? diag::note_member_def_close_param_match : diag::note_local_decl_close_param_match) << Idx << FDParam->getType() << NewFD->getParamDecl(Idx - 1)->getType();"}} | ||
}, | }, | ||
["note_local_var_initializer"]={ | ["note_local_var_initializer"]={ | ||
Line 5,842: | Line 5,842: | ||
[c]=o, | [c]=o, | ||
[m]={"afe48f9d68e4",1532380882,"Fold -Wreturn-stack-address into general initialization lifetime"}, | [m]={"afe48f9d68e4",1532380882,"Fold -Wreturn-stack-address into general initialization lifetime"}, | ||
[n]={{D, | [n]={{D,8302,"void Sema::checkInitializerLifetime(const InitializedEntity &Entity, Expr *Init) {\n auto TemporaryVisitor = [&](IndirectLocalPath &Path, Local L, ReferenceKind RK) -> bool {\n for (unsigned I = 0; I != Path.size(); ++I) {\n case IndirectLocalPathEntry::VarInit: {\n Diag(VD->getLocation(), diag::note_local_var_initializer) << VD->getType()->isReferenceType() << VD->isImplicit() << VD->getDeclName() << nextPathEntryRange(Path, I + 1, L);"}} | ||
}, | }, | ||
["note_lock_exclusive_and_shared"]={ | ["note_lock_exclusive_and_shared"]={ | ||
Line 5,854: | Line 5,854: | ||
[c]=o, | [c]=o, | ||
[m]={"46b057681a7f",1315505978,"Thread safety: shared vs. exclusive locks"}, | [m]={"46b057681a7f",1315505978,"Thread safety: shared vs. exclusive locks"}, | ||
[n]={{Z, | [n]={{Z,1936,"class ThreadSafetyReporter : public clang::threadSafety::ThreadSafetyHandler {\n void handleExclusiveAndShared(StringRef Kind, Name LockName, SourceLocation Loc1, SourceLocation Loc2) override {\n PartialDiagnosticAt Note(Loc2, S.PDiag(diag::note_lock_exclusive_and_shared) << Kind << LockName);"}} | ||
}, | }, | ||
["note_locked_here"]={ | ["note_locked_here"]={ | ||
Line 5,866: | Line 5,866: | ||
[c]=o, | [c]=o, | ||
[m]={"922866783b07",1328244326,"Thread safety analysis:"}, | [m]={"922866783b07",1328244326,"Thread safety analysis:"}, | ||
[n]={{Z, | [n]={{Z,1831,"class ThreadSafetyReporter : public clang::threadSafety::ThreadSafetyHandler {\n OptionalNotes makeLockedHereNote(SourceLocation LocLocked, StringRef Kind) { return LocLocked.isValid() ? getNotes(PartialDiagnosticAt(LocLocked, S.PDiag(diag::note_locked_here) << Kind)) : getNotes(); }"}} | ||
}, | }, | ||
["note_logical_instead_of_bitwise_change_operator"]={ | ["note_logical_instead_of_bitwise_change_operator"]={ | ||
Line 5,878: | Line 5,878: | ||
[c]=o, | [c]=o, | ||
[m]={"0a0ba9d883f5",1313430606,"Add fixit notes for -Wconstant-logical-operand."}, | [m]={"0a0ba9d883f5",1313430606,"Add fixit notes for -Wconstant-logical-operand."}, | ||
[n]={{r, | [n]={{r,13943,"// C99 6.5.[13,14]\ninline QualType Sema::CheckLogicalOperands(ExprResult &LHS, ExprResult &RHS, SourceLocation Loc, BinaryOperatorKind Opc) {\n // Diagnose cases where the user write a logical and/or but probably meant a\n // bitwise one. We do this when the LHS is a non-bool integer and the RHS\n // is a constant.\n if (!EnumConstantInBoolContext && LHS.get()->getType()->isIntegerType() && !LHS.get()->getType()->isBooleanType() && RHS.get()->getType()->isIntegerType() && !RHS.get()->isValueDependent() &&\n if (RHS.get()->EvaluateAsInt(EVResult, Context)) {\n if ((getLangOpts().Bool && !RHS.get()->getType()->isBooleanType() && !RHS.get()->getExprLoc().isMacroID()) || (Result != 0 && Result != 1)) {\n Diag(Loc, diag::note_logical_instead_of_bitwise_change_operator) << (Opc == BO_LAnd ? \"&\" : \"|\") << FixItHint::CreateReplacement(SourceRange(Loc, getLocForEndOfToken(Loc)), Opc == BO_LAnd ? \"&\" : \"|\");"}} | ||
}, | }, | ||
["note_logical_instead_of_bitwise_remove_constant"]={ | ["note_logical_instead_of_bitwise_remove_constant"]={ | ||
Line 5,890: | Line 5,890: | ||
[c]=o, | [c]=o, | ||
[m]={"0a0ba9d883f5",1313430606,"Add fixit notes for -Wconstant-logical-operand."}, | [m]={"0a0ba9d883f5",1313430606,"Add fixit notes for -Wconstant-logical-operand."}, | ||
[n]={{r, | [n]={{r,14100,"// C99 6.5.[13,14]\ninline QualType Sema::CheckLogicalOperands(ExprResult &LHS, ExprResult &RHS, SourceLocation Loc, BinaryOperatorKind Opc) {\n // Diagnose cases where the user write a logical and/or but probably meant a\n // bitwise one. We do this when the LHS is a non-bool integer and the RHS\n // is a constant.\n if (!EnumConstantInBoolContext && LHS.get()->getType()->isIntegerType() && !LHS.get()->getType()->isBooleanType() && RHS.get()->getType()->isIntegerType() && !RHS.get()->isValueDependent() &&\n if (RHS.get()->EvaluateAsInt(EVResult, Context)) {\n if ((getLangOpts().Bool && !RHS.get()->getType()->isBooleanType() && !RHS.get()->getExprLoc().isMacroID()) || (Result != 0 && Result != 1)) {\n if (Opc == BO_LAnd)\n Diag(Loc, diag::note_logical_instead_of_bitwise_remove_constant) << FixItHint::CreateRemoval(SourceRange(getLocForEndOfToken(LHS.get()->getEndLoc()), RHS.get()->getEndLoc()));"}} | ||
}, | }, | ||
["note_logical_not_fix"]={ | ["note_logical_not_fix"]={ | ||
Line 5,902: | Line 5,902: | ||
[c]=o, | [c]=o, | ||
[m]={"bb4b894e0b2d",1370890327,"Add a new warning, -Wlogical-not-parentheses, to -Wparentheses."}, | [m]={"bb4b894e0b2d",1370890327,"Add a new warning, -Wlogical-not-parentheses, to -Wparentheses."}, | ||
[n]={{r, | [n]={{r,12557,"/// Warns on !x < y, !x & y where !(x < y), !(x & y) was probably intended.\nstatic void diagnoseLogicalNotOnLHSofCheck(Sema &S, ExprResult &LHS, ExprResult &RHS, SourceLocation Loc, BinaryOperatorKind Opc) {\n S.Diag(UO->getOperatorLoc(), diag::note_logical_not_fix) << IsBitwiseOp << FixItHint::CreateInsertion(FirstOpen, \"(\") << FixItHint::CreateInsertion(FirstClose, \")\");"}} | ||
}, | }, | ||
["note_logical_not_silence_with_parens"]={ | ["note_logical_not_silence_with_parens"]={ | ||
Line 5,914: | Line 5,914: | ||
[c]=o, | [c]=o, | ||
[m]={"bb4b894e0b2d",1370890327,"Add a new warning, -Wlogical-not-parentheses, to -Wparentheses."}, | [m]={"bb4b894e0b2d",1370890327,"Add a new warning, -Wlogical-not-parentheses, to -Wparentheses."}, | ||
[n]={{r, | [n]={{r,12624,"/// Warns on !x < y, !x & y where !(x < y), !(x & y) was probably intended.\nstatic void diagnoseLogicalNotOnLHSofCheck(Sema &S, ExprResult &LHS, ExprResult &RHS, SourceLocation Loc, BinaryOperatorKind Opc) {\n S.Diag(UO->getOperatorLoc(), diag::note_logical_not_silence_with_parens) << FixItHint::CreateInsertion(SecondOpen, \"(\") << FixItHint::CreateInsertion(SecondClose, \")\");"}} | ||
}, | }, | ||
["note_loop_iteration_here"]={ | ["note_loop_iteration_here"]={ | ||
Line 5,926: | Line 5,926: | ||
[c]=o, | [c]=o, | ||
[m]={"4e7c9628917a",1375824714,"Add a new warning to -Wloop-analysis to detect suspicious increments or"}, | [m]={"4e7c9628917a",1375824714,"Add a new warning to -Wloop-analysis to detect suspicious increments or"}, | ||
[n]={{A, | [n]={{A,2107,"// Emit a warning when a loop increment/decrement appears twice per loop\n// iteration. The conditions which trigger this warning are:\n// 1) The last statement in the loop body and the third expression in the\n// for loop are both increment or both decrement of the same variable\n// 2) No continue statements in the loop body.\nvoid CheckForRedundantIteration(Sema &S, Expr *Third, Stmt *Body) {\n S.Diag(LoopDRE->getLocation(), diag::note_loop_iteration_here) << LoopIncrement;"}} | ||
}, | }, | ||
["note_macro_expansion_here"]={ | ["note_macro_expansion_here"]={ | ||
Line 5,938: | Line 5,938: | ||
[c]=R, | [c]=R, | ||
[m]={"023dd1eefad3",1550117597,"Print a note to the called macro when diagnosing err_embedded_directive"}, | [m]={"023dd1eefad3",1550117597,"Print a note to the called macro when diagnosing err_embedded_directive"}, | ||
[n]={{"clang/lib/Lex/PPDirectives.cpp", | [n]={{"clang/lib/Lex/PPDirectives.cpp",1177,"/// HandleDirective - This callback is invoked when the lexer sees a # token\n/// at the start of a line. This consumes the directive, modifies the\n/// lexer/preprocessor state, and advances the lexer(s) so that the next token\n/// read is the correct one.\nvoid Preprocessor::HandleDirective(Token &Result) {\n // C99 6.10.3p11: Is this preprocessor directive in macro invocation? e.g.:\n // #define A(x) #x\n // A(abc\n // #warning blah\n // def)\n // If so, the user is relying on undefined behavior, emit a diagnostic. Do\n // not support this for #include-like directives, since that can result in\n // terrible diagnostics, and does not work in GCC.\n if (InMacroArgs) {\n if (IdentifierInfo *II = Result.getIdentifierInfo()) {\n case tok::pp_pragma:\n Diag(*ArgMacro, diag::note_macro_expansion_here) << ArgMacro->getIdentifierInfo();"}} | ||
}, | }, | ||
["note_macro_here"]={ | ["note_macro_here"]={ | ||
Line 5,950: | Line 5,950: | ||
[c]=R, | [c]=R, | ||
[m]={"19b02cd7fc91",1340409548,"Minor improvements to some C99 variadic-macro-related diagnostics."}, | [m]={"19b02cd7fc91",1340409548,"Minor improvements to some C99 variadic-macro-related diagnostics."}, | ||
[n]={{ib, | [n]={{ib,816,"/// ReadFunctionLikeMacroArgs - After reading \"MACRO\" and knowing that the next\n/// token is the \'(\' of the macro, this method is invoked to read all of the\n/// actual arguments specified for the macro invocation. This returns null on\n/// error.\nMacroArgs *Preprocessor::ReadMacroCallArgumentList(Token &MacroName, MacroInfo *MI, SourceLocation &MacroEnd) {\n while (Tok.isNot(tok::r_paren)) {\n while (true) {\n if (Tok.isOneOf(tok::eof, tok::eod)) { // \"#if f(<eof>\" & \"#if f(\\n\"\n if (!ContainsCodeCompletionTok) {\n Diag(MI->getDefinitionLoc(), diag::note_macro_here) << MacroName.getIdentifierInfo();"},{ib,930,"/// ReadFunctionLikeMacroArgs - After reading \"MACRO\" and knowing that the next\n/// token is the \'(\' of the macro, this method is invoked to read all of the\n/// actual arguments specified for the macro invocation. This returns null on\n/// error.\nMacroArgs *Preprocessor::ReadMacroCallArgumentList(Token &MacroName, MacroInfo *MI, SourceLocation &MacroEnd) {\n // If this is not a variadic macro, and too many args were specified, emit\n // an error.\n if (!isVariadic && NumActuals > MinArgsExpected && !ContainsCodeCompletionTok) {\n Diag(MI->getDefinitionLoc(), diag::note_macro_here) << MacroName.getIdentifierInfo();"},{ib,1002,"/// ReadFunctionLikeMacroArgs - After reading \"MACRO\" and knowing that the next\n/// token is the \'(\' of the macro, this method is invoked to read all of the\n/// actual arguments specified for the macro invocation. This returns null on\n/// error.\nMacroArgs *Preprocessor::ReadMacroCallArgumentList(Token &MacroName, MacroInfo *MI, SourceLocation &MacroEnd) {\n if (NumActuals < MinArgsExpected) {\n // There are several cases where too few arguments is ok, handle them now.\n if (NumActuals == 0 && MinArgsExpected == 1) {\n } else if ((FoundElidedComma || MI->isVariadic()) && (NumActuals + 1 == MinArgsExpected || // A(x, ...) -> A(X)\n // Varargs where the named vararg parameter is missing: OK as extension.\n // #define A(x, ...)\n // A(\"blah\")\n //\n // If the macro contains the comma pasting extension, the diagnostic\n // is suppressed; we know we\'ll get another diagnostic later.\n if (!MI->hasCommaPasting()) {\n Diag(MI->getDefinitionLoc(), diag::note_macro_here) << MacroName.getIdentifierInfo();"},{ib,1016,"/// ReadFunctionLikeMacroArgs - After reading \"MACRO\" and knowing that the next\n/// token is the \'(\' of the macro, this method is invoked to read all of the\n/// actual arguments specified for the macro invocation. This returns null on\n/// error.\nMacroArgs *Preprocessor::ReadMacroCallArgumentList(Token &MacroName, MacroInfo *MI, SourceLocation &MacroEnd) {\n if (NumActuals < MinArgsExpected) {\n // There are several cases where too few arguments is ok, handle them now.\n if (NumActuals == 0 && MinArgsExpected == 1) {\n } else if ((FoundElidedComma || MI->isVariadic()) && (NumActuals + 1 == MinArgsExpected || // A(x, ...) -> A(X)\n } else if (!ContainsCodeCompletionTok) {\n Diag(MI->getDefinitionLoc(), diag::note_macro_here) << MacroName.getIdentifierInfo();"},{ib,1038,"/// ReadFunctionLikeMacroArgs - After reading \"MACRO\" and knowing that the next\n/// token is the \'(\' of the macro, this method is invoked to read all of the\n/// actual arguments specified for the macro invocation. This returns null on\n/// error.\nMacroArgs *Preprocessor::ReadMacroCallArgumentList(Token &MacroName, MacroInfo *MI, SourceLocation &MacroEnd) {\n if (NumActuals < MinArgsExpected) {\n } else if (NumActuals > MinArgsExpected && !MI->isVariadic() && !ContainsCodeCompletionTok) {\n Diag(MI->getDefinitionLoc(), diag::note_macro_here) << MacroName.getIdentifierInfo();"}} | ||
}, | }, | ||
["note_main_change_return_type"]={ | ["note_main_change_return_type"]={ | ||
Line 5,962: | Line 5,962: | ||
[c]=o, | [c]=o, | ||
[m]={"ae73417b6955",1358382373,"Implement a fixit for -Wmain-return-type"}, | [m]={"ae73417b6955",1358382373,"Implement a fixit for -Wmain-return-type"}, | ||
[n]={{t, | [n]={{t,12131,"void Sema::CheckMain(FunctionDecl *FD, const DeclSpec &DS) {\n if (getLangOpts().GNUMode && !getLangOpts().CPlusPlus) {\n // GCC in C mode accepts qualified \'int\'.\n if (Context.hasSameUnqualifiedType(FT->getReturnType(), Context.IntTy))\n else {\n if (RTRange.isValid())\n Diag(RTRange.getBegin(), diag::note_main_change_return_type) << FixItHint::CreateReplacement(RTRange, \"int\");"}} | ||
}, | }, | ||
["note_main_remove_noreturn"]={ | ["note_main_remove_noreturn"]={ | ||
Line 5,974: | Line 5,974: | ||
[c]=o, | [c]=o, | ||
[m]={"7ec6f3ddeb4c",1358767503,"Add a fixit for _Noreturn main,"}, | [m]={"7ec6f3ddeb4c",1358767503,"Add a fixit for _Noreturn main,"}, | ||
[n]={{t, | [n]={{t,12086,"void Sema::CheckMain(FunctionDecl *FD, const DeclSpec &DS) {\n if (DS.isNoreturnSpecified()) {\n Diag(NoreturnLoc, diag::note_main_remove_noreturn) << FixItHint::CreateRemoval(NoreturnRange);"}} | ||
}, | }, | ||
["note_matching"]={ | ["note_matching"]={ | ||
Line 5,986: | Line 5,986: | ||
[c]=a, | [c]=a, | ||
[m]={wb,1236199783,vb}, | [m]={wb,1236199783,vb}, | ||
[n]={{"clang/lib/Lex/PPDirectives.cpp", | [n]={{"clang/lib/Lex/PPDirectives.cpp",3023,"MacroInfo *Preprocessor::ReadOptionalMacroParameterListAndBody(const Token &MacroNameTok, const bool ImmediatelyAfterHeaderGuard) {\n // Read the rest of the macro body.\n if (MI->isObjectLike()) {\n } else {\n if (VAOCtx.isInVAOpt()) {\n Diag(VAOCtx.getUnmatchedOpeningParenLoc(), diag::note_matching) << tok::l_paren;"},{"clang/lib/Lex/PPExpressions.cpp",155,"/// EvaluateDefined - Process a \'defined(sym)\' expression.\nstatic bool EvaluateDefined(PPValue &Result, Token &PeekTok, DefinedTracker &DT, bool ValueLive, Preprocessor &PP) {\n // If we are in parens, ensure we have a trailing ).\n if (LParenLoc.isValid()) {\n if (PeekTok.isNot(tok::r_paren)) {\n PP.Diag(LParenLoc, diag::note_matching) << tok::l_paren;"},{"clang/lib/Lex/PPExpressions.cpp",459,"/// EvaluateValue - Evaluate the token PeekTok (and any others needed) and\n/// return the computed value in Result. Return true if there was an error\n/// parsing. This function also returns information about the form of the\n/// expression in DT. See above for information on what DT means.\n///\n/// If ValueLive is false, then this value is being evaluated in a context where\n/// the result is not used. As such, avoid diagnostics that relate to\n/// evaluation.\nstatic bool EvaluateValue(PPValue &Result, Token &PeekTok, DefinedTracker &DT, bool ValueLive, Preprocessor &PP) {\n case tok::l_paren: {\n // If this is a silly value like (X), which doesn\'t need parens, check for\n // !(defined X).\n if (PeekTok.is(tok::r_paren)) {\n } else {\n if (PeekTok.isNot(tok::r_paren)) {\n PP.Diag(Start, diag::note_matching) << tok::l_paren;"},{"clang/lib/Lex/PPExpressions.cpp",817,"/// EvaluateDirectiveSubExpr - Evaluate the subexpression whose first token is\n/// PeekTok, and whose precedence is PeekPrec. This returns the result in LHS.\n///\n/// If ValueLive is false, then this value is being evaluated in a context where\n/// the result is not used. As such, avoid diagnostics that relate to\n/// evaluation, such as division by zero warnings.\nstatic bool EvaluateDirectiveSubExpr(PPValue &LHS, unsigned MinPrec, Token &PeekTok, bool ValueLive, bool &IncludedUndefinedIds, Preprocessor &PP) {\n while (true) {\n case tok::question: {\n // Parse the : part of the expression.\n if (PeekTok.isNot(tok::colon)) {\n PP.Diag(OpLoc, diag::note_matching) << tok::question;"},{ib,1242,"/// EvaluateHasIncludeCommon - Process a \'__has_include(\"path\")\'\n/// or \'__has_include_next(\"path\")\' expression.\n/// Returns true if successful.\nstatic bool EvaluateHasIncludeCommon(Token &Tok, IdentifierInfo *II, Preprocessor &PP, ConstSearchDirIterator LookupFrom, const FileEntry *LookupFromFile) {\n // Ensure we have a trailing ).\n if (Tok.isNot(tok::r_paren)) {\n PP.Diag(LParenLoc, diag::note_matching) << tok::l_paren;"},{ib,1385,"/// Process single-argument builtin feature-like macros that return\n/// integer values.\nstatic void EvaluateFeatureLikeBuiltinMacro(llvm::raw_svector_ostream &OS, Token &Tok, IdentifierInfo *II, Preprocessor &PP, bool ExpandArgs, llvm::function_ref<int(Token &Tok, bool &HasLexedNextTok)> Op) {\n already_lexed:\n // Diagnose missing \')\'.\n if (!SuppressDiagnostic) {\n PP.Diag(LParenLoc, diag::note_matching) << tok::l_paren;"},{ib,1894,"#include \"clang/Basic/TransformTypeTraits.def\"\n } else if (II == Ident__has_constexpr_builtin) {\n } else if (II == Ident__is_identifier) {\n } else if (II == Ident__has_attribute) {\n } else if (II == Ident__has_declspec) {\n } else if (II == Ident__has_cpp_attribute || II == Ident__has_c_attribute) {\n } else if (II == Ident__has_include || II == Ident__has_include_next) {\n } else if (II == Ident__has_warning) {\n } else if (II == Ident__building_module) {\n } else if (II == Ident__MODULE__) {\n } else if (II == Ident__identifier) {\n if (RParen.isNot(tok::r_paren)) {\n Diag(LParenLoc, diag::note_matching) << tok::l_paren;"},{"clang/lib/Lex/Preprocessor.cpp",1038,"/// Lex a header-name token (including one formed from header-name-tokens if\n/// \\p AllowConcatenation is \\c true).\n///\n/// \\param FilenameTok Filled in with the next token. On success, this will\n/// be either a header_name token. On failure, it will be whatever other\n/// token was found instead.\n/// \\param AllowMacroExpansion If \\c true, allow the header name to be formed\n/// by macro expansion (concatenating tokens as necessary if the first\n/// token is a \'<\').\n/// \\return \\c true if we reached EOD or EOF while looking for a > token in\n/// a concatenated header name and diagnosed it. \\c false otherwise.\nbool Preprocessor::LexHeaderName(Token &FilenameTok, bool AllowMacroExpansion) {\n if (FilenameTok.is(tok::less) && AllowMacroExpansion) {\n // Consume tokens until we find a \'>\'.\n // FIXME: A header-name could be formed starting or ending with an\n // alternative token. It\'s not clear whether that\'s ill-formed in all\n // cases.\n while (FilenameTok.isNot(tok::greater)) {\n if (FilenameTok.isOneOf(tok::eod, tok::eof)) {\n Diag(Start, diag::note_matching) << tok::less;"},{"clang/lib/Parse/ParseCXXInlineMethods.cpp",959,"/// Consume tokens and store them in the passed token container until\n/// we\'ve passed the try keyword and constructor initializers and have consumed\n/// the opening brace of the function body. The opening brace will be consumed\n/// if and only if there was no error.\n///\n/// \\return True on error.\nbool Parser::ConsumeAndStoreFunctionPrologue(CachedTokens &Toks) {\n while (true) {\n // Skip over the mem-initializer-id, if possible.\n if (Tok.is(tok::kw_decltype)) {\n if (!ConsumeAndStoreUntil(tok::r_paren, Toks, /*StopAtSemi=*/true)) {\n Diag(OpenLoc, diag::note_matching) << tok::l_paren;"},{"clang/lib/Parse/ParseCXXInlineMethods.cpp",1067,"/// Consume tokens and store them in the passed token container until\n/// we\'ve passed the try keyword and constructor initializers and have consumed\n/// the opening brace of the function body. The opening brace will be consumed\n/// if and only if there was no error.\n///\n/// \\return True on error.\nbool Parser::ConsumeAndStoreFunctionPrologue(CachedTokens &Toks) {\n while (true) {\n if (!ConsumeAndStoreUntil(CloseKind, Toks, /*StopAtSemi=*/true)) {\n Diag(OpenLoc, diag::note_matching) << kind;"},{"clang/lib/Parse/ParseExpr.cpp",524,"/// Parse a binary expression that starts with \\p LHS and has a\n/// precedence of at least \\p MinPrec.\nExprResult Parser::ParseRHSOfBinaryExpression(ExprResult LHS, prec::Level MinPrec) {\n while (true) {\n if (NextTokPrec == prec::Conditional) {\n if (!TryConsumeToken(tok::colon, ColonLoc)) {\n Diag(OpToken, diag::note_matching) << tok::question;"},{"clang/lib/Parse/ParseExpr.cpp",2050,"/// Once the leading part of a postfix-expression is parsed, this\n/// method parses any suffixes that apply.\n///\n/// \\verbatim\n/// postfix-expression: [C99 6.5.2]\n/// primary-expression\n/// postfix-expression \'[\' expression \']\'\n/// postfix-expression \'[\' braced-init-list \']\'\n/// postfix-expression \'[\' expression-list [opt] \']\' [C++23 12.4.5]\n/// postfix-expression \'(\' argument-expression-list[opt] \')\'\n/// postfix-expression \'.\' identifier\n/// postfix-expression \'->\' identifier\n/// postfix-expression \'++\'\n/// postfix-expression \'--\'\n/// \'(\' type-name \')\' \'{\' initializer-list \'}\'\n/// \'(\' type-name \')\' \'{\' initializer-list \',\' \'}\'\n///\n/// argument-expression-list: [C99 6.5.2]\n/// argument-expression ...[opt]\n/// argument-expression-list \',\' assignment-expression ...[opt]\n/// \\endverbatim\nExprResult Parser::ParsePostfixExpressionSuffix(ExprResult LHS) {\n while (true) {\n case tok::lesslessless: { // p-e: p-e \'<<<\' argument-expression-list \'>>>\'\n if (OpKind == tok::lesslessless) {\n if (TryConsumeToken(tok::greatergreatergreater, CloseLoc)) {\n } else if (LHS.isInvalid()) {\n } else {\n Diag(OpenLoc, diag::note_matching) << tok::lesslessless;"},{"clang/lib/Parse/ParseExprCXX.cpp",1608,"/// ParseCXXCasts - This handles the various ways to cast expressions to another\n/// type.\n///\n/// postfix-expression: [C++ 5.2p1]\n/// \'dynamic_cast\' \'<\' type-name \'>\' \'(\' expression \')\'\n/// \'static_cast\' \'<\' type-name \'>\' \'(\' expression \')\'\n/// \'reinterpret_cast\' \'<\' type-name \'>\' \'(\' expression \')\'\n/// \'const_cast\' \'<\' type-name \'>\' \'(\' expression \')\'\n///\n/// C++ for OpenCL s2.3.1 adds:\n/// \'addrspace_cast\' \'<\' type-name \'>\' \'(\' expression \')\'\nExprResult Parser::ParseCXXCasts() {\n if (ExpectAndConsume(tok::greater))\n return ExprError(Diag(LAngleBracketLoc, diag::note_matching) << tok::less);"},{"clang/lib/Parse/ParseOpenMP.cpp",1990,"void Parser::parseOMPEndDirective(OpenMPDirectiveKind BeginKind, OpenMPDirectiveKind ExpectedKind, OpenMPDirectiveKind FoundKind, SourceLocation BeginLoc, SourceLocation FoundLoc, bool SkipUntilOpenMPEnd) {\n Diag(BeginLoc, diag::note_matching) << (\"\'#pragma omp \" + getOpenMPDirectiveName(BeginKind) + \"\'\").str();"},{"clang/lib/Parse/Parser.cpp",2726,"bool BalancedDelimiterTracker::diagnoseMissingClose() {\n P.Diag(LOpen, diag::note_matching) << Kind;"},{"clang/lib/Parse/ParseStmt.cpp",1874,"/// ParseDoStatement\n/// do-statement: [C99 6.8.5.2]\n/// \'do\' statement \'while\' \'(\' expression \')\' \';\'\n/// Note: this lets the caller parse the end \';\'.\nStmtResult Parser::ParseDoStatement() {\n if (Tok.isNot(tok::kw_while)) {\n if (!Body.isInvalid()) {\n Diag(DoLoc, diag::note_matching) << \"\'do\'\";"},{"clang/lib/Parse/ParseStmtAsm.cpp",518,"/// ParseMicrosoftAsmStatement. When -fms-extensions/-fasm-blocks is enabled,\n/// this routine is called to collect the tokens for an MS asm statement.\n///\n/// [MS] ms-asm-statement:\n/// ms-asm-block\n/// ms-asm-block ms-asm-statement\n///\n/// [MS] ms-asm-block:\n/// \'__asm\' ms-asm-line \'\\n\'\n/// \'__asm\' \'{\' ms-asm-instruction-block[opt] \'}\' \';\'[opt]\n///\n/// [MS] ms-asm-instruction-block\n/// ms-asm-line\n/// ms-asm-line \'\\n\' ms-asm-instruction-block\n///\nStmtResult Parser::ParseMicrosoftAsmStatement(SourceLocation AsmLoc) {\n if (BraceNesting && BraceCount != savedBraceCount) {\n // __asm without closing brace (this can happen at EOF).\n for (unsigned i = 0; i < BraceNesting; ++i) {\n Diag(LBraceLocs.back(), diag::note_matching) << tok::l_brace;"},{"clang/lib/Parse/ParseTemplate.cpp",1124,"/// Parses a \'>\' at the end of a template list.\n///\n/// If this function encounters \'>>\', \'>>>\', \'>=\', or \'>>=\', it tries\n/// to determine if these tokens were supposed to be a \'>\' followed by\n/// \'>\', \'>>\', \'>=\', or \'>=\'. It emits an appropriate diagnostic if necessary.\n///\n/// \\param RAngleLoc the location of the consumed \'>\'.\n///\n/// \\param ConsumeLastToken if true, the \'>\' is consumed.\n///\n/// \\param ObjCGenericList if true, this is the \'>\' closing an Objective-C\n/// type parameter or type argument list, rather than a C++ template parameter\n/// or argument list.\n///\n/// \\returns true, if current token does not start with \'>\', false otherwise.\nbool Parser::ParseGreaterThanInTemplateList(SourceLocation LAngleLoc, SourceLocation &RAngleLoc, bool ConsumeLastToken, bool ObjCGenericList) {\n default:\n Diag(LAngleLoc, diag::note_matching) << tok::less;"}} | ||
}, | }, | ||
["note_max_tokens_total_override"]={ | ["note_max_tokens_total_override"]={ | ||
Line 5,998: | Line 5,998: | ||
[c]=a, | [c]=a, | ||
[m]={"739b410f1ff5",1570627358,"Add a warning, flags and pragmas to limit the number of pre-processor tokens in a translation unit"}, | [m]={"739b410f1ff5",1570627358,"Add a warning, flags and pragmas to limit the number of pre-processor tokens in a translation unit"}, | ||
[n]={{"clang/lib/Parse/Parser.cpp", | [n]={{"clang/lib/Parse/Parser.cpp",704,"/// ParseTopLevelDecl - Parse one top-level declaration, return whatever the\n/// action tells us to. This returns true if the EOF was encountered.\n///\n/// top-level-declaration:\n/// declaration\n/// [C++20] module-import-declaration\nbool Parser::ParseTopLevelDecl(DeclGroupPtrTy &Result, Sema::ModuleImportState &ImportState) {\n case tok::annot_repl_input_end:\n // Check whether -fmax-tokens= was reached.\n if (PP.getMaxTokens() != 0 && PP.getTokenCount() > PP.getMaxTokens()) {\n if (OverrideLoc.isValid()) {\n PP.Diag(OverrideLoc, diag::note_max_tokens_total_override);"}} | ||
}, | }, | ||
["note_meant_to_use_typename"]={ | ["note_meant_to_use_typename"]={ | ||
Line 6,010: | Line 6,010: | ||
[c]="Generics Issue", | [c]="Generics Issue", | ||
[m]={"3a98e51823be",1518100678,"[Parser][FixIt] Better diagnostics for \"typedef\" instead of \"typename\" typo"}, | [m]={"3a98e51823be",1518100678,"[Parser][FixIt] Better diagnostics for \"typedef\" instead of \"typename\" typo"}, | ||
[n]={{"clang/lib/Parse/ParseTemplate.cpp", | [n]={{"clang/lib/Parse/ParseTemplate.cpp",659,"/// ParseTemplateParameter - Parse a template-parameter (C++ [temp.param]).\n///\n/// template-parameter: [C++ temp.param]\n/// type-parameter\n/// parameter-declaration\n///\n/// type-parameter: (See below)\n/// type-parameter-key ...[opt] identifier[opt]\n/// type-parameter-key identifier[opt] = type-id\n/// (C++2a) type-constraint ...[opt] identifier[opt]\n/// (C++2a) type-constraint identifier[opt] = type-id\n/// \'template\' \'<\' template-parameter-list \'>\' type-parameter-key\n/// ...[opt] identifier[opt]\n/// \'template\' \'<\' template-parameter-list \'>\' type-parameter-key\n/// identifier[opt] \'=\' id-expression\n///\n/// type-parameter-key:\n/// class\n/// typename\n///\nNamedDecl *Parser::ParseTemplateParameter(unsigned Depth, unsigned Position) {\n case TPResult::True:\n // Is there just a typo in the input code? (\'typedef\' instead of\n // \'typename\')\n if (Tok.is(tok::kw_typedef)) {\n Diag(Tok.getLocation(), diag::note_meant_to_use_typename) << FixItHint::CreateReplacement(CharSourceRange::getCharRange(Tok.getLocation(), Tok.getEndLoc()), \"typename\");"}} | ||
}, | }, | ||
["note_member_declared_at"]={ | ["note_member_declared_at"]={ | ||
Line 6,022: | Line 6,022: | ||
[c]=o, | [c]=o, | ||
[m]={"2afa8780d62a",1401279614,"Consolidate some note diagnostics"}, | [m]={"2afa8780d62a",1401279614,"Consolidate some note diagnostics"}, | ||
[n]={{"clang/lib/Sema/SemaAccess.cpp", | [n]={{"clang/lib/Sema/SemaAccess.cpp",1280,"/// Diagnose the path which caused the given declaration or base class\n/// to become inaccessible.\nstatic void DiagnoseAccessPath(Sema &S, const EffectiveContext &EC, AccessTarget &entity) {\n if (entity.isMemberAccess())\n S.Diag(entity.getTargetDecl()->getLocation(), diag::note_member_declared_at);"},{r,2327,"/// Diagnose a lookup that found results in an enclosing class during error\n/// recovery. This usually indicates that the results were found in a dependent\n/// base class that could not be searched as part of a template definition.\n/// Always issues a diagnostic (though this may be only a warning in MS\n/// compatibility mode).\n///\n/// Return \\c true if the error is unrecoverable, or \\c false if the caller\n/// should attempt to recover using these lookup results.\nbool Sema::DiagnoseDependentMemberLookup(const LookupResult &R) {\n unsigned NoteID = diag::note_member_declared_at;"},{D,9898,"bool InitializationSequence::Diagnose(Sema &S, const InitializedEntity &Entity, const InitializationKind &Kind, ArrayRef<Expr *> Args) {\n case FK_ConstructorOverloadFailed: {\n case OR_No_Viable_Function:\n if (Kind.getKind() == InitializationKind::IK_Default && (Entity.getKind() == InitializedEntity::EK_Base || Entity.getKind() == InitializedEntity::EK_Member || Entity.getKind() == InitializedEntity::EK_ParenAggInitMember) && isa<CXXConstructorDecl>(S.CurContext)) {\n if (Entity.getKind() == InitializedEntity::EK_Base) {\n } else {\n S.Diag(Entity.getDecl()->getLocation(), diag::note_member_declared_at);"},{u,845,"/// Determine whether we would be unable to instantiate this template (because\n/// it either has no definition, or is in the process of being instantiated).\nbool Sema::DiagnoseUninstantiableTemplate(SourceLocation PointOfInstantiation, NamedDecl *Instantiation, bool InstantiatedFromMember, const NamedDecl *Pattern, const NamedDecl *PatternDef, TemplateSpecializationKind TSK, bool Complain /*= true*/) {\n if (PatternDef) {\n } else if (InstantiatedFromMember) {\n if (isa<FunctionDecl>(Instantiation)) {\n } else {\n Note = diag::note_member_declared_at;"}} | ||
}, | }, | ||
["note_member_declared_here"]={ | ["note_member_declared_here"]={ | ||
Line 6,034: | Line 6,034: | ||
[c]=o, | [c]=o, | ||
[m]={"861eb80a3b9d",1272228908,"Improve the diagnostic when we find something we did not expect in a"}, | [m]={"861eb80a3b9d",1272228908,"Improve the diagnostic when we find something we did not expect in a"}, | ||
[n]={{L, | [n]={{L,1270,"bool CoroutineStmtBuilder::makeReturnOnAllocFailure() {\n if (ReturnStmt.isInvalid()) {\n S.Diag(Found.getFoundDecl()->getLocation(), diag::note_member_declared_here) << DN;"},{L,1729,"static void noteMemberDeclaredHere(Sema &S, Expr *E, FunctionScopeInfo &Fn) {\n if (auto *MbrRef = dyn_cast<CXXMemberCallExpr>(E)) {\n S.Diag(MethodDecl->getLocation(), diag::note_member_declared_here) << MethodDecl;"},{K,2944,"bool Sema::FindAllocationFunctions(SourceLocation StartLoc, SourceRange Range, AllocationFunctionScope NewScope, AllocationFunctionScope DeleteScope, QualType AllocType, bool IsArray, bool &PassAlignment, MultiExprArg PlaceArgs, FunctionDecl *&OperatorNew, FunctionDecl *&OperatorDelete, bool Diagnose) {\n // C++ [expr.new]p20:\n // [...] If the lookup finds a single matching deallocation\n // function, that function will be called; otherwise, no\n // deallocation function will be called.\n if (Matches.size() == 1) {\n } else if (!Matches.empty()) {\n for (auto &Match : Matches)\n Diag(Match.second->getLocation(), diag::note_member_declared_here) << DeleteName;"},{K,3303,"bool Sema::FindDeallocationFunction(SourceLocation StartLoc, CXXRecordDecl *RD, DeclarationName Name, FunctionDecl *&Operator, bool Diagnose, bool WantSize, bool WantAligned) {\n // We found multiple suitable operators; complain about the ambiguity.\n // FIXME: The standard doesn\'t say to do this; it appears that the intent\n // is that this should never happen.\n if (!Matches.empty()) {\n if (Diagnose) {\n for (auto &Match : Matches)\n Diag(Match.FD->getLocation(), diag::note_member_declared_here) << Name;"},{K,3317,"bool Sema::FindDeallocationFunction(SourceLocation StartLoc, CXXRecordDecl *RD, DeclarationName Name, FunctionDecl *&Operator, bool Diagnose, bool WantSize, bool WantAligned) {\n // We did find operator delete/operator delete[] declarations, but\n // none of them were suitable.\n if (!Found.empty()) {\n if (Diagnose) {\n for (NamedDecl *D : Found)\n Diag(D->getUnderlyingDecl()->getLocation(), diag::note_member_declared_here) << Name;"},{"clang/lib/Sema/SemaExprMember.cpp",1182,"ExprResult Sema::BuildMemberReferenceExpr(Expr *BaseExpr, QualType BaseExprType, SourceLocation OpLoc, bool IsArrow, const CXXScopeSpec &SS, SourceLocation TemplateKWLoc, NamedDecl *FirstQualifierInScope, LookupResult &R, const TemplateArgumentListInfo *TemplateArgs, const Scope *S, bool SuppressQualifierCheck, ActOnMemberAccessExtraArgs *ExtraArgs) {\n Diag(MemberDecl->getLocation(), diag::note_member_declared_here) << MemberName;"}} | ||
}, | }, | ||
["note_member_def_close_const_match"]={ | ["note_member_def_close_const_match"]={ | ||
Line 6,046: | Line 6,046: | ||
[c]=o, | [c]=o, | ||
[m]={"1a6eb99d45e5",1318269697,"Give nicer note when a member redeclaration has or lacks \'const\'"}, | [m]={"1a6eb99d45e5",1318269697,"Give nicer note when a member redeclaration has or lacks \'const\'"}, | ||
[n]={{t, | [n]={{t,9080,"/// Generate diagnostics for an invalid function redeclaration.\n///\n/// This routine handles generating the diagnostic messages for an invalid\n/// function redeclaration, including finding possible similar declarations\n/// or performing typo correction if there are no previous declarations with\n/// the same name.\n///\n/// Returns a NamedDecl iff typo correction was performed and substituting in\n/// the new declaration name does not cause new errors.\nstatic NamedDecl *DiagnoseInvalidRedeclaration(Sema &SemaRef, LookupResult &Previous, FunctionDecl *NewFD, ActOnFDArgs &ExtraArgs, bool IsLocalFriend, Scope *S) {\n for (SmallVectorImpl<std::pair<FunctionDecl *, unsigned>>::iterator NearMatch = NearMatches.begin(), NearMatchEnd = NearMatches.end(); NearMatch != NearMatchEnd; ++NearMatch) {\n // FIXME: These notes are poorly worded for the local friend case.\n if (unsigned Idx = NearMatch->second) {\n } else if (FDisConst != NewFDisConst) {\n SemaRef.Diag(FD->getLocation(), diag::note_member_def_close_const_match) << NewFDisConst << FD->getSourceRange().getEnd() << (NewFDisConst ? FixItHint::CreateRemoval(ExtraArgs.D.getFunctionTypeInfo().getConstQualifierLoc()) : FixItHint::CreateInsertion(ExtraArgs.D.getFunctionTypeInfo().getRParenLoc().getLocWithOffset(1), \" const\"));"}} | ||
}, | }, | ||
["note_member_def_close_match"]={ | ["note_member_def_close_match"]={ | ||
Line 6,058: | Line 6,058: | ||
[c]=o, | [c]=o, | ||
[m]={"5a8987ca5113",1237025389,"Update tablegen diagnostic files to be in sync with the def files."}, | [m]={"5a8987ca5113",1237025389,"Update tablegen diagnostic files to be in sync with the def files."}, | ||
[n]={{t, | [n]={{t,9091,"/// Generate diagnostics for an invalid function redeclaration.\n///\n/// This routine handles generating the diagnostic messages for an invalid\n/// function redeclaration, including finding possible similar declarations\n/// or performing typo correction if there are no previous declarations with\n/// the same name.\n///\n/// Returns a NamedDecl iff typo correction was performed and substituting in\n/// the new declaration name does not cause new errors.\nstatic NamedDecl *DiagnoseInvalidRedeclaration(Sema &SemaRef, LookupResult &Previous, FunctionDecl *NewFD, ActOnFDArgs &ExtraArgs, bool IsLocalFriend, Scope *S) {\n for (SmallVectorImpl<std::pair<FunctionDecl *, unsigned>>::iterator NearMatch = NearMatches.begin(), NearMatchEnd = NearMatches.end(); NearMatch != NearMatchEnd; ++NearMatch) {\n // FIXME: These notes are poorly worded for the local friend case.\n if (unsigned Idx = NearMatch->second) {\n } else if (FDisConst != NewFDisConst) {\n } else\n SemaRef.Diag(FD->getLocation(), IsMember ? diag::note_member_def_close_match : diag::note_local_decl_close_match);"}} | ||
}, | }, | ||
["note_member_def_close_param_match"]={ | ["note_member_def_close_param_match"]={ | ||
Line 6,070: | Line 6,070: | ||
[c]=o, | [c]=o, | ||
[m]={"7d9bc633d246",1312479600,"Match type names and give more info for out-of-line function definition errors."}, | [m]={"7d9bc633d246",1312479600,"Match type names and give more info for out-of-line function definition errors."}, | ||
[n]={{t, | [n]={{t,9075,"/// Generate diagnostics for an invalid function redeclaration.\n///\n/// This routine handles generating the diagnostic messages for an invalid\n/// function redeclaration, including finding possible similar declarations\n/// or performing typo correction if there are no previous declarations with\n/// the same name.\n///\n/// Returns a NamedDecl iff typo correction was performed and substituting in\n/// the new declaration name does not cause new errors.\nstatic NamedDecl *DiagnoseInvalidRedeclaration(Sema &SemaRef, LookupResult &Previous, FunctionDecl *NewFD, ActOnFDArgs &ExtraArgs, bool IsLocalFriend, Scope *S) {\n for (SmallVectorImpl<std::pair<FunctionDecl *, unsigned>>::iterator NearMatch = NearMatches.begin(), NearMatchEnd = NearMatches.end(); NearMatch != NearMatchEnd; ++NearMatch) {\n // FIXME: These notes are poorly worded for the local friend case.\n if (unsigned Idx = NearMatch->second) {\n SemaRef.Diag(Loc, IsMember ? diag::note_member_def_close_param_match : diag::note_local_decl_close_param_match) << Idx << FDParam->getType() << NewFD->getParamDecl(Idx - 1)->getType();"}} | ||
}, | }, | ||
["note_member_first_declared_here"]={ | ["note_member_first_declared_here"]={ | ||
Line 6,082: | Line 6,082: | ||
[c]=o, | [c]=o, | ||
[m]={"fc50f62caafd",1495724379,"[coroutines] Diagnose when promise types fail to declare either return_void or return_value."}, | [m]={"fc50f62caafd",1495724379,"[coroutines] Diagnose when promise types fail to declare either return_void or return_value."}, | ||
[n]={{L, | [n]={{L,1635,"bool CoroutineStmtBuilder::makeOnFallthrough() {\n if (HasRVoid && HasRValue) {\n S.Diag(LRVoid.getRepresentativeDecl()->getLocation(), diag::note_member_first_declared_here) << LRVoid.getLookupName();"},{L,1638,"bool CoroutineStmtBuilder::makeOnFallthrough() {\n if (HasRVoid && HasRValue) {\n S.Diag(LRValue.getRepresentativeDecl()->getLocation(), diag::note_member_first_declared_here) << LRValue.getLookupName();"}} | ||
}, | }, | ||
["note_member_reference_arrow_from_operator_arrow"]={ | ["note_member_reference_arrow_from_operator_arrow"]={ | ||
Line 6,094: | Line 6,094: | ||
[c]=o, | [c]=o, | ||
[m]={"0c51de4ab1ae",1375292304,"Improve the diagnostic experience, including adding recovery, for"}, | [m]={"0c51de4ab1ae",1375292304,"Improve the diagnostic experience, including adding recovery, for"}, | ||
[n]={{K, | [n]={{K,7619,"ExprResult Sema::ActOnStartCXXMemberReference(Scope *S, Expr *Base, SourceLocation OpLoc, tok::TokenKind OpKind, ParsedType &ObjectType, bool &MayBePseudoDestructor) {\n // C++ [over.match.oper]p8:\n // [...] When operator->returns, the operator-> is applied to the value\n // returned, with the original second operand.\n if (OpKind == tok::arrow) {\n while (BaseType->isRecordType()) {\n if (Result.isInvalid()) {\n if (NoArrowOperatorFound) {\n if (Decl *CD = (CE ? CE->getCalleeDecl() : nullptr)) {\n Diag(CD->getBeginLoc(), diag::note_member_reference_arrow_from_operator_arrow);"}} | ||
}, | }, | ||
["note_member_synthesized_at"]={ | ["note_member_synthesized_at"]={ | ||
Line 6,106: | Line 6,106: | ||
[c]=o, | [c]=o, | ||
[m]={"26a807d37a67",1259616290,"When we\'re trying to define an implicit virtual destructor, make sure that we have a valid delete op..."}, | [m]={"26a807d37a67",1259616290,"When we\'re trying to define an implicit virtual destructor, make sure that we have a valid delete op..."}, | ||
[n]={{z, | [n]={{z,975,"/// Prints the current instantiation stack through a series of\n/// notes.\nvoid Sema::PrintInstantiationStack() {\n for (SmallVectorImpl<CodeSynthesisContext>::reverse_iterator Active = CodeSynthesisContexts.rbegin(), ActiveEnd = CodeSynthesisContexts.rend(); Active != ActiveEnd; ++Active, ++InstantiationIdx) {\n case CodeSynthesisContext::DefiningSynthesizedFunction: {\n if (DFK.isSpecialMember()) {\n Diags.Report(Active->PointOfInstantiation, diag::note_member_synthesized_at) << MD->isExplicitlyDefaulted() << DFK.asSpecialMember() << Context.getTagDeclType(MD->getParent());"}} | ||
}, | }, | ||
["note_memsize_comparison_cast_silence"]={ | ["note_memsize_comparison_cast_silence"]={ | ||
Line 6,118: | Line 6,118: | ||
[c]=o, | [c]=o, | ||
[m]={"b0869036c114",1400289198,"Tweak diagnostic wording for init list narrowing"}, | [m]={"b0869036c114",1400289198,"Tweak diagnostic wording for init list narrowing"}, | ||
[n]={{y, | [n]={{y,12175,"/// Takes the expression passed to the size_t parameter of functions\n/// such as memcmp, strncat, etc and warns if it\'s a comparison.\n///\n/// This is to catch typos like `if (memcmp(&a, &b, sizeof(a) > 0))`.\nstatic bool CheckMemorySizeofForComparison(Sema &S, const Expr *E, IdentifierInfo *FnName, SourceLocation FnLoc, SourceLocation RParenLoc) {\n S.Diag(SizeRange.getBegin(), diag::note_memsize_comparison_cast_silence) << FixItHint::CreateInsertion(SizeRange.getBegin(), \"(size_t)(\") << FixItHint::CreateInsertion(S.getLocForEndOfToken(SizeRange.getEnd()), \")\");"}} | ||
}, | }, | ||
["note_memsize_comparison_paren"]={ | ["note_memsize_comparison_paren"]={ | ||
Line 6,130: | Line 6,130: | ||
[c]=o, | [c]=o, | ||
[m]={"b0869036c114",1400289198,"Tweak diagnostic wording for init list narrowing"}, | [m]={"b0869036c114",1400289198,"Tweak diagnostic wording for init list narrowing"}, | ||
[n]={{y, | [n]={{y,12170,"/// Takes the expression passed to the size_t parameter of functions\n/// such as memcmp, strncat, etc and warns if it\'s a comparison.\n///\n/// This is to catch typos like `if (memcmp(&a, &b, sizeof(a) > 0))`.\nstatic bool CheckMemorySizeofForComparison(Sema &S, const Expr *E, IdentifierInfo *FnName, SourceLocation FnLoc, SourceLocation RParenLoc) {\n S.Diag(FnLoc, diag::note_memsize_comparison_paren) << FnName << FixItHint::CreateInsertion(S.getLocForEndOfToken(Size->getLHS()->getEndLoc()), \")\") << FixItHint::CreateRemoval(RParenLoc);"}} | ||
}, | }, | ||
["note_method_declared_at"]={ | ["note_method_declared_at"]={ | ||
Line 6,142: | Line 6,142: | ||
[c]=o, | [c]=o, | ||
[m]={"e5c1bda4d177",1288394405,"Improve diagnostics reporting of un-implemented"}, | [m]={"e5c1bda4d177",1288394405,"Improve diagnostics reporting of un-implemented"}, | ||
[n]={{E, | [n]={{E,303,"static void DiagnoseObjCImplementedDeprecations(Sema &S, const NamedDecl *ND, SourceLocation ImplLoc) {\n if (Availability != AR_Deprecated) {\n if (isa<ObjCMethodDecl>(ND)) {\n S.Diag(ND->getLocation(), diag::note_method_declared_at) << ND->getDeclName();"},{E,321,"static void DiagnoseObjCImplementedDeprecations(Sema &S, const NamedDecl *ND, SourceLocation ImplLoc) {\n if (isa<ObjCMethodDecl>(ND))\n S.Diag(ND->getLocation(), diag::note_method_declared_at) << ND->getDeclName();"},{E,2267,"static void WarnUndefinedMethod(Sema &S, ObjCImplDecl *Impl, ObjCMethodDecl *method, bool &IncompleteImpl, unsigned DiagID, NamedDecl *NeededFor = nullptr) {\n if (MethodLoc.isValid())\n S.Diag(MethodLoc, diag::note_method_declared_at) << method;"},{E,2666,"/// WarnExactTypedMethods - This routine issues a warning if method\n/// implementation declaration matches exactly that of its declaration.\nvoid Sema::WarnExactTypedMethods(ObjCMethodDecl *ImpMethodDecl, ObjCMethodDecl *MethodDecl, bool IsProtocolMethodDecl) {\n if (match) {\n Diag(MethodDecl->getLocation(), diag::note_method_declared_at) << MethodDecl->getDeclName();"},{s,1195,"static bool HelperToDiagnoseMismatchedMethodsInGlobalPool(Sema &S, SourceLocation AtLoc, SourceLocation LParenLoc, SourceLocation RParenLoc, ObjCMethodDecl *Method, ObjCMethodList &MethList) {\n for (M = M->getNext(); M; M = M->getNext()) {\n if (!S.MatchTwoMethodDeclarations(Method, MatchingMethodDecl, Sema::MMS_loose)) {\n if (!Warned) {\n S.Diag(Method->getLocation(), diag::note_method_declared_at) << Method->getDeclName();"},{s,1198,"static bool HelperToDiagnoseMismatchedMethodsInGlobalPool(Sema &S, SourceLocation AtLoc, SourceLocation LParenLoc, SourceLocation RParenLoc, ObjCMethodDecl *Method, ObjCMethodList &MethList) {\n for (M = M->getNext(); M; M = M->getNext()) {\n if (!S.MatchTwoMethodDeclarations(Method, MatchingMethodDecl, Sema::MMS_loose)) {\n S.Diag(MatchingMethodDecl->getLocation(), diag::note_method_declared_at) << MatchingMethodDecl->getDeclName();"},{s,2574,"/// Diagnose use of %s directive in an NSString which is being passed\n/// as formatting string to formatting method.\nstatic void DiagnoseCStringFormatDirectiveInObjCAPI(Sema &S, ObjCMethodDecl *Method, Selector Sel, Expr **Args, unsigned NumArgs) {\n if (ObjCStringLiteral *OSL = dyn_cast<ObjCStringLiteral>(FormatExpr->IgnoreParenImpCasts())) {\n if (S.FormatStringHasSArg(FormatString)) {\n if (Method)\n S.Diag(Method->getLocation(), diag::note_method_declared_at) << Method->getDeclName();"},{s,2719,"/// \\param ReceiverType The type of the object receiving the\n/// message. When \\p ReceiverTypeInfo is non-NULL, this is the same\n/// type as that refers to. For a superclass send, this is the type of\n/// the superclass.\n///\n/// \\param SuperLoc The location of the \"super\" keyword in a\n/// superclass message.\n///\n/// \\param Sel The selector to which the message is being sent.\n///\n/// \\param Method The method that this class message is invoking, if\n/// already known.\n///\n/// \\param LBracLoc The location of the opening square bracket \']\'.\n///\n/// \\param RBracLoc The location of the closing square bracket \']\'.\n///\n/// \\param ArgsIn The message arguments.\nExprResult Sema::BuildClassMessage(TypeSourceInfo *ReceiverTypeInfo, QualType ReceiverType, SourceLocation SuperLoc, Selector Sel, ObjCMethodDecl *Method, SourceLocation LBracLoc, ArrayRef<SourceLocation> SelectorLocs, SourceLocation RBracLoc, MultiExprArg ArgsIn, bool isImplicit) {\n // Warn about explicit call of +initialize on its own class. But not on \'super\'.\n if (Method && Method->getMethodFamily() == OMF_initialize) {\n if (!SuperLoc.isValid()) {\n if (ID == Class) {\n Diag(Method->getLocation(), diag::note_method_declared_at) << Method->getDeclName();"},{s,2727,"/// \\param ReceiverType The type of the object receiving the\n/// message. When \\p ReceiverTypeInfo is non-NULL, this is the same\n/// type as that refers to. For a superclass send, this is the type of\n/// the superclass.\n///\n/// \\param SuperLoc The location of the \"super\" keyword in a\n/// superclass message.\n///\n/// \\param Sel The selector to which the message is being sent.\n///\n/// \\param Method The method that this class message is invoking, if\n/// already known.\n///\n/// \\param LBracLoc The location of the opening square bracket \']\'.\n///\n/// \\param RBracLoc The location of the closing square bracket \']\'.\n///\n/// \\param ArgsIn The message arguments.\nExprResult Sema::BuildClassMessage(TypeSourceInfo *ReceiverTypeInfo, QualType ReceiverType, SourceLocation SuperLoc, Selector Sel, ObjCMethodDecl *Method, SourceLocation LBracLoc, ArrayRef<SourceLocation> SelectorLocs, SourceLocation RBracLoc, MultiExprArg ArgsIn, bool isImplicit) {\n // Warn about explicit call of +initialize on its own class. But not on \'super\'.\n if (Method && Method->getMethodFamily() == OMF_initialize) {\n if (!SuperLoc.isValid()) {\n } else if (ObjCMethodDecl *CurMeth = getCurMethodDecl()) {\n // [super initialize] is allowed only within an +initialize implementation\n if (CurMeth->getMethodFamily() != OMF_initialize) {\n Diag(Method->getLocation(), diag::note_method_declared_at) << Method->getDeclName();"},{s,2729,"/// \\param ReceiverType The type of the object receiving the\n/// message. When \\p ReceiverTypeInfo is non-NULL, this is the same\n/// type as that refers to. For a superclass send, this is the type of\n/// the superclass.\n///\n/// \\param SuperLoc The location of the \"super\" keyword in a\n/// superclass message.\n///\n/// \\param Sel The selector to which the message is being sent.\n///\n/// \\param Method The method that this class message is invoking, if\n/// already known.\n///\n/// \\param LBracLoc The location of the opening square bracket \']\'.\n///\n/// \\param RBracLoc The location of the closing square bracket \']\'.\n///\n/// \\param ArgsIn The message arguments.\nExprResult Sema::BuildClassMessage(TypeSourceInfo *ReceiverTypeInfo, QualType ReceiverType, SourceLocation SuperLoc, Selector Sel, ObjCMethodDecl *Method, SourceLocation LBracLoc, ArrayRef<SourceLocation> SelectorLocs, SourceLocation RBracLoc, MultiExprArg ArgsIn, bool isImplicit) {\n // Warn about explicit call of +initialize on its own class. But not on \'super\'.\n if (Method && Method->getMethodFamily() == OMF_initialize) {\n if (!SuperLoc.isValid()) {\n } else if (ObjCMethodDecl *CurMeth = getCurMethodDecl()) {\n // [super initialize] is allowed only within an +initialize implementation\n if (CurMeth->getMethodFamily() != OMF_initialize) {\n Diag(CurMeth->getLocation(), diag::note_method_declared_at) << CurMeth->getDeclName();"},{s,2988,"/// Build an Objective-C instance message expression.\n///\n/// This routine takes care of both normal instance messages and\n/// instance messages to the superclass instance.\n///\n/// \\param Receiver The expression that computes the object that will\n/// receive this message. This may be empty, in which case we are\n/// sending to the superclass instance and \\p SuperLoc must be a valid\n/// source location.\n///\n/// \\param ReceiverType The (static) type of the object receiving the\n/// message. When a \\p Receiver expression is provided, this is the\n/// same type as that expression. For a superclass instance send, this\n/// is a pointer to the type of the superclass.\n///\n/// \\param SuperLoc The location of the \"super\" keyword in a\n/// superclass instance message.\n///\n/// \\param Sel The selector to which the message is being sent.\n///\n/// \\param Method The method that this instance message is invoking, if\n/// already known.\n///\n/// \\param LBracLoc The location of the opening square bracket \']\'.\n///\n/// \\param RBracLoc The location of the closing square bracket \']\'.\n///\n/// \\param ArgsIn The message arguments.\nExprResult Sema::BuildInstanceMessage(Expr *Receiver, QualType ReceiverType, SourceLocation SuperLoc, Selector Sel, ObjCMethodDecl *Method, SourceLocation LBracLoc, ArrayRef<SourceLocation> SelectorLocs, SourceLocation RBracLoc, MultiExprArg ArgsIn, bool isImplicit) {\n if (!Method) {\n if (receiverIsIdLike || ReceiverType->isBlockPointerType() || (Receiver && Context.isObjCNSObjectType(Receiver->getType()))) {\n } else if (ReceiverType->isObjCClassOrClassKindOfType() || ReceiverType->isObjCQualifiedClassType()) {\n // Handle messages to Class.\n // We allow sending a message to a qualified Class (\"Class<foo>\"), which\n // is ok as long as one of the protocols implements the selector (if not,\n // warn).\n if (!ReceiverType->isObjCClassOrClassKindOfType()) {\n if (!Method) {\n // warn if instance method found for a Class message.\n if (Method && !isMethodDeclaredInRootProtocol(*this, Method)) {\n Diag(Method->getLocation(), diag::note_method_declared_at) << Method->getDeclName();"},{s,3298,"/// Build an Objective-C instance message expression.\n///\n/// This routine takes care of both normal instance messages and\n/// instance messages to the superclass instance.\n///\n/// \\param Receiver The expression that computes the object that will\n/// receive this message. This may be empty, in which case we are\n/// sending to the superclass instance and \\p SuperLoc must be a valid\n/// source location.\n///\n/// \\param ReceiverType The (static) type of the object receiving the\n/// message. When a \\p Receiver expression is provided, this is the\n/// same type as that expression. For a superclass instance send, this\n/// is a pointer to the type of the superclass.\n///\n/// \\param SuperLoc The location of the \"super\" keyword in a\n/// superclass instance message.\n///\n/// \\param Sel The selector to which the message is being sent.\n///\n/// \\param Method The method that this instance message is invoking, if\n/// already known.\n///\n/// \\param LBracLoc The location of the opening square bracket \']\'.\n///\n/// \\param RBracLoc The location of the closing square bracket \']\'.\n///\n/// \\param ArgsIn The message arguments.\nExprResult Sema::BuildInstanceMessage(Expr *Receiver, QualType ReceiverType, SourceLocation SuperLoc, Selector Sel, ObjCMethodDecl *Method, SourceLocation LBracLoc, ArrayRef<SourceLocation> SelectorLocs, SourceLocation RBracLoc, MultiExprArg ArgsIn, bool isImplicit) {\n // In ARC, forbid the user from sending messages to\n // retain/release/autorelease/dealloc/retainCount explicitly.\n if (getLangOpts().ObjCAutoRefCount) {\n case OMF_performSelector:\n if (Method && NumArgs >= 1) {\n if (const auto *SelExp = dyn_cast<ObjCSelectorExpr>(Args[0]->IgnoreParens())) {\n if (SelMethod) {\n case OMF_init:\n // Issue error, unless ns_returns_not_retained.\n if (!SelMethod->hasAttr<NSReturnsNotRetainedAttr>()) {\n Diag(SelMethod->getLocation(), diag::note_method_declared_at) << SelMethod->getDeclName();"},{s,3308,"/// Build an Objective-C instance message expression.\n///\n/// This routine takes care of both normal instance messages and\n/// instance messages to the superclass instance.\n///\n/// \\param Receiver The expression that computes the object that will\n/// receive this message. This may be empty, in which case we are\n/// sending to the superclass instance and \\p SuperLoc must be a valid\n/// source location.\n///\n/// \\param ReceiverType The (static) type of the object receiving the\n/// message. When a \\p Receiver expression is provided, this is the\n/// same type as that expression. For a superclass instance send, this\n/// is a pointer to the type of the superclass.\n///\n/// \\param SuperLoc The location of the \"super\" keyword in a\n/// superclass instance message.\n///\n/// \\param Sel The selector to which the message is being sent.\n///\n/// \\param Method The method that this instance message is invoking, if\n/// already known.\n///\n/// \\param LBracLoc The location of the opening square bracket \']\'.\n///\n/// \\param RBracLoc The location of the closing square bracket \']\'.\n///\n/// \\param ArgsIn The message arguments.\nExprResult Sema::BuildInstanceMessage(Expr *Receiver, QualType ReceiverType, SourceLocation SuperLoc, Selector Sel, ObjCMethodDecl *Method, SourceLocation LBracLoc, ArrayRef<SourceLocation> SelectorLocs, SourceLocation RBracLoc, MultiExprArg ArgsIn, bool isImplicit) {\n // In ARC, forbid the user from sending messages to\n // retain/release/autorelease/dealloc/retainCount explicitly.\n if (getLangOpts().ObjCAutoRefCount) {\n case OMF_performSelector:\n if (Method && NumArgs >= 1) {\n if (const auto *SelExp = dyn_cast<ObjCSelectorExpr>(Args[0]->IgnoreParens())) {\n if (SelMethod) {\n default:\n // +0 call. OK. unless ns_returns_retained.\n if (SelMethod->hasAttr<NSReturnsRetainedAttr>()) {\n Diag(SelMethod->getLocation(), diag::note_method_declared_at) << SelMethod->getDeclName();"},{"clang/lib/Sema/SemaPseudoObject.cpp",1239,"bool ObjCSubscriptOpBuilder::findAtIndexGetter() {\n if (AtIndexGetter) {\n if (!R->isObjCObjectPointerType()) {\n S.Diag(AtIndexGetter->getLocation(), diag::note_method_declared_at) << AtIndexGetter->getDeclName();"}} | ||
}, | }, | ||
["note_method_return_type_change"]={ | ["note_method_return_type_change"]={ | ||
Line 6,154: | Line 6,154: | ||
[c]=o, | [c]=o, | ||
[m]={"b248ca55489e",1373561286,"ObjectiveC arc[qoi]: When due to change of certain methods\'"}, | [m]={"b248ca55489e",1373561286,"ObjectiveC arc[qoi]: When due to change of certain methods\'"}, | ||
[n]={{D, | [n]={{D,6970,"void InitializationSequence::PrintInitLocationNote(Sema &S, const InitializedEntity &Entity) {\n if (Entity.isParamOrTemplateParamKind() && Entity.getDecl()) {\n } else if (Entity.getKind() == InitializedEntity::EK_RelatedResult && Entity.getMethodDecl())\n S.Diag(Entity.getMethodDecl()->getLocation(), diag::note_method_return_type_change) << Entity.getMethodDecl()->getDeclName();"}} | ||
}, | }, | ||
["note_method_sent_forward_class"]={ | ["note_method_sent_forward_class"]={ | ||
Line 6,166: | Line 6,166: | ||
[c]=o, | [c]=o, | ||
[m]={"5276014db2b4",1241826349,"We want to diagnose sending message to a forward class"}, | [m]={"5276014db2b4",1241826349,"We want to diagnose sending message to a forward class"}, | ||
[n]={{s, | [n]={{s,2670,"/// \\param ReceiverType The type of the object receiving the\n/// message. When \\p ReceiverTypeInfo is non-NULL, this is the same\n/// type as that refers to. For a superclass send, this is the type of\n/// the superclass.\n///\n/// \\param SuperLoc The location of the \"super\" keyword in a\n/// superclass message.\n///\n/// \\param Sel The selector to which the message is being sent.\n///\n/// \\param Method The method that this class message is invoking, if\n/// already known.\n///\n/// \\param LBracLoc The location of the opening square bracket \']\'.\n///\n/// \\param RBracLoc The location of the closing square bracket \']\'.\n///\n/// \\param ArgsIn The message arguments.\nExprResult Sema::BuildClassMessage(TypeSourceInfo *ReceiverTypeInfo, QualType ReceiverType, SourceLocation SuperLoc, Selector Sel, ObjCMethodDecl *Method, SourceLocation LBracLoc, ArrayRef<SourceLocation> SelectorLocs, SourceLocation RBracLoc, MultiExprArg ArgsIn, bool isImplicit) {\n // Find the method we are messaging.\n if (!Method) {\n if (RequireCompleteType(Loc, Context.getObjCInterfaceType(Class), (getLangOpts().ObjCAutoRefCount ? diag::err_arc_receiver_forward_class : diag::warn_receiver_forward_class), TypeRange)) {\n if (Method && !getLangOpts().ObjCAutoRefCount)\n Diag(Method->getLocation(), diag::note_method_sent_forward_class) << Method->getDeclName();"}} | ||
}, | }, | ||
["note_misaligned_member_used_here"]={ | ["note_misaligned_member_used_here"]={ | ||
Line 6,178: | Line 6,178: | ||
[c]=o, | [c]=o, | ||
[m]={db,1625925174,eb}, | [m]={db,1625925174,eb}, | ||
[n]={{y, | [n]={{y,6603,"// 16 byte ByVal alignment not due to a vector member is not honoured by XL\n// on AIX. Emit a warning here that users are generating binary incompatible\n// code to be safe.\n// Here we try to get information about the alignment of the struct member\n// from the struct passed to the caller function. We only warn when the struct\n// is passed byval, hence the series of checks and early returns if we are a not\n// passing a struct byval.\nvoid Sema::checkAIXMemberAlignment(SourceLocation Loc, const Expr *Arg) {\n for (const FieldDecl *FD : ArgType->castAs<RecordType>()->getDecl()->fields()) {\n if (const auto *AA = FD->getAttr<AlignedAttr>()) {\n if (Alignment.getQuantity() == 16) {\n Diag(Loc, diag::note_misaligned_member_used_here) << PD;"}} | ||
}, | }, | ||
["note_misplaced_ellipsis_vararg_add_comma"]={ | ["note_misplaced_ellipsis_vararg_add_comma"]={ | ||
Line 6,190: | Line 6,190: | ||
[c]=Q, | [c]=Q, | ||
[m]={"36ee9fb21957",1407799823,"Reject varargs \'...\' in function prototype if there are more parameters after"}, | [m]={"36ee9fb21957",1407799823,"Reject varargs \'...\' in function prototype if there are more parameters after"}, | ||
[n]={{"clang/lib/Parse/ParseDecl.cpp", | [n]={{"clang/lib/Parse/ParseDecl.cpp",7518,"/// ParseParameterDeclarationClause - Parse a (possibly empty) parameter-list\n/// after the opening parenthesis. This function will not parse a K&R-style\n/// identifier list.\n///\n/// DeclContext is the context of the declarator being parsed. If FirstArgAttrs\n/// is non-null, then the caller parsed those attributes immediately after the\n/// open paren - they will be applied to the DeclSpec of the first parameter.\n///\n/// After returning, ParamInfo will hold the parsed parameters. EllipsisLoc will\n/// be the location of the ellipsis, if any was parsed.\n///\n/// parameter-type-list: [C99 6.7.5]\n/// parameter-list\n/// parameter-list \',\' \'...\'\n/// [C++] parameter-list \'...\'\n///\n/// parameter-list: [C99 6.7.5]\n/// parameter-declaration\n/// parameter-list \',\' parameter-declaration\n///\n/// parameter-declaration: [C99 6.7.5]\n/// declaration-specifiers declarator\n/// [C++] declaration-specifiers declarator \'=\' assignment-expression\n/// [C++11] initializer-clause\n/// [GNU] declaration-specifiers declarator attributes\n/// declaration-specifiers abstract-declarator[opt]\n/// [C++] declaration-specifiers abstract-declarator[opt]\n/// \'=\' assignment-expression\n/// [GNU] declaration-specifiers abstract-declarator[opt] attributes\n/// [C++11] attribute-specifier-seq parameter-declaration\n///\nvoid Parser::ParseParameterDeclarationClause(DeclaratorContext DeclaratorCtx, ParsedAttributes &FirstArgAttrs, SmallVectorImpl<DeclaratorChunk::ParamInfo> &ParamInfo, SourceLocation &EllipsisLoc, bool IsACXXFunctionDeclaration) {\n do {\n if (TryConsumeToken(tok::ellipsis, EllipsisLoc)) {\n if (!getLangOpts().CPlusPlus) {\n } else if (ParmDeclarator.getEllipsisLoc().isValid() || Actions.containsUnexpandedParameterPacks(ParmDeclarator)) {\n Diag(EllipsisLoc, diag::note_misplaced_ellipsis_vararg_add_comma) << FixItHint::CreateInsertion(EllipsisLoc, \", \");"}} | ||
}, | }, | ||
["note_misplaced_ellipsis_vararg_add_ellipsis"]={ | ["note_misplaced_ellipsis_vararg_add_ellipsis"]={ | ||
Line 6,202: | Line 6,202: | ||
[c]=Q, | [c]=Q, | ||
[m]={"36ee9fb21957",1407799823,"Reject varargs \'...\' in function prototype if there are more parameters after"}, | [m]={"36ee9fb21957",1407799823,"Reject varargs \'...\' in function prototype if there are more parameters after"}, | ||
[n]={{"clang/lib/Parse/ParseDecl.cpp", | [n]={{"clang/lib/Parse/ParseDecl.cpp",7513,"/// ParseParameterDeclarationClause - Parse a (possibly empty) parameter-list\n/// after the opening parenthesis. This function will not parse a K&R-style\n/// identifier list.\n///\n/// DeclContext is the context of the declarator being parsed. If FirstArgAttrs\n/// is non-null, then the caller parsed those attributes immediately after the\n/// open paren - they will be applied to the DeclSpec of the first parameter.\n///\n/// After returning, ParamInfo will hold the parsed parameters. EllipsisLoc will\n/// be the location of the ellipsis, if any was parsed.\n///\n/// parameter-type-list: [C99 6.7.5]\n/// parameter-list\n/// parameter-list \',\' \'...\'\n/// [C++] parameter-list \'...\'\n///\n/// parameter-list: [C99 6.7.5]\n/// parameter-declaration\n/// parameter-list \',\' parameter-declaration\n///\n/// parameter-declaration: [C99 6.7.5]\n/// declaration-specifiers declarator\n/// [C++] declaration-specifiers declarator \'=\' assignment-expression\n/// [C++11] initializer-clause\n/// [GNU] declaration-specifiers declarator attributes\n/// declaration-specifiers abstract-declarator[opt]\n/// [C++] declaration-specifiers abstract-declarator[opt]\n/// \'=\' assignment-expression\n/// [GNU] declaration-specifiers abstract-declarator[opt] attributes\n/// [C++11] attribute-specifier-seq parameter-declaration\n///\nvoid Parser::ParseParameterDeclarationClause(DeclaratorContext DeclaratorCtx, ParsedAttributes &FirstArgAttrs, SmallVectorImpl<DeclaratorChunk::ParamInfo> &ParamInfo, SourceLocation &EllipsisLoc, bool IsACXXFunctionDeclaration) {\n do {\n if (TryConsumeToken(tok::ellipsis, EllipsisLoc)) {\n if (!getLangOpts().CPlusPlus) {\n } else if (ParmDeclarator.getEllipsisLoc().isValid() || Actions.containsUnexpandedParameterPacks(ParmDeclarator)) {\n if (ParmEllipsis.isValid()) {\n } else {\n Diag(ParmDeclarator.getIdentifierLoc(), diag::note_misplaced_ellipsis_vararg_add_ellipsis) << FixItHint::CreateInsertion(ParmDeclarator.getIdentifierLoc(), \"...\") << !ParmDeclarator.hasName();"}} | ||
}, | }, | ||
["note_misplaced_ellipsis_vararg_existing_ellipsis"]={ | ["note_misplaced_ellipsis_vararg_existing_ellipsis"]={ | ||
Line 6,214: | Line 6,214: | ||
[c]=Q, | [c]=Q, | ||
[m]={"36ee9fb21957",1407799823,"Reject varargs \'...\' in function prototype if there are more parameters after"}, | [m]={"36ee9fb21957",1407799823,"Reject varargs \'...\' in function prototype if there are more parameters after"}, | ||
[n]={{"clang/lib/Parse/ParseDecl.cpp", | [n]={{"clang/lib/Parse/ParseDecl.cpp",7510,"/// ParseParameterDeclarationClause - Parse a (possibly empty) parameter-list\n/// after the opening parenthesis. This function will not parse a K&R-style\n/// identifier list.\n///\n/// DeclContext is the context of the declarator being parsed. If FirstArgAttrs\n/// is non-null, then the caller parsed those attributes immediately after the\n/// open paren - they will be applied to the DeclSpec of the first parameter.\n///\n/// After returning, ParamInfo will hold the parsed parameters. EllipsisLoc will\n/// be the location of the ellipsis, if any was parsed.\n///\n/// parameter-type-list: [C99 6.7.5]\n/// parameter-list\n/// parameter-list \',\' \'...\'\n/// [C++] parameter-list \'...\'\n///\n/// parameter-list: [C99 6.7.5]\n/// parameter-declaration\n/// parameter-list \',\' parameter-declaration\n///\n/// parameter-declaration: [C99 6.7.5]\n/// declaration-specifiers declarator\n/// [C++] declaration-specifiers declarator \'=\' assignment-expression\n/// [C++11] initializer-clause\n/// [GNU] declaration-specifiers declarator attributes\n/// declaration-specifiers abstract-declarator[opt]\n/// [C++] declaration-specifiers abstract-declarator[opt]\n/// \'=\' assignment-expression\n/// [GNU] declaration-specifiers abstract-declarator[opt] attributes\n/// [C++11] attribute-specifier-seq parameter-declaration\n///\nvoid Parser::ParseParameterDeclarationClause(DeclaratorContext DeclaratorCtx, ParsedAttributes &FirstArgAttrs, SmallVectorImpl<DeclaratorChunk::ParamInfo> &ParamInfo, SourceLocation &EllipsisLoc, bool IsACXXFunctionDeclaration) {\n do {\n if (TryConsumeToken(tok::ellipsis, EllipsisLoc)) {\n if (!getLangOpts().CPlusPlus) {\n } else if (ParmDeclarator.getEllipsisLoc().isValid() || Actions.containsUnexpandedParameterPacks(ParmDeclarator)) {\n if (ParmEllipsis.isValid()) {\n Diag(ParmEllipsis, diag::note_misplaced_ellipsis_vararg_existing_ellipsis);"}} | ||
}, | }, | ||
["note_missing_end_of_definition_before"]={ | ["note_missing_end_of_definition_before"]={ | ||
Line 6,226: | Line 6,226: | ||
[c]=Q, | [c]=Q, | ||
[m]={"da35e963bc57",1383972771,"Try to recover a bit better if a close brace is missing from the end of a class"}, | [m]={"da35e963bc57",1383972771,"Try to recover a bit better if a close brace is missing from the end of a class"}, | ||
[n]={{"clang/lib/Parse/ParseDeclCXX.cpp", | [n]={{"clang/lib/Parse/ParseDeclCXX.cpp",3691,"void Parser::DiagnoseUnexpectedNamespace(NamedDecl *D) {\n Diag(Tok.getLocation(), diag::note_missing_end_of_definition_before) << D;"}} | ||
}, | }, | ||
["note_missing_selector_name"]={ | ["note_missing_selector_name"]={ | ||
Line 6,238: | Line 6,238: | ||
[c]=Q, | [c]=Q, | ||
[m]={"84f498433116",1347923399,"objective-C: improve on warnings about misplacement of method"}, | [m]={"84f498433116",1347923399,"objective-C: improve on warnings about misplacement of method"}, | ||
[n]={{Kb, | [n]={{Kb,1510,"/// objc-method-decl:\n/// objc-selector\n/// objc-keyword-selector objc-parmlist[opt]\n/// objc-type-name objc-selector\n/// objc-type-name objc-keyword-selector objc-parmlist[opt]\n///\n/// objc-keyword-selector:\n/// objc-keyword-decl\n/// objc-keyword-selector objc-keyword-decl\n///\n/// objc-keyword-decl:\n/// objc-selector \':\' objc-type-name objc-keyword-attributes[opt] identifier\n/// objc-selector \':\' objc-keyword-attributes[opt] identifier\n/// \':\' objc-type-name objc-keyword-attributes[opt] identifier\n/// \':\' objc-keyword-attributes[opt] identifier\n///\n/// objc-parmlist:\n/// objc-parms objc-ellipsis[opt]\n///\n/// objc-parms:\n/// objc-parms , parameter-declaration\n///\n/// objc-ellipsis:\n/// , ...\n///\n/// objc-keyword-attributes: [OBJC2]\n/// __attribute__((unused))\n///\nDecl *Parser::ParseObjCMethodDecl(SourceLocation mLoc, tok::TokenKind mType, tok::ObjCKeywordKind MethodImplKind, bool MethodDefinition) {\n while (true) {\n if (!SelIdent) {\n if (PP.getLocForEndOfToken(ArgInfo.NameLoc) == ColonLoc) {\n Diag(ArgInfo.NameLoc, diag::note_missing_selector_name) << ArgInfo.Name;"}} | ||
}, | }, | ||
["note_mmap_add_framework_keyword"]={ | ["note_mmap_add_framework_keyword"]={ | ||
Line 6,250: | Line 6,250: | ||
[c]=R, | [c]=R, | ||
[m]={"9f6020bcc522",1527816378,"[Modules] Warning for module declarations lacking \'framework\' qualifier"}, | [m]={"9f6020bcc522",1527816378,"[Modules] Warning for module declarations lacking \'framework\' qualifier"}, | ||
[n]={{hb, | [n]={{hb,2480,"/// Parse a header declaration.\n///\n/// header-declaration:\n/// \'textual\'[opt] \'header\' string-literal\n/// \'private\' \'textual\'[opt] \'header\' string-literal\n/// \'exclude\' \'header\' string-literal\n/// \'umbrella\' \'header\' string-literal\n///\n/// FIXME: Support \'private textual header\'.\nvoid ModuleMapParser::parseHeaderDecl(MMToken::TokenKind LeadingToken, SourceLocation LeadingLoc) {\n if (NeedsFramework)\n Diags.Report(CurrModuleDeclLoc, diag::note_mmap_add_framework_keyword) << ActiveModule->getFullModuleName() << FixItHint::CreateReplacement(CurrModuleDeclLoc, \"framework module\");"}} | ||
}, | }, | ||
["note_mmap_lbrace_match"]={ | ["note_mmap_lbrace_match"]={ | ||
Line 6,262: | Line 6,262: | ||
[c]=R, | [c]=R, | ||
[m]={"718292f260bf",1321038628,"Introduce basic support for parsing module map files."}, | [m]={"718292f260bf",1321038628,"Introduce basic support for parsing module map files."}, | ||
[n]={{hb, | [n]={{hb,2057,"/// Parse a module declaration.\n///\n/// module-declaration:\n/// \'extern\' \'module\' module-id string-literal\n/// \'explicit\'[opt] \'framework\'[opt] \'module\' module-id attributes[opt]\n/// { module-member* }\n///\n/// module-member:\n/// requires-declaration\n/// header-declaration\n/// submodule-declaration\n/// export-declaration\n/// export-as-declaration\n/// link-declaration\n///\n/// submodule-declaration:\n/// module-declaration\n/// inferred-submodule-declaration\nvoid ModuleMapParser::parseModuleDecl() {\n if (Module *Existing = Map.lookupModuleQualified(ModuleName, ActiveModule)) {\n if (LoadedFromASTFile || Inferred || PartOfFramework || ParsedAsMainInput) {\n if (Tok.is(MMToken::RBrace))\n else {\n Diags.Report(LBraceLoc, diag::note_mmap_lbrace_match);"},{hb,2198,"/// Parse a module declaration.\n///\n/// module-declaration:\n/// \'extern\' \'module\' module-id string-literal\n/// \'explicit\'[opt] \'framework\'[opt] \'module\' module-id attributes[opt]\n/// { module-member* }\n///\n/// module-member:\n/// requires-declaration\n/// header-declaration\n/// submodule-declaration\n/// export-declaration\n/// export-as-declaration\n/// link-declaration\n///\n/// submodule-declaration:\n/// module-declaration\n/// inferred-submodule-declaration\nvoid ModuleMapParser::parseModuleDecl() {\n if (Tok.is(MMToken::RBrace))\n else {\n Diags.Report(LBraceLoc, diag::note_mmap_lbrace_match);"},{hb,2471,"/// Parse a header declaration.\n///\n/// header-declaration:\n/// \'textual\'[opt] \'header\' string-literal\n/// \'private\' \'textual\'[opt] \'header\' string-literal\n/// \'exclude\' \'header\' string-literal\n/// \'umbrella\' \'header\' string-literal\n///\n/// FIXME: Support \'private textual header\'.\nvoid ModuleMapParser::parseHeaderDecl(MMToken::TokenKind LeadingToken, SourceLocation LeadingLoc) {\n // If we were given stat information, parse it so we can skip looking for\n // the file.\n if (Tok.is(MMToken::LBrace)) {\n if (Tok.is(MMToken::RBrace))\n else {\n Diags.Report(LBraceLoc, diag::note_mmap_lbrace_match);"},{hb,2954,"/// Parse an inferred module declaration (wildcard modules).\n///\n/// module-declaration:\n/// \'explicit\'[opt] \'framework\'[opt] \'module\' * attributes[opt]\n/// { inferred-module-member* }\n///\n/// inferred-module-member:\n/// \'export\' \'*\'\n/// \'exclude\' identifier\nvoid ModuleMapParser::parseInferredModuleDecl(bool Framework, bool Explicit) {\n if (Tok.is(MMToken::RBrace))\n else {\n Diags.Report(LBraceLoc, diag::note_mmap_lbrace_match);"}} | ||
}, | }, | ||
["note_mmap_lsquare_match"]={ | ["note_mmap_lsquare_match"]={ | ||
Line 6,274: | Line 6,274: | ||
[c]=R, | [c]=R, | ||
[m]={"a686e1b05df9",1327693953,"Introduce module attributes into the module map grammar, along with a"}, | [m]={"a686e1b05df9",1327693953,"Introduce module attributes into the module map grammar, along with a"}, | ||
[n]={{hb, | [n]={{hb,3022,"/// Parse optional attributes.\n///\n/// attributes:\n/// attribute attributes\n/// attribute\n///\n/// attribute:\n/// [ identifier ]\n///\n/// \\param Attrs Will be filled in with the parsed attributes.\n///\n/// \\returns true if an error occurred, false otherwise.\nbool ModuleMapParser::parseOptionalAttributes(Attributes &Attrs) {\n while (Tok.is(MMToken::LSquare)) {\n // Consume the \']\'.\n if (!Tok.is(MMToken::RSquare)) {\n Diags.Report(LSquareLoc, diag::note_mmap_lsquare_match);"}} | ||
}, | }, | ||
["note_mmap_prev_definition"]={ | ["note_mmap_prev_definition"]={ | ||
Line 6,286: | Line 6,286: | ||
[c]=R, | [c]=R, | ||
[m]={"718292f260bf",1321038628,"Introduce basic support for parsing module map files."}, | [m]={"718292f260bf",1321038628,"Introduce basic support for parsing module map files."}, | ||
[n]={{hb, | [n]={{hb,2069,"/// Parse a module declaration.\n///\n/// module-declaration:\n/// \'extern\' \'module\' module-id string-literal\n/// \'explicit\'[opt] \'framework\'[opt] \'module\' module-id attributes[opt]\n/// { module-member* }\n///\n/// module-member:\n/// requires-declaration\n/// header-declaration\n/// submodule-declaration\n/// export-declaration\n/// export-as-declaration\n/// link-declaration\n///\n/// submodule-declaration:\n/// module-declaration\n/// inferred-submodule-declaration\nvoid ModuleMapParser::parseModuleDecl() {\n if (Module *Existing = Map.lookupModuleQualified(ModuleName, ActiveModule)) {\n if (!Existing->Parent && Map.mayShadowNewModule(Existing)) {\n } else {\n Diags.Report(Existing->DefinitionLoc, diag::note_mmap_prev_definition);"},{hb,2839,"/// Parse an inferred module declaration (wildcard modules).\n///\n/// module-declaration:\n/// \'explicit\'[opt] \'framework\'[opt] \'module\' * attributes[opt]\n/// { inferred-module-member* }\n///\n/// inferred-module-member:\n/// \'export\' \'*\'\n/// \'exclude\' identifier\nvoid ModuleMapParser::parseInferredModuleDecl(bool Framework, bool Explicit) {\n if (ActiveModule) {\n // Check for redefinition of an inferred module.\n if (!Failed && ActiveModule->InferSubmodules) {\n if (ActiveModule->InferredSubmoduleLoc.isValid())\n Diags.Report(ActiveModule->InferredSubmoduleLoc, diag::note_mmap_prev_definition);"}} | ||
}, | }, | ||
["note_mmap_rename_top_level_private_module"]={ | ["note_mmap_rename_top_level_private_module"]={ | ||
Line 6,298: | Line 6,298: | ||
[c]=R, | [c]=R, | ||
[m]={"2972991969b6",1513911210,"[Modules] Change private modules rules and warnings"}, | [m]={"2972991969b6",1513911210,"[Modules] Change private modules rules and warnings"}, | ||
[n]={{hb, | [n]={{hb,1835,"/// Private modules are canonicalized as Foo_Private. Clang provides extra\n/// module map search logic to find the appropriate private module when PCH\n/// is used with implicit module maps. Warn when private modules are written\n/// in other ways (FooPrivate and Foo.Private), providing notes and fixits.\nvoid ModuleMapParser::diagnosePrivateModules(SourceLocation ExplicitLoc, SourceLocation FrameworkLoc) {\n auto GenNoteAndFixIt = [&](StringRef BadName, StringRef Canonical, const Module *M, SourceRange ReplLoc) {\n auto D = Diags.Report(ActiveModule->DefinitionLoc, diag::note_mmap_rename_top_level_private_module);"}} | ||
}, | }, | ||
["note_module_cache_path"]={ | ["note_module_cache_path"]={ | ||
Line 6,310: | Line 6,310: | ||
[c]=Wb, | [c]=Wb, | ||
[m]={"940e80502e57",1368224113,"[Modules] When things go horribly wrong when reading a module, point at the module cache."}, | [m]={"940e80502e57",1368224113,"[Modules] When things go horribly wrong when reading a module, point at the module cache."}, | ||
[n]={{Ub, | [n]={{Ub,1293,"void ASTReader::Error(StringRef Msg) const {\n if (PP.getLangOpts().Modules && !Diags.isDiagnosticInFlight() && !PP.getHeaderSearchInfo().getModuleCachePath().empty()) {\n Diag(diag::note_module_cache_path) << PP.getHeaderSearchInfo().getModuleCachePath();"}} | ||
}, | }, | ||
["note_module_def_undef_here"]={ | ["note_module_def_undef_here"]={ | ||
Line 6,322: | Line 6,322: | ||
[c]=a, | [c]=a, | ||
[m]={"35b13ece231b",1363738925,"<rdar://problem/10796651> Introduce configuration macros into module maps."}, | [m]={"35b13ece231b",1363738925,"<rdar://problem/10796651> Introduce configuration macros into module maps."}, | ||
[n]={{"clang/lib/Frontend/CompilerInstance.cpp", | [n]={{"clang/lib/Frontend/CompilerInstance.cpp",1557,"/// Diagnose differences between the current definition of the given\n/// configuration macro and the definition provided on the command line.\nstatic void checkConfigMacro(Preprocessor &PP, StringRef ConfigMacro, Module *Mod, SourceLocation ImportLoc) {\n if (CurrentDefinition == CmdLineDefinition) {\n } else if (!CurrentDefinition) {\n PP.Diag(LatestDef.getUndefLocation(), diag::note_module_def_undef_here) << true;"},{"clang/lib/Frontend/CompilerInstance.cpp",1566,"/// Diagnose differences between the current definition of the given\n/// configuration macro and the definition provided on the command line.\nstatic void checkConfigMacro(Preprocessor &PP, StringRef ConfigMacro, Module *Mod, SourceLocation ImportLoc) {\n if (CurrentDefinition == CmdLineDefinition) {\n } else if (!CurrentDefinition) {\n } else if (!CmdLineDefinition) {\n PP.Diag(CurrentDefinition->getDefinitionLoc(), diag::note_module_def_undef_here) << false;"},{"clang/lib/Frontend/CompilerInstance.cpp",1574,"/// Diagnose differences between the current definition of the given\n/// configuration macro and the definition provided on the command line.\nstatic void checkConfigMacro(Preprocessor &PP, StringRef ConfigMacro, Module *Mod, SourceLocation ImportLoc) {\n if (CurrentDefinition == CmdLineDefinition) {\n } else if (!CurrentDefinition) {\n } else if (!CmdLineDefinition) {\n } else if (!CurrentDefinition->isIdenticalTo(*CmdLineDefinition, PP,\n PP.Diag(CurrentDefinition->getDefinitionLoc(), diag::note_module_def_undef_here) << false;"}} | ||
}, | }, | ||
["note_module_file_conflict"]={ | ["note_module_file_conflict"]={ | ||
Line 6,334: | Line 6,334: | ||
[c]=Wb, | [c]=Wb, | ||
[m]={"766a08df12c1",1626398649,"[Frontend] Only compile modules if not already finalized"}, | [m]={"766a08df12c1",1626398649,"[Frontend] Only compile modules if not already finalized"}, | ||
[n]={{Ub, | [n]={{Ub,2946,"ASTReader::ASTReadResult ASTReader::ReadControlBlock(ModuleFile &F, SmallVectorImpl<ImportedModule> &Loaded, const ModuleFile *ImportedBy, unsigned ClientLoadCapabilities) {\n while (true) {\n case IMPORTS: {\n while (Idx < N) {\n if (recompilingFinalized)\n Diag(diag::note_module_file_conflict);"}} | ||
}, | }, | ||
["note_module_file_imported_by"]={ | ["note_module_file_imported_by"]={ | ||
Line 6,346: | Line 6,346: | ||
[c]=Wb, | [c]=Wb, | ||
[m]={"37bd29a5e6b0",1425092992,"Give better diagnostics when -fmodule-file= finds a bad file: if the file is"}, | [m]={"37bd29a5e6b0",1425092992,"Give better diagnostics when -fmodule-file= finds a bad file: if the file is"}, | ||
[n]={{Ub, | [n]={{Ub,2943,"ASTReader::ASTReadResult ASTReader::ReadControlBlock(ModuleFile &F, SmallVectorImpl<ImportedModule> &Loaded, const ModuleFile *ImportedBy, unsigned ClientLoadCapabilities) {\n while (true) {\n case IMPORTS: {\n while (Idx < N) {\n if (isDiagnosedResult(Result, Capabilities) || recompilingFinalized)\n Diag(diag::note_module_file_imported_by) << F.FileName << !F.ModuleName.empty() << F.ModuleName;"}} | ||
}, | }, | ||
["note_module_import_here"]={ | ["note_module_import_here"]={ | ||
Line 6,358: | Line 6,358: | ||
[c]=a, | [c]=a, | ||
[m]={"27e5aa08920d",1496689076,"Factor out and unify emission of \"module is unavailable\" diagnostics."}, | [m]={"27e5aa08920d",1496689076,"Factor out and unify emission of \"module is unavailable\" diagnostics."}, | ||
[n]={{"clang/lib/Frontend/CompilerInstance.cpp", | [n]={{"clang/lib/Frontend/CompilerInstance.cpp",2122,"ModuleLoadResult CompilerInstance::loadModule(SourceLocation ImportLoc, ModuleIdPath Path, Module::NameVisibilityKind Visibility, bool IsInclusionDirective) {\n // Make the named module visible, if it\'s not already part of the module\n // we are parsing.\n if (ModuleName != getLangOpts().CurrentModule) {\n // Check whether this module is available.\n if (Preprocessor::checkModuleIsAvailable(getLangOpts(), getTarget(), getDiagnostics(), Module)) {\n getDiagnostics().Report(ImportLoc, diag::note_module_import_here) << SourceRange(Path.front().second, Path.back().second);"}} | ||
}, | }, | ||
["note_module_import_not_at_top_level"]={ | ["note_module_import_not_at_top_level"]={ | ||
Line 6,370: | Line 6,370: | ||
[c]=Sb, | [c]=Sb, | ||
[m]={"779448684662",1393739898,"Add [extern_c] attribute for modules, allowing a C module to be imported within an extern \"C\" block ..."}, | [m]={"779448684662",1393739898,"Add [extern_c] attribute for modules, allowing a C module to be imported within an extern \"C\" block ..."}, | ||
[n]={{cb, | [n]={{cb,51,"static void checkModuleImportContext(Sema &S, Module *M, SourceLocation ImportLoc, DeclContext *DC, bool FromInclude = false) {\n if (!isa<TranslationUnitDecl>(DC)) {\n S.Diag(cast<Decl>(DC)->getBeginLoc(), diag::note_module_import_not_at_top_level) << DC;"}} | ||
}, | }, | ||
["note_module_odr_violation_definition_data"]={ | ["note_module_odr_violation_definition_data"]={ | ||
Line 6,382: | Line 6,382: | ||
[c]=a, | [c]=a, | ||
[m]={"e13eabe7d339",1506737957,"[ODRHash] Add base classes to hashing CXXRecordDecl."}, | [m]={"e13eabe7d339",1506737957,"[ODRHash] Add base classes to hashing CXXRecordDecl."}, | ||
[n]={{G, | [n]={{G,740,"bool ODRDiagsEmitter::diagnoseMismatch(const CXXRecordDecl *FirstRecord, const CXXRecordDecl *SecondRecord, const struct CXXRecordDecl::DefinitionData *SecondDD) const {\n // Diagnostics from DefinitionData are emitted here.\n if (FirstDD != SecondDD) {\n auto DiagBaseNote = [&SecondModule, this](SourceLocation Loc, SourceRange Range, ODRDefinitionDataDifference DiffType) { return Diag(Loc, diag::note_module_odr_violation_definition_data) << SecondModule << Range << DiffType; };"}} | ||
}, | }, | ||
["note_module_odr_violation_different_definitions"]={ | ["note_module_odr_violation_different_definitions"]={ | ||
Line 6,394: | Line 6,394: | ||
[c]=a, | [c]=a, | ||
[m]={"cd45dbc5f24c",1397879310,"When a module completes the definition of a class template specialization imported from another modu..."}, | [m]={"cd45dbc5f24c",1397879310,"When a module completes the definition of a class template specialization imported from another modu..."}, | ||
[n]={{G, | [n]={{G,662,"void ODRDiagsEmitter::diagnoseSubMismatchUnexpected(DiffResult &DR, const NamedDecl *FirstRecord, StringRef FirstModule, const NamedDecl *SecondRecord, StringRef SecondModule) const {\n Diag(SecondRecord->getLocation(), diag::note_module_odr_violation_different_definitions) << SecondModule;"}} | ||
}, | }, | ||
["note_module_odr_violation_enum"]={ | ["note_module_odr_violation_enum"]={ | ||
Line 6,406: | Line 6,406: | ||
[c]=a, | [c]=a, | ||
[m]={"ab4d730f14d1",1532559125,"[ODRHash] Support hashing enums."}, | [m]={"ab4d730f14d1",1532559125,"[ODRHash] Support hashing enums."}, | ||
[n]={{G, | [n]={{G,1816,"bool ODRDiagsEmitter::diagnoseMismatch(const EnumDecl *FirstEnum, const EnumDecl *SecondEnum) const {\n auto DiagNote = [&SecondModule, this](const auto *DiagAnchor, ODREnumDifference DiffType) { return Diag(DiagAnchor->getLocation(), diag::note_module_odr_violation_enum) << SecondModule << DiagAnchor->getSourceRange() << DiffType; };"}} | ||
}, | }, | ||
["note_module_odr_violation_field"]={ | ["note_module_odr_violation_field"]={ | ||
Line 6,418: | Line 6,418: | ||
[c]=a, | [c]=a, | ||
[m]={qb,1643408541,rb}, | [m]={qb,1643408541,rb}, | ||
[n]={{G, | [n]={{G,167,"bool ODRDiagsEmitter::diagnoseSubMismatchField(const NamedDecl *FirstRecord, StringRef FirstModule, StringRef SecondModule, const FieldDecl *FirstField, const FieldDecl *SecondField) const {\n auto DiagNote = [SecondField, SecondModule, this](ODRFieldDifference DiffType) { return Diag(SecondField->getLocation(), diag::note_module_odr_violation_field) << SecondModule.empty() << SecondModule << SecondField->getSourceRange() << DiffType; };"}} | ||
}, | }, | ||
["note_module_odr_violation_function"]={ | ["note_module_odr_violation_function"]={ | ||
Line 6,430: | Line 6,430: | ||
[c]=a, | [c]=a, | ||
[m]={"e81caeb3147f",1512782980,"[ODRHash] Support ODR violation detection in functions."}, | [m]={"e81caeb3147f",1512782980,"[ODRHash] Support ODR violation detection in functions."}, | ||
[n]={{G, | [n]={{G,1683,"bool ODRDiagsEmitter::diagnoseMismatch(const FunctionDecl *FirstFunction, const FunctionDecl *SecondFunction) const {\n auto DiagNote = [&SecondModule, this](SourceLocation Loc, SourceRange Range, ODRFunctionDifference DiffType) { return Diag(Loc, diag::note_module_odr_violation_function) << SecondModule << Range << DiffType; };"}} | ||
}, | }, | ||
["note_module_odr_violation_method_params"]={ | ["note_module_odr_violation_method_params"]={ | ||
Line 6,442: | Line 6,442: | ||
[c]=a, | [c]=a, | ||
[m]={qb,1643408541,rb}, | [m]={qb,1643408541,rb}, | ||
[n]={{G, | [n]={{G,93,"template <typename MethodT> static bool diagnoseSubMismatchMethodParameters(DiagnosticsEngine &Diags, const NamedDecl *FirstContainer, StringRef FirstModule, StringRef SecondModule, const MethodT *FirstMethod, const MethodT *SecondMethod) {\n auto DiagNote = [&Diags, &GetDiagMethodType, SecondModule, SecondMethod](ODRMethodParametersDifference DiffType) {\n return Diags.Report(SecondMethod->getLocation(), diag::note_module_odr_violation_method_params) << SecondModule.empty() << SecondModule << SecondMethod->getSourceRange() << DiffType << SecondMethodType << SecondName;"}} | ||
}, | }, | ||
["note_module_odr_violation_mismatch_decl"]={ | ["note_module_odr_violation_mismatch_decl"]={ | ||
Line 6,454: | Line 6,454: | ||
[c]=a, | [c]=a, | ||
[m]={"fa3d93a148d4",1485827055,"Add better ODR checking for modules."}, | [m]={"fa3d93a148d4",1485827055,"Add better ODR checking for modules."}, | ||
[n]={{G, | [n]={{G,700,"void ODRDiagsEmitter::diagnoseSubMismatchDifferentDeclKinds(DiffResult &DR, const NamedDecl *FirstRecord, StringRef FirstModule, const NamedDecl *SecondRecord, StringRef SecondModule) const {\n Diag(SecondDiagInfo.first, diag::note_module_odr_violation_mismatch_decl) << SecondModule.empty() << SecondModule << SecondDiagInfo.second << DR.SecondDiffType;"}} | ||
}, | }, | ||
["note_module_odr_violation_mismatch_decl_unknown"]={ | ["note_module_odr_violation_mismatch_decl_unknown"]={ | ||
Line 6,466: | Line 6,466: | ||
[c]=a, | [c]=a, | ||
[m]={"708859a71326",1496883381,"[ODRHash] Change the fall-back diagnostic error."}, | [m]={"708859a71326",1496883381,"[ODRHash] Change the fall-back diagnostic error."}, | ||
[n]={{G, | [n]={{G,1553,"bool ODRDiagsEmitter::diagnoseMismatch(const CXXRecordDecl *FirstRecord, const CXXRecordDecl *SecondRecord, const struct CXXRecordDecl::DefinitionData *SecondDD) const {\n Diag(SecondDecl->getLocation(), diag::note_module_odr_violation_mismatch_decl_unknown) << SecondModule.empty() << SecondModule << FirstDiffType << SecondDecl->getSourceRange();"},{G,1649,"bool ODRDiagsEmitter::diagnoseMismatch(const RecordDecl *FirstRecord, const RecordDecl *SecondRecord) const {\n Diag(SecondDecl->getLocation(), diag::note_module_odr_violation_mismatch_decl_unknown) << SecondModule.empty() << SecondModule << FirstDiffType << SecondDecl->getSourceRange();"},{G,2102,"bool ODRDiagsEmitter::diagnoseMismatch(const ObjCInterfaceDecl *FirstID, const ObjCInterfaceDecl *SecondID, const struct ObjCInterfaceDecl::DefinitionData *SecondDD) const {\n Diag(SecondDecl->getLocation(), diag::note_module_odr_violation_mismatch_decl_unknown) << SecondModule.empty() << SecondModule << FirstDiffType << SecondDecl->getSourceRange();"},{G,2208,"bool ODRDiagsEmitter::diagnoseMismatch(const ObjCProtocolDecl *FirstProtocol, const ObjCProtocolDecl *SecondProtocol, const struct ObjCProtocolDecl::DefinitionData *SecondDD) const {\n Diag(SecondDecl->getLocation(), diag::note_module_odr_violation_mismatch_decl_unknown) << SecondModule.empty() << SecondModule << FirstDiffType << SecondDecl->getSourceRange();"}} | ||
}, | }, | ||
["note_module_odr_violation_no_possible_decls"]={ | ["note_module_odr_violation_no_possible_decls"]={ | ||
Line 6,478: | Line 6,478: | ||
[c]=Wb, | [c]=Wb, | ||
[m]={"2b9e3e396a6f",1382076318,"Basic ODR checking for C++ modules:"}, | [m]={"2b9e3e396a6f",1382076318,"Basic ODR checking for C++ modules:"}, | ||
[n]={{Ub, | [n]={{Ub,9751,"void ASTReader::diagnoseOdrViolations() {\n // For each declaration from a merged context, check that the canonical\n // definition of that context also contains a declaration of the same\n // entity.\n //\n // Caution: this loop does things that might invalidate iterators into\n // PendingOdrMergeChecks. Don\'t turn this into a range-based for loop!\n while (!PendingOdrMergeChecks.empty()) {\n if (!Found) {\n if (Candidates.empty())\n Diag(cast<Decl>(CanonDef)->getLocation(), diag::note_module_odr_violation_no_possible_decls) << D;"}} | ||
}, | }, | ||
["note_module_odr_violation_objc_interface"]={ | ["note_module_odr_violation_objc_interface"]={ | ||
Line 6,490: | Line 6,490: | ||
[c]=a, | [c]=a, | ||
[m]={lb,1662843785,kb}, | [m]={lb,1662843785,kb}, | ||
[n]={{G, | [n]={{G,1948,"bool ODRDiagsEmitter::diagnoseMismatch(const ObjCInterfaceDecl *FirstID, const ObjCInterfaceDecl *SecondID, const struct ObjCInterfaceDecl::DefinitionData *SecondDD) const {\n auto DiagNote = [&SecondModule, this](SourceLocation Loc, SourceRange Range, ODRInterfaceDifference DiffType) { return Diag(Loc, diag::note_module_odr_violation_objc_interface) << SecondModule.empty() << SecondModule << Range << DiffType; };"}} | ||
}, | }, | ||
["note_module_odr_violation_objc_method"]={ | ["note_module_odr_violation_objc_method"]={ | ||
Line 6,502: | Line 6,502: | ||
[c]=a, | [c]=a, | ||
[m]={qb,1643408541,rb}, | [m]={qb,1643408541,rb}, | ||
[n]={{G, | [n]={{G,444,"bool ODRDiagsEmitter::diagnoseSubMismatchObjCMethod(const NamedDecl *FirstObjCContainer, StringRef FirstModule, StringRef SecondModule, const ObjCMethodDecl *FirstMethod, const ObjCMethodDecl *SecondMethod) const {\n auto DiagNote = [SecondModule, SecondMethod, this](ODRMethodDifference DiffType) { return Diag(SecondMethod->getLocation(), diag::note_module_odr_violation_objc_method) << SecondModule.empty() << SecondModule << SecondMethod->getSourceRange() << DiffType; };"}} | ||
}, | }, | ||
["note_module_odr_violation_objc_property"]={ | ["note_module_odr_violation_objc_property"]={ | ||
Line 6,514: | Line 6,514: | ||
[c]=a, | [c]=a, | ||
[m]={"dcb71b5e1d13",1657144706,"[ODRHash] Hash `ObjCPropertyDecl` and diagnose discovered mismatches."}, | [m]={"dcb71b5e1d13",1657144706,"[ODRHash] Hash `ObjCPropertyDecl` and diagnose discovered mismatches."}, | ||
[n]={{G, | [n]={{G,522,"bool ODRDiagsEmitter::diagnoseSubMismatchObjCProperty(const NamedDecl *FirstObjCContainer, StringRef FirstModule, StringRef SecondModule, const ObjCPropertyDecl *FirstProp, const ObjCPropertyDecl *SecondProp) const {\n auto DiagNote = [SecondModule, SecondProp, this](SourceLocation Loc, ODRPropertyDifference DiffType) { return Diag(Loc, diag::note_module_odr_violation_objc_property) << SecondModule.empty() << SecondModule << SecondProp->getSourceRange() << DiffType; };"}} | ||
}, | }, | ||
["note_module_odr_violation_possible_decl"]={ | ["note_module_odr_violation_possible_decl"]={ | ||
Line 6,526: | Line 6,526: | ||
[c]=Wb, | [c]=Wb, | ||
[m]={"2b9e3e396a6f",1382076318,"Basic ODR checking for C++ modules:"}, | [m]={"2b9e3e396a6f",1382076318,"Basic ODR checking for C++ modules:"}, | ||
[n]={{Ub, | [n]={{Ub,9755,"void ASTReader::diagnoseOdrViolations() {\n // For each declaration from a merged context, check that the canonical\n // definition of that context also contains a declaration of the same\n // entity.\n //\n // Caution: this loop does things that might invalidate iterators into\n // PendingOdrMergeChecks. Don\'t turn this into a range-based for loop!\n while (!PendingOdrMergeChecks.empty()) {\n if (!Found) {\n if (Candidates.empty())\n else {\n for (unsigned I = 0, N = Candidates.size(); I != N; ++I)\n Diag(Candidates[I]->getLocation(), diag::note_module_odr_violation_possible_decl) << Candidates[I];"}} | ||
}, | }, | ||
["note_module_odr_violation_record"]={ | ["note_module_odr_violation_record"]={ | ||
Line 6,538: | Line 6,538: | ||
[c]=a, | [c]=a, | ||
[m]={qb,1643408541,rb}, | [m]={qb,1643408541,rb}, | ||
[n]={{G, | [n]={{G,966,"bool ODRDiagsEmitter::diagnoseMismatch(const CXXRecordDecl *FirstRecord, const CXXRecordDecl *SecondRecord, const struct CXXRecordDecl::DefinitionData *SecondDD) const {\n auto DiagNote = [&SecondModule, this](SourceLocation Loc, SourceRange Range, ODRCXXRecordDifference DiffType) { return Diag(Loc, diag::note_module_odr_violation_record) << SecondModule << Range << DiffType; };"}} | ||
}, | }, | ||
["note_module_odr_violation_referenced_protocols"]={ | ["note_module_odr_violation_referenced_protocols"]={ | ||
Line 6,550: | Line 6,550: | ||
[c]=a, | [c]=a, | ||
[m]={qb,1643408541,rb}, | [m]={qb,1643408541,rb}, | ||
[n]={{G, | [n]={{G,382,"bool ODRDiagsEmitter::diagnoseSubMismatchProtocols(const ObjCProtocolList &FirstProtocols, const ObjCContainerDecl *FirstContainer, StringRef FirstModule, const ObjCProtocolList &SecondProtocols, const ObjCContainerDecl *SecondContainer, StringRef SecondModule) const {\n auto DiagRefProtocolNote = [SecondModule, this](SourceLocation Loc, SourceRange Range, ODRReferencedProtocolDifference DiffType) { return Diag(Loc, diag::note_module_odr_violation_referenced_protocols) << SecondModule.empty() << SecondModule << Range << DiffType; };"}} | ||
}, | }, | ||
["note_module_odr_violation_template_parameter"]={ | ["note_module_odr_violation_template_parameter"]={ | ||
Line 6,562: | Line 6,562: | ||
[c]=a, | [c]=a, | ||
[m]={"498117bf11d8",1503456239,"[ODRHash] Diagnose differing template parameters."}, | [m]={"498117bf11d8",1503456239,"[ODRHash] Diagnose differing template parameters."}, | ||
[n]={{G, | [n]={{G,885,"bool ODRDiagsEmitter::diagnoseMismatch(const CXXRecordDecl *FirstRecord, const CXXRecordDecl *SecondRecord, const struct CXXRecordDecl::DefinitionData *SecondDD) const {\n if (FirstTemplate && SecondTemplate) {\n for (auto Pair : llvm::zip(FirstTemplateParams, SecondTemplateParams)) {\n Diag(SecondDecl->getLocation(), diag::note_module_odr_violation_template_parameter) << SecondModule << SecondDecl->getSourceRange() << NoteDiffType << hasSecondArg << SecondName;"}} | ||
}, | }, | ||
["note_module_odr_violation_typedef"]={ | ["note_module_odr_violation_typedef"]={ | ||
Line 6,574: | Line 6,574: | ||
[c]=a, | [c]=a, | ||
[m]={qb,1643408541,rb}, | [m]={qb,1643408541,rb}, | ||
[n]={{G, | [n]={{G,265,"bool ODRDiagsEmitter::diagnoseSubMismatchTypedef(const NamedDecl *FirstRecord, StringRef FirstModule, StringRef SecondModule, const TypedefNameDecl *FirstTD, const TypedefNameDecl *SecondTD, bool IsTypeAlias) const {\n auto DiagNote = [SecondTD, SecondModule, this](ODRTypedefDifference DiffType) { return Diag(SecondTD->getLocation(), diag::note_module_odr_violation_typedef) << SecondModule << SecondTD->getSourceRange() << DiffType; };"}} | ||
}, | }, | ||
["note_module_odr_violation_variable"]={ | ["note_module_odr_violation_variable"]={ | ||
Line 6,586: | Line 6,586: | ||
[c]=a, | [c]=a, | ||
[m]={qb,1643408541,rb}, | [m]={qb,1643408541,rb}, | ||
[n]={{G, | [n]={{G,308,"bool ODRDiagsEmitter::diagnoseSubMismatchVar(const NamedDecl *FirstRecord, StringRef FirstModule, StringRef SecondModule, const VarDecl *FirstVD, const VarDecl *SecondVD) const {\n auto DiagNote = [SecondVD, SecondModule, this](ODRVarDifference DiffType) { return Diag(SecondVD->getLocation(), diag::note_module_odr_violation_variable) << SecondModule << SecondVD->getSourceRange() << DiffType; };"}} | ||
}, | }, | ||
["note_mt_message"]={ | ["note_mt_message"]={ | ||
Line 6,598: | Line 6,598: | ||
[c]=a, | [c]=a, | ||
[m]={"42aa21222d37",1390712852,"ARCMigrate: Introduce proper diagnostics for TransformActions"}, | [m]={"42aa21222d37",1390712852,"ARCMigrate: Introduce proper diagnostics for TransformActions"}, | ||
[n]={{"clang/lib/ARCMigrate/TransformActions.cpp", | [n]={{"clang/lib/ARCMigrate/TransformActions.cpp",700,"void TransformActions::reportNote(StringRef message, SourceLocation loc, SourceRange range) { report(loc, diag::note_mt_message, range) << message; }"}} | ||
}, | }, | ||
["note_multiversioning_caused_here"]={ | ["note_multiversioning_caused_here"]={ | ||
Line 6,610: | Line 6,610: | ||
[c]=a, | [c]=a, | ||
[m]={"281d20b601c8",1515447257,"Implement Attribute Target MultiVersioning"}, | [m]={"281d20b601c8",1515447257,"Implement Attribute Target MultiVersioning"}, | ||
[n]={{t, | [n]={{t,11017,"static bool checkNonMultiVersionCompatAttributes(Sema &S, const FunctionDecl *FD, const FunctionDecl *CausedFD, MultiVersionKind MVKind) {\n const auto Diagnose = [FD, CausedFD, MVKind](Sema &S, const Attr *A) {\n if (CausedFD)\n S.Diag(CausedFD->getLocation(), diag::note_multiversioning_caused_here);"},{t,11192,"static bool CheckMultiVersionAdditionalRules(Sema &S, const FunctionDecl *OldFD, const FunctionDecl *NewFD, bool CausesMV, MultiVersionKind MVKind) {\n return S.areMultiversionVariantFunctionsCompatible(OldFD, NewFD, S.PDiag(diag::err_multiversion_noproto), PartialDiagnosticAt(NewFD->getLocation(), S.PDiag(diag::note_multiversioning_caused_here)), PartialDiagnosticAt(NewFD->getLocation(), S.PDiag(diag::err_multiversion_doesnt_support) << static_cast<unsigned>(MVKind)), PartialDiagnosticAt(NewFD->getLocation(), S.PDiag(diag::err_multiversion_diff)),"},{t,11285,"static bool CheckTargetCausesMultiVersioning(Sema &S, FunctionDecl *OldFD, FunctionDecl *NewFD, bool &Redeclaration, NamedDecl *&OldDecl, LookupResult &Previous) {\n if (CheckMultiVersionValue(S, OldFD)) {\n S.Diag(NewFD->getLocation(), diag::note_multiversioning_caused_here);"},{t,11334,"static bool CheckTargetCausesMultiVersioning(Sema &S, FunctionDecl *OldFD, FunctionDecl *NewFD, bool &Redeclaration, NamedDecl *&OldDecl, LookupResult &Previous) {\n for (const auto *FD : OldFD->redecls()) {\n // We allow forward declarations before ANY multiversioning attributes, but\n // nothing after the fact.\n if (PreviousDeclsHaveMultiVersionAttribute(FD) && ((NewTA && (!CurTA || CurTA->isInherited())) || (NewTVA && (!CurTVA || CurTVA->isInherited())))) {\n S.Diag(NewFD->getLocation(), diag::note_multiversioning_caused_here);"}} | ||
}, | }, | ||
["note_musttail_callconv_mismatch"]={ | ["note_musttail_callconv_mismatch"]={ | ||
Line 6,622: | Line 6,622: | ||
[c]=o, | [c]=o, | ||
[m]={ic,1607502387,jc}, | [m]={ic,1607502387,jc}, | ||
[n]={{A, | [n]={{A,778,"bool Sema::checkMustTailAttr(const Stmt *St, const Attr &MTA) {\n // Caller and callee must have matching calling conventions.\n //\n // Some calling conventions are physically capable of supporting tail calls\n // even if the function types don\'t perfectly match. LLVM is currently too\n // strict to allow this, but if LLVM added support for this in the future, we\n // could exit early here and skip the remaining checks if the functions are\n // using such a calling convention.\n if (CallerType.Func->getCallConv() != CalleeType.Func->getCallConv()) {\n Diag(CalleeLoc, diag::note_musttail_callconv_mismatch) << FunctionType::getNameForCallConv(CallerType.Func->getCallConv()) << FunctionType::getNameForCallConv(CalleeType.Func->getCallConv());"}} | ||
}, | }, | ||
["note_musttail_callee_defined_here"]={ | ["note_musttail_callee_defined_here"]={ | ||
Line 6,634: | Line 6,634: | ||
[c]=o, | [c]=o, | ||
[m]={ic,1607502387,jc}, | [m]={ic,1607502387,jc}, | ||
[n]={{A, | [n]={{A,796,"bool Sema::checkMustTailAttr(const Stmt *St, const Attr &MTA) {\n // Caller and callee must match in whether they have a \"this\" parameter.\n if (CallerType.This.isNull() != CalleeType.This.isNull()) {\n if (const auto *ND = dyn_cast_or_null<NamedDecl>(CE->getCalleeDecl())) {\n Diag(CalleeLoc, diag::note_musttail_callee_defined_here) << ND->getDeclName();"}} | ||
}, | }, | ||
["note_musttail_fix_non_prototype"]={ | ["note_musttail_fix_non_prototype"]={ | ||
Line 6,646: | Line 6,646: | ||
[c]=o, | [c]=o, | ||
[m]={ic,1607502387,jc}, | [m]={ic,1607502387,jc}, | ||
[n]={{A, | [n]={{A,758,"bool Sema::checkMustTailAttr(const Stmt *St, const Attr &MTA) {\n // Both caller and callee must have a prototype (no K&R declarations).\n if (!CalleeType.Func || !CallerType.Func) {\n if (!CalleeType.Func && CE->getDirectCallee()) {\n Diag(CE->getDirectCallee()->getBeginLoc(), diag::note_musttail_fix_non_prototype);"},{A,761,"bool Sema::checkMustTailAttr(const Stmt *St, const Attr &MTA) {\n // Both caller and callee must have a prototype (no K&R declarations).\n if (!CalleeType.Func || !CallerType.Func) {\n if (!CallerType.Func)\n Diag(CallerDecl->getBeginLoc(), diag::note_musttail_fix_non_prototype);"}} | ||
}, | }, | ||
["note_musttail_mismatch"]={ | ["note_musttail_mismatch"]={ | ||
Line 6,658: | Line 6,658: | ||
[c]=o, | [c]=o, | ||
[m]={ic,1607502387,jc}, | [m]={ic,1607502387,jc}, | ||
[n]={{A, | [n]={{A,851,"bool Sema::checkMustTailAttr(const Stmt *St, const Attr &MTA) {\n PartialDiagnostic PD = PDiag(diag::note_musttail_mismatch);"}} | ||
}, | }, | ||
["note_musttail_structors_forbidden"]={ | ["note_musttail_structors_forbidden"]={ | ||
Line 6,670: | Line 6,670: | ||
[c]=o, | [c]=o, | ||
[m]={ic,1607502387,jc}, | [m]={ic,1607502387,jc}, | ||
[n]={{A, | [n]={{A,685,"bool Sema::checkMustTailAttr(const Stmt *St, const Attr &MTA) {\n auto GetMethodType = [this, St, MTA](const CXXMethodDecl *CMD, FuncType &Type, bool IsCallee) -> bool {\n if (isa<CXXConstructorDecl, CXXDestructorDecl>(CMD)) {\n if (IsCallee)\n Diag(CMD->getBeginLoc(), diag::note_musttail_structors_forbidden) << isa<CXXDestructorDecl>(CMD);"}} | ||
}, | }, | ||
["note_namespace_defined_here"]={ | ["note_namespace_defined_here"]={ | ||
Line 6,682: | Line 6,682: | ||
[c]=o, | [c]=o, | ||
[m]={"cdf87024edb7",1277834026,"Allow a using directive to refer to the implicitly-defined namespace"}, | [m]={"cdf87024edb7",1277834026,"Allow a using directive to refer to the implicitly-defined namespace"}, | ||
[n]={{q, | [n]={{q,11905,"static bool TryNamespaceTypoCorrection(Sema &S, LookupResult &R, Scope *Sc, CXXScopeSpec &SS, SourceLocation IdentLoc, IdentifierInfo *Ident) {\n if (TypoCorrection Corrected = S.CorrectTypo(R.getLookupNameInfo(), R.getLookupKind(), Sc, &SS, CCC, Sema::CTK_ErrorRecovery)) {\n if (DeclContext *DC = S.computeDeclContext(SS, false)) {\n S.diagnoseTypo(Corrected, S.PDiag(diag::err_using_directive_member_suggest) << Ident << DC << DroppedSpecifier << SS.getRange(), S.PDiag(diag::note_namespace_defined_here));"},{q,11909,"static bool TryNamespaceTypoCorrection(Sema &S, LookupResult &R, Scope *Sc, CXXScopeSpec &SS, SourceLocation IdentLoc, IdentifierInfo *Ident) {\n if (TypoCorrection Corrected = S.CorrectTypo(R.getLookupNameInfo(), R.getLookupKind(), Sc, &SS, CCC, Sema::CTK_ErrorRecovery)) {\n if (DeclContext *DC = S.computeDeclContext(SS, false)) {\n } else {\n S.diagnoseTypo(Corrected, S.PDiag(diag::err_using_directive_suggest) << Ident, S.PDiag(diag::note_namespace_defined_here));"}} | ||
}, | }, | ||
["note_neon_vector_initializer_non_portable"]={ | ["note_neon_vector_initializer_non_portable"]={ | ||
Line 6,694: | Line 6,694: | ||
[c]=o, | [c]=o, | ||
[m]={"9eef2659bf60",1403274913,"The ability to use vector initializer lists is a GNU vector extension"}, | [m]={"9eef2659bf60",1403274913,"The ability to use vector initializer lists is a GNU vector extension"}, | ||
[n]={{D, | [n]={{D,1865,"void InitListChecker::CheckVectorType(const InitializedEntity &Entity, InitListExpr *IList, QualType DeclType, unsigned &Index, InitListExpr *StructuredList, unsigned &StructuredIndex) {\n if (!SemaRef.getLangOpts().OpenCL && !SemaRef.getLangOpts().HLSL) {\n if (isBigEndian && (T->getVectorKind() == VectorType::NeonVector || T->getVectorKind() == VectorType::NeonPolyVector)) {\n SemaRef.Diag(IList->getBeginLoc(), SemaRef.Context.getTypeSize(VT) > 64 ? diag::note_neon_vector_initializer_non_portable_q : diag::note_neon_vector_initializer_non_portable) << typeCode << typeSize;"}} | ||
}, | }, | ||
["note_neon_vector_initializer_non_portable_q"]={ | ["note_neon_vector_initializer_non_portable_q"]={ | ||
Line 6,706: | Line 6,706: | ||
[c]=o, | [c]=o, | ||
[m]={"9eef2659bf60",1403274913,"The ability to use vector initializer lists is a GNU vector extension"}, | [m]={"9eef2659bf60",1403274913,"The ability to use vector initializer lists is a GNU vector extension"}, | ||
[n]={{D, | [n]={{D,1864,"void InitListChecker::CheckVectorType(const InitializedEntity &Entity, InitListExpr *IList, QualType DeclType, unsigned &Index, InitListExpr *StructuredList, unsigned &StructuredIndex) {\n if (!SemaRef.getLangOpts().OpenCL && !SemaRef.getLangOpts().HLSL) {\n if (isBigEndian && (T->getVectorKind() == VectorType::NeonVector || T->getVectorKind() == VectorType::NeonPolyVector)) {\n SemaRef.Diag(IList->getBeginLoc(), SemaRef.Context.getTypeSize(VT) > 64 ? diag::note_neon_vector_initializer_non_portable_q : diag::note_neon_vector_initializer_non_portable) << typeCode << typeSize;"}} | ||
}, | }, | ||
["note_nested_requirement_here"]={ | ["note_nested_requirement_here"]={ | ||
Line 6,718: | Line 6,718: | ||
[c]=o, | [c]=o, | ||
[m]={ab,1576172311,bb}, | [m]={ab,1576172311,bb}, | ||
[n]={{z, | [n]={{z,951,"/// Prints the current instantiation stack through a series of\n/// notes.\nvoid Sema::PrintInstantiationStack() {\n for (SmallVectorImpl<CodeSynthesisContext>::reverse_iterator Active = CodeSynthesisContexts.rbegin(), ActiveEnd = CodeSynthesisContexts.rend(); Active != ActiveEnd; ++Active, ++InstantiationIdx) {\n case CodeSynthesisContext::NestedRequirementConstraintsCheck:\n Diags.Report(Active->PointOfInstantiation, diag::note_nested_requirement_here) << Active->InstantiationRange;"},{z,1025,"/// Prints the current instantiation stack through a series of\n/// notes.\nvoid Sema::PrintInstantiationStack() {\n for (SmallVectorImpl<CodeSynthesisContext>::reverse_iterator Active = CodeSynthesisContexts.rbegin(), ActiveEnd = CodeSynthesisContexts.rend(); Active != ActiveEnd; ++Active, ++InstantiationIdx) {\n case CodeSynthesisContext::ConstraintsCheck: {\n if (!Active->Entity) {\n Diags.Report(Active->PointOfInstantiation, diag::note_nested_requirement_here) << Active->InstantiationRange;"}} | ||
}, | }, | ||
["note_nested_requirement_substitution_error"]={ | ["note_nested_requirement_substitution_error"]={ | ||
Line 6,730: | Line 6,730: | ||
[c]=o, | [c]=o, | ||
[m]={ab,1576172311,bb}, | [m]={ab,1576172311,bb}, | ||
[n]={{O, | [n]={{O,1017,"static void diagnoseUnsatisfiedRequirement(Sema &S, concepts::NestedRequirement *Req, bool First) {\n for (auto &Pair : Req->getConstraintSatisfaction()) {\n if (auto *SubstDiag = Pair.second.dyn_cast<SubstitutionDiagnostic *>())\n S.Diag(SubstDiag->first, diag::note_nested_requirement_substitution_error) << (int)First << Req->getInvalidConstraintEntity() << SubstDiag->second;"}} | ||
}, | }, | ||
["note_nested_requirement_unknown_substitution_error"]={ | ["note_nested_requirement_unknown_substitution_error"]={ | ||
Line 6,753: | Line 6,753: | ||
[c]=o, | [c]=o, | ||
[m]={"30680e943735",1508796101,"[Sema] Add support for flexible array members in Obj-C."}, | [m]={"30680e943735",1508796101,"[Sema] Add support for flexible array members in Obj-C."}, | ||
[n]={{t, | [n]={{t,18794,"void Sema::ActOnFields(Scope *S, SourceLocation RecLoc, Decl *EnclosingDecl, ArrayRef<Decl *> Fields, SourceLocation LBrac, SourceLocation RBrac, const ParsedAttributesView &Attrs) {\n for (ArrayRef<Decl *>::iterator i = Fields.begin(), end = Fields.end(); i != end; ++i) {\n if (FDTy->isFunctionType()) {\n } else if (FDTy->isIncompleteArrayType() && (Record || isa<ObjCContainerDecl>(EnclosingDecl))) {\n if (Record) {\n if (!Record->isUnion() && !IsLastField) {\n Diag((*(i + 1))->getLocation(), diag::note_next_field_declaration);"}} | ||
}, | }, | ||
["note_next_ivar_declaration"]={ | ["note_next_ivar_declaration"]={ | ||
Line 6,765: | Line 6,765: | ||
[c]=o, | [c]=o, | ||
[m]={"30680e943735",1508796101,"[Sema] Add support for flexible array members in Obj-C."}, | [m]={"30680e943735",1508796101,"[Sema] Add support for flexible array members in Obj-C."}, | ||
[n]={{E, | [n]={{E,3901,"static void DiagnoseVariableSizedIvars(Sema &S, ObjCContainerDecl *OCD) {\n // Check if variable sized ivar is followed by another ivar.\n for (ObjCIvarDecl *ivar = IntfDecl->all_declared_ivar_begin(); ivar; ivar = ivar->getNextIvar()) {\n if (IsInvalidIvar) {\n S.Diag(ivar->getNextIvar()->getLocation(), diag::note_next_ivar_declaration) << ivar->getNextIvar()->getSynthesize();"}} | ||
}, | }, | ||
["note_non_c_like_anon_struct"]={ | ["note_non_c_like_anon_struct"]={ | ||
Line 6,777: | Line 6,777: | ||
[c]=o, | [c]=o, | ||
[m]={"1228d42ddab8",1576809732,"[OpenMP][Part 2] Use reusable OpenMP context/traits handling"}, | [m]={"1228d42ddab8",1576809732,"[OpenMP][Part 2] Use reusable OpenMP context/traits handling"}, | ||
[n]={{t, | [n]={{t,5030,"void Sema::setTagNameForLinkagePurposes(TagDecl *TagFromDeclSpec, TypedefNameDecl *NewTD) {\n if (NonCLike || ChangesLinkage) {\n if (NonCLike.Kind != NonCLikeKind::None) {\n Diag(NonCLike.Range.getBegin(), diag::note_non_c_like_anon_struct) << NonCLike.Kind - 1 << NonCLike.Range;"}} | ||
}, | }, | ||
["note_non_deducible_parameter"]={ | ["note_non_deducible_parameter"]={ | ||
Line 6,789: | Line 6,789: | ||
[c]=o, | [c]=o, | ||
[m]={"4e05eaa9e84a",1487205407,"[c++1z] Diagnose non-deducible template parameters in deduction guide templates, per [temp.param]p11..."}, | [m]={"4e05eaa9e84a",1487205407,"[c++1z] Diagnose non-deducible template parameters in deduction guide templates, per [temp.param]p11..."}, | ||
[n]={{u, | [n]={{u,4441,"static void noteNonDeducibleParameters(Sema &S, TemplateParameterList *TemplateParams, const llvm::SmallBitVector &DeducibleParams) {\n for (unsigned I = 0, N = DeducibleParams.size(); I != N; ++I) {\n if (!DeducibleParams[I]) {\n if (Param->getDeclName())\n S.Diag(Param->getLocation(), diag::note_non_deducible_parameter) << Param->getDeclName();"},{u,4444,"static void noteNonDeducibleParameters(Sema &S, TemplateParameterList *TemplateParams, const llvm::SmallBitVector &DeducibleParams) {\n for (unsigned I = 0, N = DeducibleParams.size(); I != N; ++I) {\n if (!DeducibleParams[I]) {\n if (Param->getDeclName())\n else\n S.Diag(Param->getLocation(), diag::note_non_deducible_parameter) << \"(anonymous)\";"}} | ||
}, | }, | ||
["note_non_instantiated_member_here"]={ | ["note_non_instantiated_member_here"]={ | ||
Line 6,801: | Line 6,801: | ||
[c]=o, | [c]=o, | ||
[m]={"528ad93924b1",1299442365,"We may fail to map a declaration in a template to its instantiated"}, | [m]={"528ad93924b1",1299442365,"We may fail to map a declaration in a template to its instantiated"}, | ||
[n]={{dc, | [n]={{dc,6324,"/// Find the instantiation of the given declaration within the\n/// current instantiation.\n///\n/// This routine is intended to be used when \\p D is a declaration\n/// referenced from within a template, that needs to mapped into the\n/// corresponding declaration within an instantiation. For example,\n/// given:\n///\n/// \\code\n/// template<typename T>\n/// struct X {\n/// enum Kind {\n/// KnownValue = sizeof(T)\n/// };\n///\n/// bool getKind() const { return KnownValue; }\n/// };\n///\n/// template struct X<int>;\n/// \\endcode\n///\n/// In the instantiation of X<int>::getKind(), we need to map the \\p\n/// EnumConstantDecl for \\p KnownValue (which refers to\n/// X<T>::<Kind>::KnownValue) to its instantiation (X<int>::<Kind>::KnownValue).\n/// \\p FindInstantiatedDecl performs this mapping from within the instantiation\n/// of X<int>.\nNamedDecl *Sema::FindInstantiatedDecl(SourceLocation Loc, NamedDecl *D, const MultiLevelTemplateArgumentList &TemplateArgs, bool FindingInstantiatedContext) {\n if (ParentDC != D->getDeclContext()) {\n if (!Result) {\n if (isa<UsingShadowDecl>(D)) {\n } else if (hasUncompilableErrorOccurred()) {\n } else if (IsBeingInstantiated) {\n Diag(D->getLocation(), diag::note_non_instantiated_member_here);"}} | ||
}, | }, | ||
["note_non_literal_base_class"]={ | ["note_non_literal_base_class"]={ | ||
Line 6,813: | Line 6,813: | ||
[c]=o, | [c]=o, | ||
[m]={fb,1317436288,mb}, | [m]={fb,1317436288,mb}, | ||
[n]={{B, | [n]={{B,9350,"/// Ensure that the type T is a literal type.\n///\n/// This routine checks whether the type @p T is a literal type. If @p T is an\n/// incomplete type, an attempt is made to complete it. If @p T is a literal\n/// type, or @p AllowIncompleteType is true and @p T is an incomplete type,\n/// returns false. Otherwise, this routine issues the diagnostic @p PD (giving\n/// it the type @p T), along with notes explaining why the type is not a\n/// literal type, and returns true.\n///\n/// @param Loc The location in the source that the non-literal type\n/// diagnostic should refer to.\n///\n/// @param T The type that this routine is examining for literalness.\n///\n/// @param Diagnoser Emits a diagnostic if T is not a literal type.\n///\n/// @returns @c true if @p T is not a literal type and a diagnostic was emitted,\n/// @c false otherwise.\nbool Sema::RequireLiteralType(SourceLocation Loc, QualType T, TypeDiagnoser &Diagnoser) {\n // If the class has virtual base classes, then it\'s not an aggregate, and\n // cannot have any constexpr constructors or a trivial default constructor,\n // so is non-literal. This is better to diagnose than the resulting absence\n // of constexpr constructors.\n if (RD->getNumVBases()) {\n } else if (!RD->isAggregate() && !RD->hasConstexprNonCopyMoveConstructor() && !RD->hasTrivialDefaultConstructor()) {\n } else if (RD->hasNonLiteralTypeFieldsOrBases()) {\n for (const auto &I : RD->bases()) {\n if (!I.getType()->isLiteralType(Context)) {\n Diag(I.getBeginLoc(), diag::note_non_literal_base_class) << RD << I.getType() << I.getSourceRange();"}} | ||
}, | }, | ||
["note_non_literal_field"]={ | ["note_non_literal_field"]={ | ||
Line 6,825: | Line 6,825: | ||
[c]=o, | [c]=o, | ||
[m]={fb,1317436288,mb}, | [m]={fb,1317436288,mb}, | ||
[n]={{B, | [n]={{B,9358,"/// Ensure that the type T is a literal type.\n///\n/// This routine checks whether the type @p T is a literal type. If @p T is an\n/// incomplete type, an attempt is made to complete it. If @p T is a literal\n/// type, or @p AllowIncompleteType is true and @p T is an incomplete type,\n/// returns false. Otherwise, this routine issues the diagnostic @p PD (giving\n/// it the type @p T), along with notes explaining why the type is not a\n/// literal type, and returns true.\n///\n/// @param Loc The location in the source that the non-literal type\n/// diagnostic should refer to.\n///\n/// @param T The type that this routine is examining for literalness.\n///\n/// @param Diagnoser Emits a diagnostic if T is not a literal type.\n///\n/// @returns @c true if @p T is not a literal type and a diagnostic was emitted,\n/// @c false otherwise.\nbool Sema::RequireLiteralType(SourceLocation Loc, QualType T, TypeDiagnoser &Diagnoser) {\n // If the class has virtual base classes, then it\'s not an aggregate, and\n // cannot have any constexpr constructors or a trivial default constructor,\n // so is non-literal. This is better to diagnose than the resulting absence\n // of constexpr constructors.\n if (RD->getNumVBases()) {\n } else if (!RD->isAggregate() && !RD->hasConstexprNonCopyMoveConstructor() && !RD->hasTrivialDefaultConstructor()) {\n } else if (RD->hasNonLiteralTypeFieldsOrBases()) {\n for (const auto *I : RD->fields()) {\n if (!I->getType()->isLiteralType(Context) || I->getType().isVolatileQualified()) {\n Diag(I->getLocation(), diag::note_non_literal_field) << RD << I << I->getType() << I->getType().isVolatileQualified();"}} | ||
}, | }, | ||
["note_non_literal_incomplete"]={ | ["note_non_literal_incomplete"]={ | ||
Line 6,837: | Line 6,837: | ||
[c]=o, | [c]=o, | ||
[m]={"6ca73133ca7b",1335396228,"If a type is non-literal by virtue of being incomplete produce notes"}, | [m]={"6ca73133ca7b",1335396228,"If a type is non-literal by virtue of being incomplete produce notes"}, | ||
[n]={{B, | [n]={{B,9324,"/// Ensure that the type T is a literal type.\n///\n/// This routine checks whether the type @p T is a literal type. If @p T is an\n/// incomplete type, an attempt is made to complete it. If @p T is a literal\n/// type, or @p AllowIncompleteType is true and @p T is an incomplete type,\n/// returns false. Otherwise, this routine issues the diagnostic @p PD (giving\n/// it the type @p T), along with notes explaining why the type is not a\n/// literal type, and returns true.\n///\n/// @param Loc The location in the source that the non-literal type\n/// diagnostic should refer to.\n///\n/// @param T The type that this routine is examining for literalness.\n///\n/// @param Diagnoser Emits a diagnostic if T is not a literal type.\n///\n/// @returns @c true if @p T is not a literal type and a diagnostic was emitted,\n/// @c false otherwise.\nbool Sema::RequireLiteralType(SourceLocation Loc, QualType T, TypeDiagnoser &Diagnoser) {\n if (RequireCompleteType(Loc, ElemType, diag::note_non_literal_incomplete, T))"}} | ||
}, | }, | ||
["note_non_literal_lambda"]={ | ["note_non_literal_lambda"]={ | ||
Line 6,849: | Line 6,849: | ||
[c]=o, | [c]=o, | ||
[m]={"d699da427a4c",1526328904,"PR37450: Fix bug that disabled some type checks for variables with deduced types."}, | [m]={"d699da427a4c",1526328904,"PR37450: Fix bug that disabled some type checks for variables with deduced types."}, | ||
[n]={{B, | [n]={{B,9330,"/// Ensure that the type T is a literal type.\n///\n/// This routine checks whether the type @p T is a literal type. If @p T is an\n/// incomplete type, an attempt is made to complete it. If @p T is a literal\n/// type, or @p AllowIncompleteType is true and @p T is an incomplete type,\n/// returns false. Otherwise, this routine issues the diagnostic @p PD (giving\n/// it the type @p T), along with notes explaining why the type is not a\n/// literal type, and returns true.\n///\n/// @param Loc The location in the source that the non-literal type\n/// diagnostic should refer to.\n///\n/// @param T The type that this routine is examining for literalness.\n///\n/// @param Diagnoser Emits a diagnostic if T is not a literal type.\n///\n/// @returns @c true if @p T is not a literal type and a diagnostic was emitted,\n/// @c false otherwise.\nbool Sema::RequireLiteralType(SourceLocation Loc, QualType T, TypeDiagnoser &Diagnoser) {\n // [expr.prim.lambda]p3:\n // This class type is [not] a literal type.\n if (RD->isLambda() && !getLangOpts().CPlusPlus17) {\n Diag(RD->getLocation(), diag::note_non_literal_lambda);"}} | ||
}, | }, | ||
["note_non_literal_no_constexpr_ctors"]={ | ["note_non_literal_no_constexpr_ctors"]={ | ||
Line 6,861: | Line 6,861: | ||
[c]=o, | [c]=o, | ||
[m]={fb,1317436288,mb}, | [m]={fb,1317436288,mb}, | ||
[n]={{B, | [n]={{B,9346,"/// Ensure that the type T is a literal type.\n///\n/// This routine checks whether the type @p T is a literal type. If @p T is an\n/// incomplete type, an attempt is made to complete it. If @p T is a literal\n/// type, or @p AllowIncompleteType is true and @p T is an incomplete type,\n/// returns false. Otherwise, this routine issues the diagnostic @p PD (giving\n/// it the type @p T), along with notes explaining why the type is not a\n/// literal type, and returns true.\n///\n/// @param Loc The location in the source that the non-literal type\n/// diagnostic should refer to.\n///\n/// @param T The type that this routine is examining for literalness.\n///\n/// @param Diagnoser Emits a diagnostic if T is not a literal type.\n///\n/// @returns @c true if @p T is not a literal type and a diagnostic was emitted,\n/// @c false otherwise.\nbool Sema::RequireLiteralType(SourceLocation Loc, QualType T, TypeDiagnoser &Diagnoser) {\n // If the class has virtual base classes, then it\'s not an aggregate, and\n // cannot have any constexpr constructors or a trivial default constructor,\n // so is non-literal. This is better to diagnose than the resulting absence\n // of constexpr constructors.\n if (RD->getNumVBases()) {\n } else if (!RD->isAggregate() && !RD->hasConstexprNonCopyMoveConstructor() && !RD->hasTrivialDefaultConstructor()) {\n Diag(RD->getLocation(), diag::note_non_literal_no_constexpr_ctors) << RD;"}} | ||
}, | }, | ||
["note_non_literal_non_constexpr_dtor"]={ | ["note_non_literal_non_constexpr_dtor"]={ | ||
Line 6,873: | Line 6,873: | ||
[c]=o, | [c]=o, | ||
[m]={Ab,1567434909,Cb}, | [m]={Ab,1567434909,Cb}, | ||
[n]={{B, | [n]={{B,9375,"/// Ensure that the type T is a literal type.\n///\n/// This routine checks whether the type @p T is a literal type. If @p T is an\n/// incomplete type, an attempt is made to complete it. If @p T is a literal\n/// type, or @p AllowIncompleteType is true and @p T is an incomplete type,\n/// returns false. Otherwise, this routine issues the diagnostic @p PD (giving\n/// it the type @p T), along with notes explaining why the type is not a\n/// literal type, and returns true.\n///\n/// @param Loc The location in the source that the non-literal type\n/// diagnostic should refer to.\n///\n/// @param T The type that this routine is examining for literalness.\n///\n/// @param Diagnoser Emits a diagnostic if T is not a literal type.\n///\n/// @returns @c true if @p T is not a literal type and a diagnostic was emitted,\n/// @c false otherwise.\nbool Sema::RequireLiteralType(SourceLocation Loc, QualType T, TypeDiagnoser &Diagnoser) {\n // If the class has virtual base classes, then it\'s not an aggregate, and\n // cannot have any constexpr constructors or a trivial default constructor,\n // so is non-literal. This is better to diagnose than the resulting absence\n // of constexpr constructors.\n if (RD->getNumVBases()) {\n } else if (!RD->isAggregate() && !RD->hasConstexprNonCopyMoveConstructor() && !RD->hasTrivialDefaultConstructor()) {\n } else if (RD->hasNonLiteralTypeFieldsOrBases()) {\n } else if (getLangOpts().CPlusPlus20 ? !RD->hasConstexprDestructor() : !RD->hasTrivialDestructor()) {\n if (getLangOpts().CPlusPlus20) {\n Diag(Dtor->getLocation(), diag::note_non_literal_non_constexpr_dtor) << RD;"}} | ||
}, | }, | ||
["note_non_literal_nontrivial_dtor"]={ | ["note_non_literal_nontrivial_dtor"]={ | ||
Line 6,885: | Line 6,885: | ||
[c]=o, | [c]=o, | ||
[m]={fb,1317436288,mb}, | [m]={fb,1317436288,mb}, | ||
[n]={{B, | [n]={{B,9380,"/// Ensure that the type T is a literal type.\n///\n/// This routine checks whether the type @p T is a literal type. If @p T is an\n/// incomplete type, an attempt is made to complete it. If @p T is a literal\n/// type, or @p AllowIncompleteType is true and @p T is an incomplete type,\n/// returns false. Otherwise, this routine issues the diagnostic @p PD (giving\n/// it the type @p T), along with notes explaining why the type is not a\n/// literal type, and returns true.\n///\n/// @param Loc The location in the source that the non-literal type\n/// diagnostic should refer to.\n///\n/// @param T The type that this routine is examining for literalness.\n///\n/// @param Diagnoser Emits a diagnostic if T is not a literal type.\n///\n/// @returns @c true if @p T is not a literal type and a diagnostic was emitted,\n/// @c false otherwise.\nbool Sema::RequireLiteralType(SourceLocation Loc, QualType T, TypeDiagnoser &Diagnoser) {\n // If the class has virtual base classes, then it\'s not an aggregate, and\n // cannot have any constexpr constructors or a trivial default constructor,\n // so is non-literal. This is better to diagnose than the resulting absence\n // of constexpr constructors.\n if (RD->getNumVBases()) {\n } else if (!RD->isAggregate() && !RD->hasConstexprNonCopyMoveConstructor() && !RD->hasTrivialDefaultConstructor()) {\n } else if (RD->hasNonLiteralTypeFieldsOrBases()) {\n } else if (getLangOpts().CPlusPlus20 ? !RD->hasConstexprDestructor() : !RD->hasTrivialDestructor()) {\n if (getLangOpts().CPlusPlus20) {\n } else {\n Diag(Dtor->getLocation(), Dtor->isUserProvided() ? diag::note_non_literal_user_provided_dtor : diag::note_non_literal_nontrivial_dtor) << RD;"}} | ||
}, | }, | ||
["note_non_literal_user_provided_dtor"]={ | ["note_non_literal_user_provided_dtor"]={ | ||
Line 6,897: | Line 6,897: | ||
[c]=o, | [c]=o, | ||
[m]={fb,1317436288,mb}, | [m]={fb,1317436288,mb}, | ||
[n]={{B, | [n]={{B,9379,"/// Ensure that the type T is a literal type.\n///\n/// This routine checks whether the type @p T is a literal type. If @p T is an\n/// incomplete type, an attempt is made to complete it. If @p T is a literal\n/// type, or @p AllowIncompleteType is true and @p T is an incomplete type,\n/// returns false. Otherwise, this routine issues the diagnostic @p PD (giving\n/// it the type @p T), along with notes explaining why the type is not a\n/// literal type, and returns true.\n///\n/// @param Loc The location in the source that the non-literal type\n/// diagnostic should refer to.\n///\n/// @param T The type that this routine is examining for literalness.\n///\n/// @param Diagnoser Emits a diagnostic if T is not a literal type.\n///\n/// @returns @c true if @p T is not a literal type and a diagnostic was emitted,\n/// @c false otherwise.\nbool Sema::RequireLiteralType(SourceLocation Loc, QualType T, TypeDiagnoser &Diagnoser) {\n // If the class has virtual base classes, then it\'s not an aggregate, and\n // cannot have any constexpr constructors or a trivial default constructor,\n // so is non-literal. This is better to diagnose than the resulting absence\n // of constexpr constructors.\n if (RD->getNumVBases()) {\n } else if (!RD->isAggregate() && !RD->hasConstexprNonCopyMoveConstructor() && !RD->hasTrivialDefaultConstructor()) {\n } else if (RD->hasNonLiteralTypeFieldsOrBases()) {\n } else if (getLangOpts().CPlusPlus20 ? !RD->hasConstexprDestructor() : !RD->hasTrivialDestructor()) {\n if (getLangOpts().CPlusPlus20) {\n } else {\n Diag(Dtor->getLocation(), Dtor->isUserProvided() ? diag::note_non_literal_user_provided_dtor : diag::note_non_literal_nontrivial_dtor) << RD;"}} | ||
}, | }, | ||
["note_non_literal_virtual_base"]={ | ["note_non_literal_virtual_base"]={ | ||
Line 6,909: | Line 6,909: | ||
[c]=o, | [c]=o, | ||
[m]={fb,1317436288,mb}, | [m]={fb,1317436288,mb}, | ||
[n]={{B, | [n]={{B,9339,"/// Ensure that the type T is a literal type.\n///\n/// This routine checks whether the type @p T is a literal type. If @p T is an\n/// incomplete type, an attempt is made to complete it. If @p T is a literal\n/// type, or @p AllowIncompleteType is true and @p T is an incomplete type,\n/// returns false. Otherwise, this routine issues the diagnostic @p PD (giving\n/// it the type @p T), along with notes explaining why the type is not a\n/// literal type, and returns true.\n///\n/// @param Loc The location in the source that the non-literal type\n/// diagnostic should refer to.\n///\n/// @param T The type that this routine is examining for literalness.\n///\n/// @param Diagnoser Emits a diagnostic if T is not a literal type.\n///\n/// @returns @c true if @p T is not a literal type and a diagnostic was emitted,\n/// @c false otherwise.\nbool Sema::RequireLiteralType(SourceLocation Loc, QualType T, TypeDiagnoser &Diagnoser) {\n // If the class has virtual base classes, then it\'s not an aggregate, and\n // cannot have any constexpr constructors or a trivial default constructor,\n // so is non-literal. This is better to diagnose than the resulting absence\n // of constexpr constructors.\n if (RD->getNumVBases()) {\n Diag(RD->getLocation(), diag::note_non_literal_virtual_base) << getLiteralDiagFromTagKind(RD->getTagKind()) << RD->getNumVBases();"}} | ||
}, | }, | ||
["note_non_null_attribute_failed"]={ | ["note_non_null_attribute_failed"]={ | ||
Line 6,921: | Line 6,921: | ||
[c]=a, | [c]=a, | ||
[m]={"0bb4d46b2be5",1560587576,"[clang] perform semantic checking in constant context"}, | [m]={"0bb4d46b2be5",1560587576,"[clang] perform semantic checking in constant context"}, | ||
[n]={{p, | [n]={{p,6143,"static bool EvaluateCallArg(const ParmVarDecl *PVD, const Expr *Arg, CallRef Call, EvalInfo &Info, bool NonNull = false) {\n // Passing a null pointer to an __attribute__((nonnull)) parameter results in\n // undefined behavior, so is non-constant.\n if (NonNull && V.isLValue() && V.isNullPointer()) {\n Info.CCEDiag(Arg, diag::note_non_null_attribute_failed);"}} | ||
}, | }, | ||
["note_non_template_in_template_id_found"]={ | ["note_non_template_in_template_id_found"]={ | ||
Line 6,933: | Line 6,933: | ||
[c]=o, | [c]=o, | ||
[m]={"42bc73a3f15f",1494383428,"When we see a \'<\' operator, check whether it\'s a probable typo for a template-id."}, | [m]={"42bc73a3f15f",1494383428,"When we see a \'<\' operator, check whether it\'s a probable typo for a template-id."}, | ||
[n]={{u, | [n]={{u,714,"void Sema::diagnoseExprIntendedAsTemplateName(Scope *S, ExprResult TemplateName, SourceLocation Less, SourceLocation Greater) {\n if (TypoCorrection Corrected = CorrectTypo(NameInfo, LookupKind, S, &SS, CCC, CTK_ErrorRecovery, LookupCtx)) {\n if (ND || Corrected.isKeyword()) {\n if (Found)\n Diag(Found->getLocation(), diag::note_non_template_in_template_id_found);"},{u,722,"void Sema::diagnoseExprIntendedAsTemplateName(Scope *S, ExprResult TemplateName, SourceLocation Less, SourceLocation Greater) {\n if (Found)\n Diag(Found->getLocation(), diag::note_non_template_in_template_id_found);"}} | ||
}, | }, | ||
["note_non_trivial_c_union"]={ | ["note_non_trivial_c_union"]={ | ||
Line 6,945: | Line 6,945: | ||
[c]=o, | [c]=o, | ||
[m]={"81b03d4a08b1",1562982435,"[Sema] Diagnose default-initialization, destruction, and copying of"}, | [m]={"81b03d4a08b1",1562982435,"[Sema] Diagnose default-initialization, destruction, and copying of"}, | ||
[n]={{t, | [n]={{t,12916,"struct DiagNonTrivalCUnionDefaultInitializeVisitor : DefaultInitializedTypeVisitor<DiagNonTrivalCUnionDefaultInitializeVisitor, void> {\n void visitARCStrong(QualType QT, const FieldDecl *FD, bool InNonTrivialUnion) {\n if (InNonTrivialUnion)\n S.Diag(FD->getLocation(), diag::note_non_trivial_c_union) << 1 << 0 << QT << FD->getName();"},{t,12922,"struct DiagNonTrivalCUnionDefaultInitializeVisitor : DefaultInitializedTypeVisitor<DiagNonTrivalCUnionDefaultInitializeVisitor, void> {\n void visitARCWeak(QualType QT, const FieldDecl *FD, bool InNonTrivialUnion) {\n if (InNonTrivialUnion)\n S.Diag(FD->getLocation(), diag::note_non_trivial_c_union) << 1 << 0 << QT << FD->getName();"},{t,12942,"struct DiagNonTrivalCUnionDefaultInitializeVisitor : DefaultInitializedTypeVisitor<DiagNonTrivalCUnionDefaultInitializeVisitor, void> {\n void visitStruct(QualType QT, const FieldDecl *FD, bool InNonTrivialUnion) {\n if (InNonTrivialUnion)\n S.Diag(RD->getLocation(), diag::note_non_trivial_c_union) << 0 << 0 << QT.getUnqualifiedType() << \"\";"},{t,12981,"struct DiagNonTrivalCUnionDestructedTypeVisitor : DestructedTypeVisitor<DiagNonTrivalCUnionDestructedTypeVisitor, void> {\n void visitARCStrong(QualType QT, const FieldDecl *FD, bool InNonTrivialUnion) {\n if (InNonTrivialUnion)\n S.Diag(FD->getLocation(), diag::note_non_trivial_c_union) << 1 << 1 << QT << FD->getName();"},{t,12987,"struct DiagNonTrivalCUnionDestructedTypeVisitor : DestructedTypeVisitor<DiagNonTrivalCUnionDestructedTypeVisitor, void> {\n void visitARCWeak(QualType QT, const FieldDecl *FD, bool InNonTrivialUnion) {\n if (InNonTrivialUnion)\n S.Diag(FD->getLocation(), diag::note_non_trivial_c_union) << 1 << 1 << QT << FD->getName();"},{t,13007,"struct DiagNonTrivalCUnionDestructedTypeVisitor : DestructedTypeVisitor<DiagNonTrivalCUnionDestructedTypeVisitor, void> {\n void visitStruct(QualType QT, const FieldDecl *FD, bool InNonTrivialUnion) {\n if (InNonTrivialUnion)\n S.Diag(RD->getLocation(), diag::note_non_trivial_c_union) << 0 << 1 << QT.getUnqualifiedType() << \"\";"},{t,13047,"struct DiagNonTrivalCUnionCopyVisitor : CopiedTypeVisitor<DiagNonTrivalCUnionCopyVisitor, false, void> {\n void visitARCStrong(QualType QT, const FieldDecl *FD, bool InNonTrivialUnion) {\n if (InNonTrivialUnion)\n S.Diag(FD->getLocation(), diag::note_non_trivial_c_union) << 1 << 2 << QT << FD->getName();"},{t,13053,"struct DiagNonTrivalCUnionCopyVisitor : CopiedTypeVisitor<DiagNonTrivalCUnionCopyVisitor, false, void> {\n void visitARCWeak(QualType QT, const FieldDecl *FD, bool InNonTrivialUnion) {\n if (InNonTrivialUnion)\n S.Diag(FD->getLocation(), diag::note_non_trivial_c_union) << 1 << 2 << QT << FD->getName();"},{t,13073,"struct DiagNonTrivalCUnionCopyVisitor : CopiedTypeVisitor<DiagNonTrivalCUnionCopyVisitor, false, void> {\n void visitStruct(QualType QT, const FieldDecl *FD, bool InNonTrivialUnion) {\n if (InNonTrivialUnion)\n S.Diag(RD->getLocation(), diag::note_non_trivial_c_union) << 0 << 2 << QT.getUnqualifiedType() << \"\";"}} | ||
}, | }, | ||
["note_non_usual_function_declared_here"]={ | ["note_non_usual_function_declared_here"]={ | ||
Line 6,957: | Line 6,957: | ||
[c]=o, | [c]=o, | ||
[m]={"fa752f23cc20",1521659988,"[Builtins] Overload __builtin_operator_new/delete to allow forwarding to usual allocation/deallocati..."}, | [m]={"fa752f23cc20",1521659988,"[Builtins] Overload __builtin_operator_new/delete to allow forwarding to usual allocation/deallocati..."}, | ||
[n]={{K, | [n]={{K,3861,"static bool resolveBuiltinNewDeleteOverload(Sema &S, CallExpr *TheCall, bool IsDelete, FunctionDecl *&Operator) {\n case OR_Success: {\n if (!FnDecl->isReplaceableGlobalAllocationFunction()) {\n S.Diag(FnDecl->getLocation(), diag::note_non_usual_function_declared_here) << R.getLookupName() << FnDecl->getSourceRange();"}} | ||
}, | }, | ||
["note_nontemplate_decl_here"]={ | ["note_nontemplate_decl_here"]={ | ||
Line 6,969: | Line 6,969: | ||
[c]=o, | [c]=o, | ||
[m]={"2ec748cd5a66",1242260891,"Implement explicit instantiations of member classes of class templates, e.g.,"}, | [m]={"2ec748cd5a66",1242260891,"Implement explicit instantiations of member classes of class templates, e.g.,"}, | ||
[n]={{u, | [n]={{u,10274,"// Explicit instantiation of a member class of a class template.\nDeclResult Sema::ActOnExplicitInstantiation(Scope *S, SourceLocation ExternLoc, SourceLocation TemplateLoc, unsigned TagSpec, SourceLocation KWLoc, CXXScopeSpec &SS, IdentifierInfo *Name, SourceLocation NameLoc, const ParsedAttributesView &Attr) {\n if (!Pattern) {\n Diag(Record->getLocation(), diag::note_nontemplate_decl_here);"}} | ||
}, | }, | ||
["note_nontrivial_default_arg"]={ | ["note_nontrivial_default_arg"]={ | ||
Line 6,981: | Line 6,981: | ||
[c]=o, | [c]=o, | ||
[m]={pb,1354935182,ub}, | [m]={pb,1354935182,ub}, | ||
[n]={{q, | [n]={{q,10079,"/// Determine whether a defaulted or deleted special member function is trivial,\n/// as specified in C++11 [class.ctor]p5, C++11 [class.copy]p12,\n/// C++11 [class.copy]p25, and C++11 [class.dtor]p5.\nbool Sema::SpecialMemberIsTrivial(CXXMethodDecl *MD, CXXSpecialMember CSM, TrivialABIHandling TAH, bool Diagnose) {\n if (MD->getMinRequiredArguments() < MD->getNumParams()) {\n if (Diagnose)\n Diag(MD->getParamDecl(MD->getMinRequiredArguments())->getLocation(), diag::note_nontrivial_default_arg) << MD->getParamDecl(MD->getMinRequiredArguments())->getSourceRange();"}} | ||
}, | }, | ||
["note_nontrivial_default_member_init"]={ | ["note_nontrivial_default_member_init"]={ | ||
Line 6,993: | Line 6,993: | ||
[c]=o, | [c]=o, | ||
[m]={Y,1582847864,W}, | [m]={Y,1582847864,W}, | ||
[n]={{q, | [n]={{q,9970,"/// Check whether the members of a class type allow a special member to be\n/// trivial.\nstatic bool checkTrivialClassMembers(Sema &S, CXXRecordDecl *RD, Sema::CXXSpecialMember CSM, bool ConstArg, Sema::TrivialABIHandling TAH, bool Diagnose) {\n for (const auto *FI : RD->fields()) {\n // C++11 [class.ctor]p5:\n // A default constructor is trivial if [...]\n // -- no non-static data member of its class has a\n // brace-or-equal-initializer\n if (CSM == Sema::CXXDefaultConstructor && FI->hasInClassInitializer()) {\n if (Diagnose)\n S.Diag(FI->getLocation(), diag::note_nontrivial_default_member_init) << FI;"}} | ||
}, | }, | ||
["note_nontrivial_field"]={ | ["note_nontrivial_field"]={ | ||
Line 7,005: | Line 7,005: | ||
[c]=o, | [c]=o, | ||
[m]={"2be0441e770d",1523992421,"[Sema] Warn about memcpy\'ing non-trivial C structs."}, | [m]={"2be0441e770d",1523992421,"[Sema] Warn about memcpy\'ing non-trivial C structs."}, | ||
[n]={{y, | [n]={{y,12257,"struct SearchNonTrivialToInitializeField : DefaultInitializedTypeVisitor<SearchNonTrivialToInitializeField> {\n void visitARCStrong(QualType FT, SourceLocation SL) { S.DiagRuntimeBehavior(SL, E, S.PDiag(diag::note_nontrivial_field) << 1); }"},{y,12260,"struct SearchNonTrivialToInitializeField : DefaultInitializedTypeVisitor<SearchNonTrivialToInitializeField> {\n void visitARCWeak(QualType FT, SourceLocation SL) { S.DiagRuntimeBehavior(SL, E, S.PDiag(diag::note_nontrivial_field) << 1); }"},{y,12299,"struct SearchNonTrivialToCopyField : CopiedTypeVisitor<SearchNonTrivialToCopyField, false> {\n void visitARCStrong(QualType FT, SourceLocation SL) { S.DiagRuntimeBehavior(SL, E, S.PDiag(diag::note_nontrivial_field) << 0); }"},{y,12302,"struct SearchNonTrivialToCopyField : CopiedTypeVisitor<SearchNonTrivialToCopyField, false> {\n void visitARCWeak(QualType FT, SourceLocation SL) { S.DiagRuntimeBehavior(SL, E, S.PDiag(diag::note_nontrivial_field) << 0); }"}} | ||
}, | }, | ||
["note_nontrivial_has_virtual"]={ | ["note_nontrivial_has_virtual"]={ | ||
Line 7,017: | Line 7,017: | ||
[c]=o, | [c]=o, | ||
[m]={"8a27391190de",1248287124,"\"This patch implements the restrictions on union members detailed in"}, | [m]={"8a27391190de",1248287124,"\"This patch implements the restrictions on union members detailed in"}, | ||
[n]={{q, | [n]={{q,10139,"/// Determine whether a defaulted or deleted special member function is trivial,\n/// as specified in C++11 [class.ctor]p5, C++11 [class.copy]p12,\n/// C++11 [class.copy]p25, and C++11 [class.dtor]p5.\nbool Sema::SpecialMemberIsTrivial(CXXMethodDecl *MD, CXXSpecialMember CSM, TrivialABIHandling TAH, bool Diagnose) {\n // C++11 [class.ctor]p5, C++11 [class.copy]p12, C++11 [class.copy]p25:\n // A [special member] for class X is trivial if [...]\n // -- class X has no virtual functions and no virtual base classes\n if (CSM != CXXDestructor && MD->getParent()->isDynamicClass()) {\n if (RD->getNumVBases()) {\n Diag(BS.getBeginLoc(), diag::note_nontrivial_has_virtual) << RD << 1;"},{q,10147,"/// Determine whether a defaulted or deleted special member function is trivial,\n/// as specified in C++11 [class.ctor]p5, C++11 [class.copy]p12,\n/// C++11 [class.copy]p25, and C++11 [class.dtor]p5.\nbool Sema::SpecialMemberIsTrivial(CXXMethodDecl *MD, CXXSpecialMember CSM, TrivialABIHandling TAH, bool Diagnose) {\n // C++11 [class.ctor]p5, C++11 [class.copy]p12, C++11 [class.copy]p25:\n // A [special member] for class X is trivial if [...]\n // -- class X has no virtual functions and no virtual base classes\n if (CSM != CXXDestructor && MD->getParent()->isDynamicClass()) {\n // Must have a virtual method.\n for (const auto *MI : RD->methods()) {\n if (MI->isVirtual()) {\n Diag(MLoc, diag::note_nontrivial_has_virtual) << RD << 0;"}} | ||
}, | }, | ||
["note_nontrivial_no_copy"]={ | ["note_nontrivial_no_copy"]={ | ||
Line 7,029: | Line 7,029: | ||
[c]=o, | [c]=o, | ||
[m]={pb,1354935182,ub}, | [m]={pb,1354935182,ub}, | ||
[n]={{q, | [n]={{q,9918,"/// Check whether the special member selected for a given type would be trivial.\nstatic bool checkTrivialSubobjectCall(Sema &S, SourceLocation SubobjLoc, QualType SubType, bool ConstRHS, Sema::CXXSpecialMember CSM, TrivialSubobjectKind Kind, Sema::TrivialABIHandling TAH, bool Diagnose) {\n if (Diagnose) {\n if (!Selected && CSM == Sema::CXXDefaultConstructor) {\n } else if (!Selected)\n S.Diag(SubobjLoc, diag::note_nontrivial_no_copy) << Kind << SubType.getUnqualifiedType() << CSM << SubType;"}} | ||
}, | }, | ||
["note_nontrivial_no_def_ctor"]={ | ["note_nontrivial_no_def_ctor"]={ | ||
Line 7,041: | Line 7,041: | ||
[c]=o, | [c]=o, | ||
[m]={pb,1354935182,ub}, | [m]={pb,1354935182,ub}, | ||
[n]={{q, | [n]={{q,9913,"/// Check whether the special member selected for a given type would be trivial.\nstatic bool checkTrivialSubobjectCall(Sema &S, SourceLocation SubobjLoc, QualType SubType, bool ConstRHS, Sema::CXXSpecialMember CSM, TrivialSubobjectKind Kind, Sema::TrivialABIHandling TAH, bool Diagnose) {\n if (Diagnose) {\n if (!Selected && CSM == Sema::CXXDefaultConstructor) {\n S.Diag(SubobjLoc, diag::note_nontrivial_no_def_ctor) << Kind << SubType.getUnqualifiedType();"}} | ||
}, | }, | ||
["note_nontrivial_objc_ownership"]={ | ["note_nontrivial_objc_ownership"]={ | ||
Line 7,053: | Line 7,053: | ||
[c]=o, | [c]=o, | ||
[m]={"cff00d9c127c",1308874139,"Rename objc_lifetime -> objc_ownership, and modify diagnostics to talk about \'ownership\', not \'lifet..."}, | [m]={"cff00d9c127c",1308874139,"Rename objc_lifetime -> objc_ownership, and modify diagnostics to talk about \'ownership\', not \'lifet..."}, | ||
[n]={{q, | [n]={{q,9981,"/// Check whether the members of a class type allow a special member to be\n/// trivial.\nstatic bool checkTrivialClassMembers(Sema &S, CXXRecordDecl *RD, Sema::CXXSpecialMember CSM, bool ConstArg, Sema::TrivialABIHandling TAH, bool Diagnose) {\n for (const auto *FI : RD->fields()) {\n // Objective C ARC 4.3.5:\n // [...] nontrivally ownership-qualified types are [...] not trivially\n // default constructible, copy constructible, move constructible, copy\n // assignable, move assignable, or destructible [...]\n if (FieldType.hasNonTrivialObjCLifetime()) {\n if (Diagnose)\n S.Diag(FI->getLocation(), diag::note_nontrivial_objc_ownership) << RD << FieldType.getObjCLifetime();"}} | ||
}, | }, | ||
["note_nontrivial_param_type"]={ | ["note_nontrivial_param_type"]={ | ||
Line 7,065: | Line 7,065: | ||
[c]=o, | [c]=o, | ||
[m]={pb,1354935182,ub}, | [m]={pb,1354935182,ub}, | ||
[n]={{q, | [n]={{q,10045,"/// Determine whether a defaulted or deleted special member function is trivial,\n/// as specified in C++11 [class.ctor]p5, C++11 [class.copy]p12,\n/// C++11 [class.copy]p25, and C++11 [class.dtor]p5.\nbool Sema::SpecialMemberIsTrivial(CXXMethodDecl *MD, CXXSpecialMember CSM, TrivialABIHandling TAH, bool Diagnose) {\n case CXXCopyAssignment: {\n if (!RT || ((RT->getPointeeType().getCVRQualifiers() != Qualifiers::Const) && ClangABICompat14)) {\n if (Diagnose)\n Diag(Param0->getLocation(), diag::note_nontrivial_param_type) << Param0->getSourceRange() << Param0->getType() << Context.getLValueReferenceType(Context.getRecordType(RD).withConst());"},{q,10064,"/// Determine whether a defaulted or deleted special member function is trivial,\n/// as specified in C++11 [class.ctor]p5, C++11 [class.copy]p12,\n/// C++11 [class.copy]p25, and C++11 [class.dtor]p5.\nbool Sema::SpecialMemberIsTrivial(CXXMethodDecl *MD, CXXSpecialMember CSM, TrivialABIHandling TAH, bool Diagnose) {\n case CXXMoveAssignment: {\n if (!RT || RT->getPointeeType().getCVRQualifiers()) {\n if (Diagnose)\n Diag(Param0->getLocation(), diag::note_nontrivial_param_type) << Param0->getSourceRange() << Param0->getType() << Context.getRValueReferenceType(Context.getRecordType(RD));"}} | ||
}, | }, | ||
["note_nontrivial_subobject"]={ | ["note_nontrivial_subobject"]={ | ||
Line 7,077: | Line 7,077: | ||
[c]=o, | [c]=o, | ||
[m]={pb,1354935182,ub}, | [m]={pb,1354935182,ub}, | ||
[n]={{q, | [n]={{q,9931,"/// Check whether the special member selected for a given type would be trivial.\nstatic bool checkTrivialSubobjectCall(Sema &S, SourceLocation SubobjLoc, QualType SubType, bool ConstRHS, Sema::CXXSpecialMember CSM, TrivialSubobjectKind Kind, Sema::TrivialABIHandling TAH, bool Diagnose) {\n if (Diagnose) {\n if (!Selected && CSM == Sema::CXXDefaultConstructor) {\n } else if (!Selected)\n else if (Selected->isUserProvided()) {\n } else {\n if (Kind != TSK_CompleteObject)\n S.Diag(SubobjLoc, diag::note_nontrivial_subobject) << Kind << SubType.getUnqualifiedType() << CSM;"}} | ||
}, | }, | ||
["note_nontrivial_user_provided"]={ | ["note_nontrivial_user_provided"]={ | ||
Line 7,089: | Line 7,089: | ||
[c]=o, | [c]=o, | ||
[m]={pb,1354935182,ub}, | [m]={pb,1354935182,ub}, | ||
[n]={{q, | [n]={{q,9922,"/// Check whether the special member selected for a given type would be trivial.\nstatic bool checkTrivialSubobjectCall(Sema &S, SourceLocation SubobjLoc, QualType SubType, bool ConstRHS, Sema::CXXSpecialMember CSM, TrivialSubobjectKind Kind, Sema::TrivialABIHandling TAH, bool Diagnose) {\n if (Diagnose) {\n if (!Selected && CSM == Sema::CXXDefaultConstructor) {\n } else if (!Selected)\n else if (Selected->isUserProvided()) {\n if (Kind == TSK_CompleteObject)\n S.Diag(Selected->getLocation(), diag::note_nontrivial_user_provided) << Kind << SubType.getUnqualifiedType() << CSM;"},{q,9925,"/// Check whether the special member selected for a given type would be trivial.\nstatic bool checkTrivialSubobjectCall(Sema &S, SourceLocation SubobjLoc, QualType SubType, bool ConstRHS, Sema::CXXSpecialMember CSM, TrivialSubobjectKind Kind, Sema::TrivialABIHandling TAH, bool Diagnose) {\n if (Diagnose) {\n if (!Selected && CSM == Sema::CXXDefaultConstructor) {\n } else if (!Selected)\n else if (Selected->isUserProvided()) {\n if (Kind == TSK_CompleteObject)\n else {\n S.Diag(SubobjLoc, diag::note_nontrivial_user_provided) << Kind << SubType.getUnqualifiedType() << CSM;"}} | ||
}, | }, | ||
["note_nontrivial_variadic"]={ | ["note_nontrivial_variadic"]={ | ||
Line 7,101: | Line 7,101: | ||
[c]=o, | [c]=o, | ||
[m]={pb,1354935182,ub}, | [m]={pb,1354935182,ub}, | ||
[n]={{q, | [n]={{q,10085,"/// Determine whether a defaulted or deleted special member function is trivial,\n/// as specified in C++11 [class.ctor]p5, C++11 [class.copy]p12,\n/// C++11 [class.copy]p25, and C++11 [class.dtor]p5.\nbool Sema::SpecialMemberIsTrivial(CXXMethodDecl *MD, CXXSpecialMember CSM, TrivialABIHandling TAH, bool Diagnose) {\n if (MD->isVariadic()) {\n if (Diagnose)\n Diag(MD->getLocation(), diag::note_nontrivial_variadic);"}} | ||
}, | }, | ||
["note_nontrivial_virtual_dtor"]={ | ["note_nontrivial_virtual_dtor"]={ | ||
Line 7,113: | Line 7,113: | ||
[c]=o, | [c]=o, | ||
[m]={pb,1354935182,ub}, | [m]={pb,1354935182,ub}, | ||
[n]={{q, | [n]={{q,10123,"/// Determine whether a defaulted or deleted special member function is trivial,\n/// as specified in C++11 [class.ctor]p5, C++11 [class.copy]p12,\n/// C++11 [class.copy]p25, and C++11 [class.dtor]p5.\nbool Sema::SpecialMemberIsTrivial(CXXMethodDecl *MD, CXXSpecialMember CSM, TrivialABIHandling TAH, bool Diagnose) {\n // C++11 [class.dtor]p5:\n // A destructor is trivial if [...]\n // -- the destructor is not virtual\n if (CSM == CXXDestructor && MD->isVirtual()) {\n if (Diagnose)\n Diag(MD->getLocation(), diag::note_nontrivial_virtual_dtor) << RD;"}} | ||
}, | }, | ||
["note_not_found_by_two_phase_lookup"]={ | ["note_not_found_by_two_phase_lookup"]={ | ||
Line 7,125: | Line 7,125: | ||
[c]=o, | [c]=o, | ||
[m]={"998a591e3261",1307313768,"Fix PR10053: Improve diagnostics and error recovery for code which some compilers incorrectly accept..."}, | [m]={"998a591e3261",1307313768,"Fix PR10053: Improve diagnostics and error recovery for code which some compilers incorrectly accept..."}, | ||
[n]={{P, | [n]={{P,13207,"/// Attempt to recover from an ill-formed use of a non-dependent name in a\n/// template, where the non-dependent name was declared after the template\n/// was defined. This is common in code written for a compilers which do not\n/// correctly implement two-stage name lookup.\n///\n/// Returns true if a viable candidate was found and a diagnostic was issued.\nstatic bool DiagnoseTwoPhaseLookup(Sema &SemaRef, SourceLocation FnLoc, const CXXScopeSpec &SS, LookupResult &R, OverloadCandidateSet::CandidateSetKind CSK, TemplateArgumentListInfo *ExplicitTemplateArgs, ArrayRef<Expr *> Args, CXXRecordDecl **FoundInClass = nullptr) {\n for (DeclContext *DC = SemaRef.CurContext; DC; DC = DC->getParent()) {\n if (!R.empty()) {\n if (SuggestedNamespaces.empty()) {\n SemaRef.Diag(Best->Function->getLocation(), diag::note_not_found_by_two_phase_lookup) << R.getLookupName() << 0;"},{P,13211,"/// Attempt to recover from an ill-formed use of a non-dependent name in a\n/// template, where the non-dependent name was declared after the template\n/// was defined. This is common in code written for a compilers which do not\n/// correctly implement two-stage name lookup.\n///\n/// Returns true if a viable candidate was found and a diagnostic was issued.\nstatic bool DiagnoseTwoPhaseLookup(Sema &SemaRef, SourceLocation FnLoc, const CXXScopeSpec &SS, LookupResult &R, OverloadCandidateSet::CandidateSetKind CSK, TemplateArgumentListInfo *ExplicitTemplateArgs, ArrayRef<Expr *> Args, CXXRecordDecl **FoundInClass = nullptr) {\n for (DeclContext *DC = SemaRef.CurContext; DC; DC = DC->getParent()) {\n if (!R.empty()) {\n if (SuggestedNamespaces.empty()) {\n } else if (SuggestedNamespaces.size() == 1) {\n SemaRef.Diag(Best->Function->getLocation(), diag::note_not_found_by_two_phase_lookup) << R.getLookupName() << 1 << *SuggestedNamespaces.begin();"},{P,13218,"/// Attempt to recover from an ill-formed use of a non-dependent name in a\n/// template, where the non-dependent name was declared after the template\n/// was defined. This is common in code written for a compilers which do not\n/// correctly implement two-stage name lookup.\n///\n/// Returns true if a viable candidate was found and a diagnostic was issued.\nstatic bool DiagnoseTwoPhaseLookup(Sema &SemaRef, SourceLocation FnLoc, const CXXScopeSpec &SS, LookupResult &R, OverloadCandidateSet::CandidateSetKind CSK, TemplateArgumentListInfo *ExplicitTemplateArgs, ArrayRef<Expr *> Args, CXXRecordDecl **FoundInClass = nullptr) {\n for (DeclContext *DC = SemaRef.CurContext; DC; DC = DC->getParent()) {\n if (!R.empty()) {\n if (SuggestedNamespaces.empty()) {\n } else if (SuggestedNamespaces.size() == 1) {\n } else {\n SemaRef.Diag(Best->Function->getLocation(), diag::note_not_found_by_two_phase_lookup) << R.getLookupName() << 2;"}} | ||
}, | }, | ||
["note_not_module_interface_add_export"]={ | ["note_not_module_interface_add_export"]={ | ||
Line 7,137: | Line 7,137: | ||
[c]=Sb, | [c]=Sb, | ||
[m]={"a5bbbfef156c",1555621974,"[c++2a] Add semantic support for private module fragments."}, | [m]={"a5bbbfef156c",1555621974,"[c++2a] Add semantic support for private module fragments."}, | ||
[n]={{cb, | [n]={{cb,448,"Sema::DeclGroupPtrTy Sema::ActOnPrivateModuleFragmentDecl(SourceLocation ModuleLoc, SourceLocation PrivateLoc) {\n case Module::ModuleImplementationUnit:\n Diag(ModuleScopes.back().BeginLoc, diag::note_not_module_interface_add_export) << FixItHint::CreateInsertion(ModuleScopes.back().BeginLoc, \"export \");"},{cb,772,"/// We have parsed the start of an export declaration, including the \'{\'\n/// (if present).\nDecl *Sema::ActOnStartExportDecl(Scope *S, SourceLocation ExportLoc, SourceLocation LBraceLoc) {\n // C++2a [module.interface]p1:\n // An export-declaration shall appear only [...] in the purview of a module\n // interface unit. An export-declaration shall not appear directly or\n // indirectly within [...] a private-module-fragment.\n if (!isCurrentModulePurview()) {\n } else if (!ModuleScopes.back().ModuleInterface) {\n Diag(ModuleScopes.back().BeginLoc, diag::note_not_module_interface_add_export) << FixItHint::CreateInsertion(ModuleScopes.back().BeginLoc, \"export \");"}} | ||
}, | }, | ||
["note_not_structural_mutable_field"]={ | ["note_not_structural_mutable_field"]={ | ||
Line 7,149: | Line 7,149: | ||
[c]=o, | [c]=o, | ||
[m]={Y,1582847864,W}, | [m]={Y,1582847864,W}, | ||
[n]={{u, | [n]={{u,1370,"/// Require the given type to be a structural type, and diagnose if it is not.\n///\n/// \\return \\c true if an error was produced.\nbool Sema::RequireStructuralType(QualType T, SourceLocation Loc) {\n // Drill down into the reason why the class is non-structural.\n while (const CXXRecordDecl *RD = T->getAsCXXRecordDecl()) {\n // All members are required to be public and non-mutable, and can\'t be of\n // rvalue reference type. Check these conditions first to prefer a \"local\"\n // reason over a more distant one.\n for (const FieldDecl *FD : RD->fields()) {\n if (FD->isMutable()) {\n Diag(FD->getLocation(), diag::note_not_structural_mutable_field) << T;"}} | ||
}, | }, | ||
["note_not_structural_non_public"]={ | ["note_not_structural_non_public"]={ | ||
Line 7,161: | Line 7,161: | ||
[c]=o, | [c]=o, | ||
[m]={Y,1582847864,W}, | [m]={Y,1582847864,W}, | ||
[n]={{u, | [n]={{u,1366,"/// Require the given type to be a structural type, and diagnose if it is not.\n///\n/// \\return \\c true if an error was produced.\nbool Sema::RequireStructuralType(QualType T, SourceLocation Loc) {\n // Drill down into the reason why the class is non-structural.\n while (const CXXRecordDecl *RD = T->getAsCXXRecordDecl()) {\n // All members are required to be public and non-mutable, and can\'t be of\n // rvalue reference type. Check these conditions first to prefer a \"local\"\n // reason over a more distant one.\n for (const FieldDecl *FD : RD->fields()) {\n if (FD->getAccess() != AS_public) {\n Diag(FD->getLocation(), diag::note_not_structural_non_public) << T << 0;"},{u,1383,"/// Require the given type to be a structural type, and diagnose if it is not.\n///\n/// \\return \\c true if an error was produced.\nbool Sema::RequireStructuralType(QualType T, SourceLocation Loc) {\n // Drill down into the reason why the class is non-structural.\n while (const CXXRecordDecl *RD = T->getAsCXXRecordDecl()) {\n // All bases are required to be public.\n for (const auto &BaseSpec : RD->bases()) {\n if (BaseSpec.getAccessSpecifier() != AS_public) {\n Diag(BaseSpec.getBaseTypeLoc(), diag::note_not_structural_non_public) << T << 1;"}} | ||
}, | }, | ||
["note_not_structural_rvalue_ref_field"]={ | ["note_not_structural_rvalue_ref_field"]={ | ||
Line 7,173: | Line 7,173: | ||
[c]=o, | [c]=o, | ||
[m]={Y,1582847864,W}, | [m]={Y,1582847864,W}, | ||
[n]={{u, | [n]={{u,1374,"/// Require the given type to be a structural type, and diagnose if it is not.\n///\n/// \\return \\c true if an error was produced.\nbool Sema::RequireStructuralType(QualType T, SourceLocation Loc) {\n // Drill down into the reason why the class is non-structural.\n while (const CXXRecordDecl *RD = T->getAsCXXRecordDecl()) {\n // All members are required to be public and non-mutable, and can\'t be of\n // rvalue reference type. Check these conditions first to prefer a \"local\"\n // reason over a more distant one.\n for (const FieldDecl *FD : RD->fields()) {\n if (FD->getType()->isRValueReferenceType()) {\n Diag(FD->getLocation(), diag::note_not_structural_rvalue_ref_field) << T;"}} | ||
}, | }, | ||
["note_not_structural_subobject"]={ | ["note_not_structural_subobject"]={ | ||
Line 7,185: | Line 7,185: | ||
[c]=o, | [c]=o, | ||
[m]={Y,1582847864,W}, | [m]={Y,1582847864,W}, | ||
[n]={{u, | [n]={{u,1417,"/// Require the given type to be a structural type, and diagnose if it is not.\n///\n/// \\return \\c true if an error was produced.\nbool Sema::RequireStructuralType(QualType T, SourceLocation Loc) {\n // Drill down into the reason why the class is non-structural.\n while (const CXXRecordDecl *RD = T->getAsCXXRecordDecl()) {\n Diag(SubLoc, diag::note_not_structural_subobject) << T << Kind << SubType;"}} | ||
}, | }, | ||
["note_nsdictionary_duplicate_key_here"]={ | ["note_nsdictionary_duplicate_key_here"]={ | ||
Line 7,197: | Line 7,197: | ||
[c]=o, | [c]=o, | ||
[m]={yb,1576908663,Db}, | [m]={yb,1576908663,Db}, | ||
[n]={{s, | [n]={{s,923,"/// Check for duplicate keys in an ObjC dictionary literal. For instance:\n/// NSDictionary *nd = @{ @\"foo\" : @\"bar\", @\"foo\" : @\"baz\" };\nstatic void CheckObjCDictionaryLiteralDuplicateKeys(Sema &S, ObjCDictionaryLiteral *Literal) {\n auto checkOneKey = [&](auto &Map, const auto &Key, SourceLocation Loc) {\n if (!Pair.second) {\n S.Diag(Pair.first->second, diag::note_nsdictionary_duplicate_key_here);"}} | ||
}, | }, | ||
["note_nullability_fix_it"]={ | ["note_nullability_fix_it"]={ | ||
Line 7,209: | Line 7,209: | ||
[c]="Nullability Issue", | [c]="Nullability Issue", | ||
[m]={"06dd406e27b4",1482181100,"Add fix-it notes to the nullability consistency warning."}, | [m]={"06dd406e27b4",1482181100,"Add fix-it notes to the nullability consistency warning."}, | ||
[n]={{B, | [n]={{B,4476,"static void emitNullabilityConsistencyWarning(Sema &S, SimplePointerKind PointerKind, SourceLocation PointerLoc, SourceLocation PointerEndLoc) {\n auto addFixIt = [&](NullabilityKind Nullability) {\n auto Diag = S.Diag(FixItLoc, diag::note_nullability_fix_it);"}} | ||
}, | }, | ||
["note_nullability_here"]={ | ["note_nullability_here"]={ | ||
Line 7,221: | Line 7,221: | ||
[c]="Nullability Issue", | [c]="Nullability Issue", | ||
[m]={"261a89b0f70b",1434736265,"Introduce type nullability specifiers for C/C++."}, | [m]={"261a89b0f70b",1434736265,"Introduce type nullability specifiers for C/C++."}, | ||
[n]={{B, | [n]={{B,7527,"/// Applies a nullability type specifier to the given type, if possible.\n///\n/// \\param state The type processing state.\n///\n/// \\param type The type to which the nullability specifier will be\n/// added. On success, this type will be updated appropriately.\n///\n/// \\param attr The attribute as written on the type.\n///\n/// \\param allowOnArrayType Whether to accept nullability specifiers on an\n/// array type (e.g., because it will decay to a pointer).\n///\n/// \\returns true if a problem has been diagnosed, false on success.\nstatic bool checkNullabilityTypeSpecifier(TypeProcessingState &state, QualType &type, ParsedAttr &attr, bool allowOnArrayType) {\n // If there is already a different nullability specifier, complain.\n // This (unlike the code above) looks through typedefs that might\n // have nullability specifiers on them, which means we cannot\n // provide a useful Fix-It.\n if (auto existingNullability = desugared->getNullability()) {\n if (nullability != *existingNullability) {\n // Try to find the typedef with the existing nullability specifier.\n if (auto typedefType = desugared->getAs<TypedefType>()) {\n if (auto typedefNullability = AttributedType::stripOuterNullability(underlyingType)) {\n if (*typedefNullability == *existingNullability) {\n S.Diag(typedefDecl->getLocation(), diag::note_nullability_here) << DiagNullabilityKind(*existingNullability, false);"}} | ||
}, | }, | ||
["note_nullability_type_specifier"]={ | ["note_nullability_type_specifier"]={ | ||
Line 7,233: | Line 7,233: | ||
[c]="Nullability Issue", | [c]="Nullability Issue", | ||
[m]={"813a066f16df",1434737678,"Extend type nullability qualifiers for Objective-C."}, | [m]={"813a066f16df",1434737678,"Extend type nullability qualifiers for Objective-C."}, | ||
[n]={{B, | [n]={{B,7561,"/// Applies a nullability type specifier to the given type, if possible.\n///\n/// \\param state The type processing state.\n///\n/// \\param type The type to which the nullability specifier will be\n/// added. On success, this type will be updated appropriately.\n///\n/// \\param attr The attribute as written on the type.\n///\n/// \\param allowOnArrayType Whether to accept nullability specifiers on an\n/// array type (e.g., because it will decay to a pointer).\n///\n/// \\returns true if a problem has been diagnosed, false on success.\nstatic bool checkNullabilityTypeSpecifier(TypeProcessingState &state, QualType &type, ParsedAttr &attr, bool allowOnArrayType) {\n // For the context-sensitive keywords/Objective-C property\n // attributes, require that the type be a single-level pointer.\n if (isContextSensitive) {\n if (pointeeType && (pointeeType->isAnyPointerType() || pointeeType->isObjCObjectPointerType() || pointeeType->isMemberPointerType())) {\n S.Diag(nullabilityLoc, diag::note_nullability_type_specifier) << DiagNullabilityKind(nullability, false) << type << FixItHint::CreateReplacement(nullabilityLoc, getNullabilitySpelling(nullability));"}} | ||
}, | }, | ||
["note_objc_circular_container_declared_here"]={ | ["note_objc_circular_container_declared_here"]={ | ||
Line 7,245: | Line 7,245: | ||
[c]=o, | [c]=o, | ||
[m]={"e1d882c726b5",1425491752,"New ObjC warning: circular containers."}, | [m]={"e1d882c726b5",1425491752,"New ObjC warning: circular containers."}, | ||
[n]={{y, | [n]={{y,17647,"void Sema::CheckObjCCircularContainer(ObjCMessageExpr *Message) {\n if (Message->getReceiverKind() == ObjCMessageExpr::SuperInstance) {\n } else {\n if (DeclRefExpr *ReceiverRE = dyn_cast<DeclRefExpr>(Receiver)) {\n if (DeclRefExpr *ArgRE = dyn_cast<DeclRefExpr>(Arg)) {\n if (ReceiverRE->getDecl() == ArgRE->getDecl()) {\n if (!ArgRE->isObjCSelfExpr()) {\n Diag(Decl->getLocation(), diag::note_objc_circular_container_declared_here) << Decl;"},{y,17660,"void Sema::CheckObjCCircularContainer(ObjCMessageExpr *Message) {\n if (Message->getReceiverKind() == ObjCMessageExpr::SuperInstance) {\n } else {\n if (DeclRefExpr *ReceiverRE = dyn_cast<DeclRefExpr>(Receiver)) {\n } else if (ObjCIvarRefExpr *IvarRE = dyn_cast<ObjCIvarRefExpr>(Receiver)) {\n if (ObjCIvarRefExpr *IvarArgRE = dyn_cast<ObjCIvarRefExpr>(Arg)) {\n if (IvarRE->getDecl() == IvarArgRE->getDecl()) {\n Diag(Decl->getLocation(), diag::note_objc_circular_container_declared_here) << Decl;"}} | ||
}, | }, | ||
["note_objc_container_start"]={ | ["note_objc_container_start"]={ | ||
Line 7,257: | Line 7,257: | ||
[c]=Q, | [c]=Q, | ||
[m]={"c6c8d9356dc0",1323163523,"Extend warnings for missing \'@end\'."}, | [m]={"c6c8d9356dc0",1323163523,"Extend warnings for missing \'@end\'."}, | ||
[n]={{Kb, | [n]={{Kb,204,"void Parser::CheckNestedObjCContexts(SourceLocation AtLoc) {\n if (Decl)\n Diag(Decl->getBeginLoc(), diag::note_objc_container_start) << (int)ock;"},{Kb,747,"/// objc-interface-decl-list:\n/// empty\n/// objc-interface-decl-list objc-property-decl [OBJC2]\n/// objc-interface-decl-list objc-method-requirement [OBJC2]\n/// objc-interface-decl-list objc-method-proto \';\'\n/// objc-interface-decl-list declaration\n/// objc-interface-decl-list \';\'\n///\n/// objc-method-requirement: [OBJC2]\n/// @required\n/// @optional\n///\nvoid Parser::ParseObjCInterfaceDeclList(tok::ObjCKeywordKind contextKey, Decl *CDecl) {\n while (true) {\n case tok::objc_interface:\n Diag(CDecl->getBeginLoc(), diag::note_objc_container_start) << (int)Actions.getObjCContainerKind();"},{Kb,831,"/// objc-interface-decl-list:\n/// empty\n/// objc-interface-decl-list objc-property-decl [OBJC2]\n/// objc-interface-decl-list objc-method-requirement [OBJC2]\n/// objc-interface-decl-list objc-method-proto \';\'\n/// objc-interface-decl-list declaration\n/// objc-interface-decl-list \';\'\n///\n/// objc-method-requirement: [OBJC2]\n/// @required\n/// @optional\n///\nvoid Parser::ParseObjCInterfaceDeclList(tok::ObjCKeywordKind contextKey, Decl *CDecl) {\n // We break out of the big loop in two cases: when we see @end or when we see\n // EOF. In the former case, eat the @end. In the later case, emit an error.\n if (Tok.is(tok::code_completion)) {\n } else if (Tok.isObjCAtKeyword(tok::objc_end)) {\n } else {\n Diag(CDecl->getBeginLoc(), diag::note_objc_container_start) << (int)Actions.getObjCContainerKind();"},{Kb,2309,"Parser::ObjCImplParsingDataRAII::~ObjCImplParsingDataRAII() {\n if (!Finished) {\n if (P.isEofOrEom()) {\n P.Diag(Dcl->getBeginLoc(), diag::note_objc_container_start) << Sema::OCK_Implementation;"}} | ||
}, | }, | ||
["note_objc_designated_init_marked_here"]={ | ["note_objc_designated_init_marked_here"]={ | ||
Line 7,269: | Line 7,269: | ||
[c]=o, | [c]=o, | ||
[m]={"22bfa2c28bdb",1386105096,"[objc] Emit a warning when the implementation of a designated initializer does not chain to"}, | [m]={"22bfa2c28bdb",1386105096,"[objc] Emit a warning when the implementation of a designated initializer does not chain to"}, | ||
[n]={{t, | [n]={{t,15853,"Decl *Sema::ActOnFinishFunctionBody(Decl *dcl, Stmt *Body, bool IsInstantiation) {\n {\n if (FD) {\n } else if (ObjCMethodDecl *MD = dyn_cast_or_null<ObjCMethodDecl>(dcl)) {\n if (FSI->ObjCWarnForNoDesignatedInitChain) {\n // Don\'t issue this warning for unavailable inits or direct subclasses\n // of NSObject.\n if (!MD->isUnavailable() && !superIsNSObject(MD)) {\n Diag(InitMethod->getLocation(), diag::note_objc_designated_init_marked_here);"},{s,3211,"/// Build an Objective-C instance message expression.\n///\n/// This routine takes care of both normal instance messages and\n/// instance messages to the superclass instance.\n///\n/// \\param Receiver The expression that computes the object that will\n/// receive this message. This may be empty, in which case we are\n/// sending to the superclass instance and \\p SuperLoc must be a valid\n/// source location.\n///\n/// \\param ReceiverType The (static) type of the object receiving the\n/// message. When a \\p Receiver expression is provided, this is the\n/// same type as that expression. For a superclass instance send, this\n/// is a pointer to the type of the superclass.\n///\n/// \\param SuperLoc The location of the \"super\" keyword in a\n/// superclass instance message.\n///\n/// \\param Sel The selector to which the message is being sent.\n///\n/// \\param Method The method that this instance message is invoking, if\n/// already known.\n///\n/// \\param LBracLoc The location of the opening square bracket \']\'.\n///\n/// \\param RBracLoc The location of the closing square bracket \']\'.\n///\n/// \\param ArgsIn The message arguments.\nExprResult Sema::BuildInstanceMessage(Expr *Receiver, QualType ReceiverType, SourceLocation SuperLoc, Selector Sel, ObjCMethodDecl *Method, SourceLocation LBracLoc, ArrayRef<SourceLocation> SelectorLocs, SourceLocation RBracLoc, MultiExprArg ArgsIn, bool isImplicit) {\n if (DIFunctionScopeInfo && DIFunctionScopeInfo->ObjCIsDesignatedInit && (SuperLoc.isValid() || isSelfExpr(Receiver))) {\n if (!isDesignatedInitChain) {\n Diag(InitMethod->getLocation(), diag::note_objc_designated_init_marked_here);"},{N,2352,"void Sema::DiagnoseMissingDesignatedInitOverrides(const ObjCImplementationDecl *ImplD, const ObjCInterfaceDecl *IFD) {\n for (SmallVector<const ObjCMethodDecl *, 8>::iterator I = DesignatedInits.begin(), E = DesignatedInits.end(); I != E; ++I) {\n if (!InitSelSet.count(MD->getSelector())) {\n if (!Ignore) {\n Diag(MD->getLocation(), diag::note_objc_designated_init_marked_here);"}} | ||
}, | }, | ||
["note_objc_literal_comparison_isequal"]={ | ["note_objc_literal_comparison_isequal"]={ | ||
Line 7,281: | Line 7,281: | ||
[c]=o, | [c]=o, | ||
[m]={"7660f78fb95b",1342547200,"Now that -Wobjc-literal-compare is a warning, put the fixit on a note."}, | [m]={"7660f78fb95b",1342547200,"Now that -Wobjc-literal-compare is a warning, put the fixit on a note."}, | ||
[n]={{r, | [n]={{r,12537,"static void diagnoseObjCLiteralComparison(Sema &S, SourceLocation Loc, ExprResult &LHS, ExprResult &RHS, BinaryOperator::Opcode Opc) {\n if (BinaryOperator::isEqualityOp(Opc) && hasIsEqualMethod(S, LHS.get(), RHS.get())) {\n S.Diag(Loc, diag::note_objc_literal_comparison_isequal) << FixItHint::CreateInsertion(Start, Opc == BO_EQ ? \"[\" : \"![\") << FixItHint::CreateReplacement(OpRange, \" isEqual:\") << FixItHint::CreateInsertion(End, \"]\");"}} | ||
}, | }, | ||
["note_objc_literal_method_param"]={ | ["note_objc_literal_method_param"]={ | ||
Line 7,293: | Line 7,293: | ||
[c]=o, | [c]=o, | ||
[m]={"e65b086e07a6",1331064356,"Add clang support for new Objective-C literal syntax for NSDictionary, NSArray,"}, | [m]={"e65b086e07a6",1331064356,"Add clang support for new Objective-C literal syntax for NSDictionary, NSArray,"}, | ||
[n]={{s, | [n]={{s,852,"ExprResult Sema::BuildObjCArrayLiteral(SourceRange SR, MultiExprArg Elements) {\n if (!ArrayWithObjectsMethod) {\n if (!PtrT || !Context.hasSameUnqualifiedType(PtrT->getPointeeType(), IdT)) {\n Diag(Method->parameters()[0]->getLocation(), diag::note_objc_literal_method_param) << 0 << T << Context.getPointerType(IdT.withConst());"},{s,863,"ExprResult Sema::BuildObjCArrayLiteral(SourceRange SR, MultiExprArg Elements) {\n if (!ArrayWithObjectsMethod) {\n // Check that the \'count\' parameter is integral.\n if (!Method->parameters()[1]->getType()->isIntegerType()) {\n Diag(Method->parameters()[1]->getLocation(), diag::note_objc_literal_method_param) << 1 << Method->parameters()[1]->getType() << \"integral\";"},{s,1023,"ExprResult Sema::BuildObjCDictionaryLiteral(SourceRange SR, MutableArrayRef<ObjCDictionaryElement> Elements) {\n if (!DictionaryWithObjectsMethod) {\n if (!PtrValue || !Context.hasSameUnqualifiedType(PtrValue->getPointeeType(), IdT)) {\n Diag(Method->parameters()[0]->getLocation(), diag::note_objc_literal_method_param) << 0 << ValueT << Context.getPointerType(IdT.withConst());"},{s,1057,"ExprResult Sema::BuildObjCDictionaryLiteral(SourceRange SR, MutableArrayRef<ObjCDictionaryElement> Elements) {\n if (!DictionaryWithObjectsMethod) {\n if (!PtrKey || !Context.hasSameUnqualifiedType(PtrKey->getPointeeType(), IdT)) {\n if (err) {\n Diag(Method->parameters()[1]->getLocation(), diag::note_objc_literal_method_param) << 1 << KeyT << Context.getPointerType(IdT.withConst());"},{s,1070,"ExprResult Sema::BuildObjCDictionaryLiteral(SourceRange SR, MutableArrayRef<ObjCDictionaryElement> Elements) {\n if (!DictionaryWithObjectsMethod) {\n if (!CountType->isIntegerType()) {\n Diag(Method->parameters()[2]->getLocation(), diag::note_objc_literal_method_param) << 2 << CountType << \"integral\";"}} | ||
}, | }, | ||
["note_objc_literal_method_return"]={ | ["note_objc_literal_method_return"]={ | ||
Line 7,305: | Line 7,305: | ||
[c]=o, | [c]=o, | ||
[m]={"e65b086e07a6",1331064356,"Add clang support for new Objective-C literal syntax for NSDictionary, NSArray,"}, | [m]={"e65b086e07a6",1331064356,"Add clang support for new Objective-C literal syntax for NSDictionary, NSArray,"}, | ||
[n]={{s, | [n]={{s,163,"/// Emits an error if the given method does not exist, or if the return\n/// type is not an Objective-C object.\nstatic bool validateBoxingMethod(Sema &S, SourceLocation Loc, const ObjCInterfaceDecl *Class, Selector Sel, const ObjCMethodDecl *Method) {\n if (!ReturnType->isObjCObjectPointerType()) {\n S.Diag(Method->getLocation(), diag::note_objc_literal_method_return) << ReturnType;"}} | ||
}, | }, | ||
["note_objc_needs_superclass"]={ | ["note_objc_needs_superclass"]={ | ||
Line 7,317: | Line 7,317: | ||
[c]=o, | [c]=o, | ||
[m]={"acfbe9e1f228",1333735942,"Added a new attribute, objc_root_class, which informs the compiler when a root class is intentionall..."}, | [m]={"acfbe9e1f228",1333735942,"Added a new attribute, objc_root_class, which informs the compiler when a root class is intentionall..."}, | ||
[n]={{E, | [n]={{E,4147,"// Note: For class/category implementations, allMethods is always null.\nDecl *Sema::ActOnAtEnd(Scope *S, SourceRange AtEnd, ArrayRef<Decl *> allMethods, ArrayRef<DeclGroupPtrTy> allTUVars) {\n if (ObjCImplementationDecl *IC = dyn_cast<ObjCImplementationDecl>(ClassDecl)) {\n if (ObjCInterfaceDecl *IDecl = IC->getClassInterface()) {\n if (IDecl->getSuperClass() == nullptr) {\n // This class has no superclass, so check that it has been marked with\n // __attribute((objc_root_class)).\n if (!HasRootClassAttr) {\n if (NSObjectDecl && NSObjectDecl->getDefinition()) {\n Diag(SuperClassLoc, diag::note_objc_needs_superclass) << FixItHint::CreateInsertion(SuperClassLoc, \" : NSObject \");"},{E,4150,"// Note: For class/category implementations, allMethods is always null.\nDecl *Sema::ActOnAtEnd(Scope *S, SourceRange AtEnd, ArrayRef<Decl *> allMethods, ArrayRef<DeclGroupPtrTy> allTUVars) {\n if (ObjCImplementationDecl *IC = dyn_cast<ObjCImplementationDecl>(ClassDecl)) {\n if (ObjCInterfaceDecl *IDecl = IC->getClassInterface()) {\n if (IDecl->getSuperClass() == nullptr) {\n // This class has no superclass, so check that it has been marked with\n // __attribute((objc_root_class)).\n if (!HasRootClassAttr) {\n if (NSObjectDecl && NSObjectDecl->getDefinition()) {\n } else {\n Diag(SuperClassLoc, diag::note_objc_needs_superclass);"}} | ||
}, | }, | ||
["note_objc_type_param_here"]={ | ["note_objc_type_param_here"]={ | ||
Line 7,329: | Line 7,329: | ||
[c]="Generics Issue", | [c]="Generics Issue", | ||
[m]={"85f3f9513dbc",1436241435,"Parsing, semantic analysis, and AST for Objective-C type parameters."}, | [m]={"85f3f9513dbc",1436241435,"Parsing, semantic analysis, and AST for Objective-C type parameters."}, | ||
[n]={{E, | [n]={{E,907,"/// Check consistency between two Objective-C type parameter lists, e.g.,\n/// between a category/extension and an \\@interface or between an \\@class and an\n/// \\@interface.\nstatic bool checkTypeParamListConsistency(Sema &S, ObjCTypeParamList *prevTypeParams, ObjCTypeParamList *newTypeParams, TypeParamListContext newContext) {\n // Match up the type parameters.\n for (unsigned i = 0, n = prevTypeParams->size(); i != n; ++i) {\n // Check for consistency of the variance.\n if (newTypeParam->getVariance() != prevTypeParam->getVariance()) {\n if (newTypeParam->getVariance() == ObjCTypeParamVariance::Invariant && newContext != TypeParamListContext::Definition) {\n } else if (prevTypeParam->getVariance() == ObjCTypeParamVariance::Invariant && !(isa<ObjCInterfaceDecl>(prevTypeParam->getDeclContext()) && cast<ObjCInterfaceDecl>(prevTypeParam->getDeclContext())->getDefinition() == prevTypeParam->getDeclContext())) {\n } else {\n S.Diag(prevTypeParam->getLocation(), diag::note_objc_type_param_here) << prevTypeParam->getDeclName();"},{E,937,"/// Check consistency between two Objective-C type parameter lists, e.g.,\n/// between a category/extension and an \\@interface or between an \\@class and an\n/// \\@interface.\nstatic bool checkTypeParamListConsistency(Sema &S, ObjCTypeParamList *prevTypeParams, ObjCTypeParamList *newTypeParams, TypeParamListContext newContext) {\n // Match up the type parameters.\n for (unsigned i = 0, n = prevTypeParams->size(); i != n; ++i) {\n // If the new type parameter\'s bound was explicit, complain about it being\n // different from the original.\n if (newTypeParam->hasExplicitBound()) {\n S.Diag(prevTypeParam->getLocation(), diag::note_objc_type_param_here) << prevTypeParam->getDeclName();"},{E,964,"/// Check consistency between two Objective-C type parameter lists, e.g.,\n/// between a category/extension and an \\@interface or between an \\@class and an\n/// \\@interface.\nstatic bool checkTypeParamListConsistency(Sema &S, ObjCTypeParamList *prevTypeParams, ObjCTypeParamList *newTypeParams, TypeParamListContext newContext) {\n // Match up the type parameters.\n for (unsigned i = 0, n = prevTypeParams->size(); i != n; ++i) {\n // The new type parameter got the implicit bound of \'id\'. That\'s okay for\n // categories and extensions (overwrite it later), but not for forward\n // declarations and @interfaces, because those must be standalone.\n if (newContext == TypeParamListContext::ForwardDeclaration || newContext == TypeParamListContext::Definition) {\n S.Diag(prevTypeParam->getLocation(), diag::note_objc_type_param_here) << prevTypeParam->getDeclName();"},{B,971,"/// Apply Objective-C type arguments to the given type.\nstatic QualType applyObjCTypeArgs(Sema &S, SourceLocation loc, QualType type, ArrayRef<TypeSourceInfo *> typeArgs, SourceRange typeArgsRange, bool failOnError, bool rebuilding) {\n for (unsigned i = 0, n = typeArgs.size(); i != n; ++i) {\n // Objective-C object pointer types must be substitutable for the bounds.\n if (const auto *typeArgObjC = typeArg->getAs<ObjCObjectPointerType>()) {\n S.Diag(typeParam->getLocation(), diag::note_objc_type_param_here) << typeParam->getDeclName();"},{B,999,"/// Apply Objective-C type arguments to the given type.\nstatic QualType applyObjCTypeArgs(Sema &S, SourceLocation loc, QualType type, ArrayRef<TypeSourceInfo *> typeArgs, SourceRange typeArgsRange, bool failOnError, bool rebuilding) {\n for (unsigned i = 0, n = typeArgs.size(); i != n; ++i) {\n // Block pointer types are permitted for unqualified \'id\' bounds.\n if (typeArg->isBlockPointerType()) {\n S.Diag(typeParam->getLocation(), diag::note_objc_type_param_here) << typeParam->getDeclName();"}} | ||
}, | }, | ||
["note_objc_unsafe_perform_selector_method_declared_here"]={ | ["note_objc_unsafe_perform_selector_method_declared_here"]={ | ||
Line 7,341: | Line 7,341: | ||
[c]=o, | [c]=o, | ||
[m]={"0e23c61c8755",1488815914,"[Sema][ObjC] Warn about \'performSelector\' calls with selectors"}, | [m]={"0e23c61c8755",1488815914,"[Sema][ObjC] Warn about \'performSelector\' calls with selectors"}, | ||
[n]={{s, | [n]={{s,2536,"static void checkFoundationAPI(Sema &S, SourceLocation Loc, const ObjCMethodDecl *Method, ArrayRef<Expr *> Args, QualType ReceiverType, bool IsClassObjectCall) {\n if (Ret->isRecordType() || Ret->isVectorType() || Ret->isExtVectorType()) {\n S.Diag(ImpliedMethod->getBeginLoc(), diag::note_objc_unsafe_perform_selector_method_declared_here) << ImpliedMethod->getSelector() << Ret;"}} | ||
}, | }, | ||
["note_odr_base"]={ | ["note_odr_base"]={ | ||
Line 7,353: | Line 7,353: | ||
[c]=a, | [c]=a, | ||
[m]={Gb,1265916115,Fb}, | [m]={Gb,1265916115,Fb}, | ||
[n]={{v, | [n]={{v,1592,"/// Determine structural equivalence of two records.\nstatic bool IsStructurallyEquivalent(StructuralEquivalenceContext &Context, RecordDecl *D1, RecordDecl *D2) {\n if (auto *D1CXX = dyn_cast<CXXRecordDecl>(D1)) {\n if (auto *D2CXX = dyn_cast<CXXRecordDecl>(D2)) {\n // Check the base classes.\n for (CXXRecordDecl::base_class_iterator Base1 = D1CXX->bases_begin(), BaseEnd1 = D1CXX->bases_end(), Base2 = D2CXX->bases_begin(); Base1 != BaseEnd1; ++Base1, ++Base2) {\n if (!IsStructurallyEquivalent(Context, Base1->getType(), Base2->getType())) {\n if (Context.Complain) {\n Context.Diag2(Base2->getBeginLoc(), diag::note_odr_base) << Base2->getType() << Base2->getSourceRange();"},{v,1594,"/// Determine structural equivalence of two records.\nstatic bool IsStructurallyEquivalent(StructuralEquivalenceContext &Context, RecordDecl *D1, RecordDecl *D2) {\n if (auto *D1CXX = dyn_cast<CXXRecordDecl>(D1)) {\n if (auto *D2CXX = dyn_cast<CXXRecordDecl>(D2)) {\n // Check the base classes.\n for (CXXRecordDecl::base_class_iterator Base1 = D1CXX->bases_begin(), BaseEnd1 = D1CXX->bases_end(), Base2 = D2CXX->bases_begin(); Base1 != BaseEnd1; ++Base1, ++Base2) {\n if (!IsStructurallyEquivalent(Context, Base1->getType(), Base2->getType())) {\n if (Context.Complain) {\n Context.Diag1(Base1->getBeginLoc(), diag::note_odr_base) << Base1->getType() << Base1->getSourceRange();"},{v,1609,"/// Determine structural equivalence of two records.\nstatic bool IsStructurallyEquivalent(StructuralEquivalenceContext &Context, RecordDecl *D1, RecordDecl *D2) {\n if (auto *D1CXX = dyn_cast<CXXRecordDecl>(D1)) {\n if (auto *D2CXX = dyn_cast<CXXRecordDecl>(D2)) {\n // Check the base classes.\n for (CXXRecordDecl::base_class_iterator Base1 = D1CXX->bases_begin(), BaseEnd1 = D1CXX->bases_end(), Base2 = D2CXX->bases_begin(); Base1 != BaseEnd1; ++Base1, ++Base2) {\n // Check virtual vs. non-virtual inheritance mismatch.\n if (Base1->isVirtual() != Base2->isVirtual()) {\n if (Context.Complain) {\n Context.Diag1(Base1->getBeginLoc(), diag::note_odr_base) << Base1->isVirtual() << Base1->getSourceRange();"},{v,1665,"/// Determine structural equivalence of two records.\nstatic bool IsStructurallyEquivalent(StructuralEquivalenceContext &Context, RecordDecl *D1, RecordDecl *D2) {\n if (auto *D1CXX = dyn_cast<CXXRecordDecl>(D1)) {\n if (auto *D2CXX = dyn_cast<CXXRecordDecl>(D2)) {\n } else if (D1CXX->getNumBases() > 0) {\n if (Context.Complain) {\n Context.Diag1(Base1->getBeginLoc(), diag::note_odr_base) << Base1->getType() << Base1->getSourceRange();"}} | ||
}, | }, | ||
["note_odr_enumerator"]={ | ["note_odr_enumerator"]={ | ||
Line 7,365: | Line 7,365: | ||
[c]=a, | [c]=a, | ||
[m]={"98c101833744",1266013059,"Implement AST importing and merging for enumeration types and"}, | [m]={"98c101833744",1266013059,"Implement AST importing and merging for enumeration types and"}, | ||
[n]={{v, | [n]={{v,1757,"/// Determine structural equivalence of two enums.\nstatic bool IsStructurallyEquivalent(StructuralEquivalenceContext &Context, EnumDecl *D1, EnumDecl *D2) {\n for (EnumDecl::enumerator_iterator EC1 = D1->enumerator_begin(), EC1End = D1->enumerator_end(); EC1 != EC1End; ++EC1, ++EC2) {\n if (EC2 == EC2End) {\n if (Context.Complain) {\n Context.Diag1(EC1->getLocation(), diag::note_odr_enumerator) << EC1->getDeclName() << toString(EC1->getInitVal(), 10);"},{v,1773,"/// Determine structural equivalence of two enums.\nstatic bool IsStructurallyEquivalent(StructuralEquivalenceContext &Context, EnumDecl *D1, EnumDecl *D2) {\n for (EnumDecl::enumerator_iterator EC1 = D1->enumerator_begin(), EC1End = D1->enumerator_end(); EC1 != EC1End; ++EC1, ++EC2) {\n if (!llvm::APSInt::isSameValue(Val1, Val2) || !IsStructurallyEquivalent(EC1->getIdentifier(), EC2->getIdentifier())) {\n if (Context.Complain) {\n Context.Diag2(EC2->getLocation(), diag::note_odr_enumerator) << EC2->getDeclName() << toString(EC2->getInitVal(), 10);"},{v,1775,"/// Determine structural equivalence of two enums.\nstatic bool IsStructurallyEquivalent(StructuralEquivalenceContext &Context, EnumDecl *D1, EnumDecl *D2) {\n for (EnumDecl::enumerator_iterator EC1 = D1->enumerator_begin(), EC1End = D1->enumerator_end(); EC1 != EC1End; ++EC1, ++EC2) {\n if (!llvm::APSInt::isSameValue(Val1, Val2) || !IsStructurallyEquivalent(EC1->getIdentifier(), EC2->getIdentifier())) {\n if (Context.Complain) {\n Context.Diag1(EC1->getLocation(), diag::note_odr_enumerator) << EC1->getDeclName() << toString(EC1->getInitVal(), 10);"},{v,1787,"/// Determine structural equivalence of two enums.\nstatic bool IsStructurallyEquivalent(StructuralEquivalenceContext &Context, EnumDecl *D1, EnumDecl *D2) {\n if (EC2 != EC2End) {\n if (Context.Complain) {\n Context.Diag2(EC2->getLocation(), diag::note_odr_enumerator) << EC2->getDeclName() << toString(EC2->getInitVal(), 10);"}} | ||
}, | }, | ||
["note_odr_field"]={ | ["note_odr_field"]={ | ||
Line 7,377: | Line 7,377: | ||
[c]=a, | [c]=a, | ||
[m]={Gb,1265916115,Fb}, | [m]={Gb,1265916115,Fb}, | ||
[n]={{v, | [n]={{v,1333,"static bool IsStructurallyEquivalent(StructuralEquivalenceContext &Context, FieldDecl *Field1, FieldDecl *Field2, QualType Owner2Type) {\n if (!IsStructurallyEquivalent(Context, Field1->getType(), Field2->getType())) {\n if (Context.Complain) {\n Context.Diag2(Field2->getLocation(), diag::note_odr_field) << Field2->getDeclName() << Field2->getType();"},{v,1335,"static bool IsStructurallyEquivalent(StructuralEquivalenceContext &Context, FieldDecl *Field1, FieldDecl *Field2, QualType Owner2Type) {\n if (!IsStructurallyEquivalent(Context, Field1->getType(), Field2->getType())) {\n if (Context.Complain) {\n Context.Diag1(Field1->getLocation(), diag::note_odr_field) << Field1->getDeclName() << Field1->getType();"},{v,1686,"/// Determine structural equivalence of two records.\nstatic bool IsStructurallyEquivalent(StructuralEquivalenceContext &Context, RecordDecl *D1, RecordDecl *D2) {\n for (RecordDecl::field_iterator Field1 = D1->field_begin(), Field1End = D1->field_end(); Field1 != Field1End; ++Field1, ++Field2) {\n if (Field2 == Field2End) {\n if (Context.Complain) {\n Context.Diag1(Field1->getLocation(), diag::note_odr_field) << Field1->getDeclName() << Field1->getType();"},{v,1702,"/// Determine structural equivalence of two records.\nstatic bool IsStructurallyEquivalent(StructuralEquivalenceContext &Context, RecordDecl *D1, RecordDecl *D2) {\n if (Field2 != Field2End) {\n if (Context.Complain) {\n Context.Diag2(Field2->getLocation(), diag::note_odr_field) << Field2->getDeclName() << Field2->getType();"}} | ||
}, | }, | ||
["note_odr_field_name"]={ | ["note_odr_field_name"]={ | ||
Line 7,389: | Line 7,389: | ||
[c]=a, | [c]=a, | ||
[m]={"df0ee34bc252",1498867607,"[Modules] Implement ODR-like semantics for tag types in C/ObjC"}, | [m]={"df0ee34bc252",1498867607,"[Modules] Implement ODR-like semantics for tag types in C/ObjC"}, | ||
[n]={{v, | [n]={{v,1318,"static bool IsStructurallyEquivalent(StructuralEquivalenceContext &Context, FieldDecl *Field1, FieldDecl *Field2, QualType Owner2Type) {\n if (!::IsStructurallyEquivalent(Name1, Name2)) {\n if (Context.Complain) {\n Context.Diag2(Field2->getLocation(), diag::note_odr_field_name) << Field2->getDeclName();"},{v,1320,"static bool IsStructurallyEquivalent(StructuralEquivalenceContext &Context, FieldDecl *Field1, FieldDecl *Field2, QualType Owner2Type) {\n if (!::IsStructurallyEquivalent(Name1, Name2)) {\n if (Context.Complain) {\n Context.Diag1(Field1->getLocation(), diag::note_odr_field_name) << Field1->getDeclName();"}} | ||
}, | }, | ||
["note_odr_friend"]={ | ["note_odr_friend"]={ | ||
Line 7,401: | Line 7,401: | ||
[c]=a, | [c]=a, | ||
[m]={"b180eebed423",1524677283,"[ASTImporter] FriendDecl importing improvements"}, | [m]={"b180eebed423",1524677283,"[ASTImporter] FriendDecl importing improvements"}, | ||
[n]={{v, | [n]={{v,1628,"/// Determine structural equivalence of two records.\nstatic bool IsStructurallyEquivalent(StructuralEquivalenceContext &Context, RecordDecl *D1, RecordDecl *D2) {\n if (auto *D1CXX = dyn_cast<CXXRecordDecl>(D1)) {\n if (auto *D2CXX = dyn_cast<CXXRecordDecl>(D2)) {\n for (CXXRecordDecl::friend_iterator Friend1 = D1CXX->friend_begin(), Friend1End = D1CXX->friend_end(); Friend1 != Friend1End; ++Friend1, ++Friend2) {\n if (Friend2 == Friend2End) {\n if (Context.Complain) {\n Context.Diag1((*Friend1)->getFriendLoc(), diag::note_odr_friend);"},{v,1640,"/// Determine structural equivalence of two records.\nstatic bool IsStructurallyEquivalent(StructuralEquivalenceContext &Context, RecordDecl *D1, RecordDecl *D2) {\n if (auto *D1CXX = dyn_cast<CXXRecordDecl>(D1)) {\n if (auto *D2CXX = dyn_cast<CXXRecordDecl>(D2)) {\n for (CXXRecordDecl::friend_iterator Friend1 = D1CXX->friend_begin(), Friend1End = D1CXX->friend_end(); Friend1 != Friend1End; ++Friend1, ++Friend2) {\n if (!IsStructurallyEquivalent(Context, *Friend1, *Friend2)) {\n if (Context.Complain) {\n Context.Diag1((*Friend1)->getFriendLoc(), diag::note_odr_friend);"},{v,1641,"/// Determine structural equivalence of two records.\nstatic bool IsStructurallyEquivalent(StructuralEquivalenceContext &Context, RecordDecl *D1, RecordDecl *D2) {\n if (auto *D1CXX = dyn_cast<CXXRecordDecl>(D1)) {\n if (auto *D2CXX = dyn_cast<CXXRecordDecl>(D2)) {\n for (CXXRecordDecl::friend_iterator Friend1 = D1CXX->friend_begin(), Friend1End = D1CXX->friend_end(); Friend1 != Friend1End; ++Friend1, ++Friend2) {\n if (!IsStructurallyEquivalent(Context, *Friend1, *Friend2)) {\n if (Context.Complain) {\n Context.Diag2((*Friend2)->getFriendLoc(), diag::note_odr_friend);"},{v,1653,"/// Determine structural equivalence of two records.\nstatic bool IsStructurallyEquivalent(StructuralEquivalenceContext &Context, RecordDecl *D1, RecordDecl *D2) {\n if (auto *D1CXX = dyn_cast<CXXRecordDecl>(D1)) {\n if (auto *D2CXX = dyn_cast<CXXRecordDecl>(D2)) {\n if (Friend2 != Friend2End) {\n if (Context.Complain) {\n Context.Diag2((*Friend2)->getFriendLoc(), diag::note_odr_friend);"}} | ||
}, | }, | ||
["note_odr_missing_base"]={ | ["note_odr_missing_base"]={ | ||
Line 7,413: | Line 7,413: | ||
[c]=a, | [c]=a, | ||
[m]={Gb,1265916115,Fb}, | [m]={Gb,1265916115,Fb}, | ||
[n]={{v, | [n]={{v,1667,"/// Determine structural equivalence of two records.\nstatic bool IsStructurallyEquivalent(StructuralEquivalenceContext &Context, RecordDecl *D1, RecordDecl *D2) {\n if (auto *D1CXX = dyn_cast<CXXRecordDecl>(D1)) {\n if (auto *D2CXX = dyn_cast<CXXRecordDecl>(D2)) {\n } else if (D1CXX->getNumBases() > 0) {\n if (Context.Complain) {\n Context.Diag2(D2->getLocation(), diag::note_odr_missing_base);"}} | ||
}, | }, | ||
["note_odr_missing_enumerator"]={ | ["note_odr_missing_enumerator"]={ | ||
Line 7,425: | Line 7,425: | ||
[c]=a, | [c]=a, | ||
[m]={"98c101833744",1266013059,"Implement AST importing and merging for enumeration types and"}, | [m]={"98c101833744",1266013059,"Implement AST importing and merging for enumeration types and"}, | ||
[n]={{v, | [n]={{v,1759,"/// Determine structural equivalence of two enums.\nstatic bool IsStructurallyEquivalent(StructuralEquivalenceContext &Context, EnumDecl *D1, EnumDecl *D2) {\n for (EnumDecl::enumerator_iterator EC1 = D1->enumerator_begin(), EC1End = D1->enumerator_end(); EC1 != EC1End; ++EC1, ++EC2) {\n if (EC2 == EC2End) {\n if (Context.Complain) {\n Context.Diag2(D2->getLocation(), diag::note_odr_missing_enumerator);"},{v,1789,"/// Determine structural equivalence of two enums.\nstatic bool IsStructurallyEquivalent(StructuralEquivalenceContext &Context, EnumDecl *D1, EnumDecl *D2) {\n if (EC2 != EC2End) {\n if (Context.Complain) {\n Context.Diag1(D1->getLocation(), diag::note_odr_missing_enumerator);"}} | ||
}, | }, | ||
["note_odr_missing_field"]={ | ["note_odr_missing_field"]={ | ||
Line 7,437: | Line 7,437: | ||
[c]=a, | [c]=a, | ||
[m]={Gb,1265916115,Fb}, | [m]={Gb,1265916115,Fb}, | ||
[n]={{v, | [n]={{v,1688,"/// Determine structural equivalence of two records.\nstatic bool IsStructurallyEquivalent(StructuralEquivalenceContext &Context, RecordDecl *D1, RecordDecl *D2) {\n for (RecordDecl::field_iterator Field1 = D1->field_begin(), Field1End = D1->field_end(); Field1 != Field1End; ++Field1, ++Field2) {\n if (Field2 == Field2End) {\n if (Context.Complain) {\n Context.Diag2(D2->getLocation(), diag::note_odr_missing_field);"},{v,1704,"/// Determine structural equivalence of two records.\nstatic bool IsStructurallyEquivalent(StructuralEquivalenceContext &Context, RecordDecl *D1, RecordDecl *D2) {\n if (Field2 != Field2End) {\n if (Context.Complain) {\n Context.Diag1(D1->getLocation(), diag::note_odr_missing_field);"}} | ||
}, | }, | ||
["note_odr_missing_friend"]={ | ["note_odr_missing_friend"]={ | ||
Line 7,449: | Line 7,449: | ||
[c]=a, | [c]=a, | ||
[m]={"b180eebed423",1524677283,"[ASTImporter] FriendDecl importing improvements"}, | [m]={"b180eebed423",1524677283,"[ASTImporter] FriendDecl importing improvements"}, | ||
[n]={{v, | [n]={{v,1629,"/// Determine structural equivalence of two records.\nstatic bool IsStructurallyEquivalent(StructuralEquivalenceContext &Context, RecordDecl *D1, RecordDecl *D2) {\n if (auto *D1CXX = dyn_cast<CXXRecordDecl>(D1)) {\n if (auto *D2CXX = dyn_cast<CXXRecordDecl>(D2)) {\n for (CXXRecordDecl::friend_iterator Friend1 = D1CXX->friend_begin(), Friend1End = D1CXX->friend_end(); Friend1 != Friend1End; ++Friend1, ++Friend2) {\n if (Friend2 == Friend2End) {\n if (Context.Complain) {\n Context.Diag2(D2->getLocation(), diag::note_odr_missing_friend);"},{v,1654,"/// Determine structural equivalence of two records.\nstatic bool IsStructurallyEquivalent(StructuralEquivalenceContext &Context, RecordDecl *D1, RecordDecl *D2) {\n if (auto *D1CXX = dyn_cast<CXXRecordDecl>(D1)) {\n if (auto *D2CXX = dyn_cast<CXXRecordDecl>(D2)) {\n if (Friend2 != Friend2End) {\n if (Context.Complain) {\n Context.Diag1(D1->getLocation(), diag::note_odr_missing_friend);"}} | ||
}, | }, | ||
["note_odr_number_of_bases"]={ | ["note_odr_number_of_bases"]={ | ||
Line 7,461: | Line 7,461: | ||
[c]=a, | [c]=a, | ||
[m]={Gb,1265916115,Fb}, | [m]={Gb,1265916115,Fb}, | ||
[n]={{v, | [n]={{v,1572,"/// Determine structural equivalence of two records.\nstatic bool IsStructurallyEquivalent(StructuralEquivalenceContext &Context, RecordDecl *D1, RecordDecl *D2) {\n if (auto *D1CXX = dyn_cast<CXXRecordDecl>(D1)) {\n if (auto *D2CXX = dyn_cast<CXXRecordDecl>(D2)) {\n if (D1CXX->getNumBases() != D2CXX->getNumBases()) {\n if (Context.Complain) {\n Context.Diag2(D2->getLocation(), diag::note_odr_number_of_bases) << D2CXX->getNumBases();"},{v,1574,"/// Determine structural equivalence of two records.\nstatic bool IsStructurallyEquivalent(StructuralEquivalenceContext &Context, RecordDecl *D1, RecordDecl *D2) {\n if (auto *D1CXX = dyn_cast<CXXRecordDecl>(D1)) {\n if (auto *D2CXX = dyn_cast<CXXRecordDecl>(D2)) {\n if (D1CXX->getNumBases() != D2CXX->getNumBases()) {\n if (Context.Complain) {\n Context.Diag1(D1->getLocation(), diag::note_odr_number_of_bases) << D1CXX->getNumBases();"}} | ||
}, | }, | ||
["note_odr_objc_method_here"]={ | ["note_odr_objc_method_here"]={ | ||
Line 7,473: | Line 7,473: | ||
[c]=a, | [c]=a, | ||
[m]={"43f54796ab42",1266372767,"Implement AST importing and checking for Objective-C method declarations."}, | [m]={"43f54796ab42",1266372767,"Implement AST importing and checking for Objective-C method declarations."}, | ||
[n]={{F, | [n]={{F,4495,"ExpectedDecl ASTNodeImporter::VisitObjCMethodDecl(ObjCMethodDecl *D) {\n for (auto *FoundDecl : FoundDecls) {\n if (auto *FoundMethod = dyn_cast<ObjCMethodDecl>(FoundDecl)) {\n // Check return types.\n if (!Importer.IsStructurallyEquivalent(D->getReturnType(), FoundMethod->getReturnType())) {\n Importer.ToDiag(FoundMethod->getLocation(), diag::note_odr_objc_method_here) << D->isInstanceMethod() << Name;"},{F,4507,"ExpectedDecl ASTNodeImporter::VisitObjCMethodDecl(ObjCMethodDecl *D) {\n for (auto *FoundDecl : FoundDecls) {\n if (auto *FoundMethod = dyn_cast<ObjCMethodDecl>(FoundDecl)) {\n // Check the number of parameters.\n if (D->param_size() != FoundMethod->param_size()) {\n Importer.ToDiag(FoundMethod->getLocation(), diag::note_odr_objc_method_here) << D->isInstanceMethod() << Name;"},{F,4536,"ExpectedDecl ASTNodeImporter::VisitObjCMethodDecl(ObjCMethodDecl *D) {\n for (auto *FoundDecl : FoundDecls) {\n if (auto *FoundMethod = dyn_cast<ObjCMethodDecl>(FoundDecl)) {\n // Check variadic/non-variadic.\n // Check the number of parameters.\n if (D->isVariadic() != FoundMethod->isVariadic()) {\n Importer.ToDiag(FoundMethod->getLocation(), diag::note_odr_objc_method_here) << D->isInstanceMethod() << Name;"}} | ||
}, | }, | ||
["note_odr_objc_missing_superclass"]={ | ["note_odr_objc_missing_superclass"]={ | ||
Line 7,485: | Line 7,485: | ||
[c]=a, | [c]=a, | ||
[m]={"7244b0bb860b",1266366870,"Implement AST importing of Objective-C instance variables. "}, | [m]={"7244b0bb860b",1266366870,"Implement AST importing of Objective-C instance variables. "}, | ||
[n]={{F, | [n]={{F,5189,"Error ASTNodeImporter::ImportDefinition(ObjCInterfaceDecl *From, ObjCInterfaceDecl *To, ImportDefinitionKind Kind) {\n if (To->getDefinition()) {\n if ((bool)FromSuper != (bool)ToSuper || (FromSuper && !declaresSameEntity(FromSuper, ToSuper))) {\n if (ToSuper)\n else\n Importer.ToDiag(To->getLocation(), diag::note_odr_objc_missing_superclass);"},{F,5196,"Error ASTNodeImporter::ImportDefinition(ObjCInterfaceDecl *From, ObjCInterfaceDecl *To, ImportDefinitionKind Kind) {\n if (To->getDefinition()) {\n if ((bool)FromSuper != (bool)ToSuper || (FromSuper && !declaresSameEntity(FromSuper, ToSuper))) {\n if (From->getSuperClass())\n else\n Importer.FromDiag(From->getLocation(), diag::note_odr_objc_missing_superclass);"},{F,5458,"ExpectedDecl ASTNodeImporter::VisitObjCImplementationDecl(ObjCImplementationDecl *D) {\n if (!Impl) {\n } else {\n // Verify that the existing @implementation has the same superclass.\n if ((Super && !Impl->getSuperClass()) || (!Super && Impl->getSuperClass()) || (Super && Impl->getSuperClass() && !declaresSameEntity(Super->getCanonicalDecl(), Impl->getSuperClass()))) {\n // FIXME: It would be nice to have the location of the superclass\n // below.\n if (Impl->getSuperClass())\n else\n Importer.ToDiag(Impl->getLocation(), diag::note_odr_objc_missing_superclass);"},{F,5465,"ExpectedDecl ASTNodeImporter::VisitObjCImplementationDecl(ObjCImplementationDecl *D) {\n if (!Impl) {\n } else {\n // Verify that the existing @implementation has the same superclass.\n if ((Super && !Impl->getSuperClass()) || (!Super && Impl->getSuperClass()) || (Super && Impl->getSuperClass() && !declaresSameEntity(Super->getCanonicalDecl(), Impl->getSuperClass()))) {\n if (D->getSuperClass())\n else\n Importer.FromDiag(D->getLocation(), diag::note_odr_objc_missing_superclass);"}} | ||
}, | }, | ||
["note_odr_objc_property_impl_kind"]={ | ["note_odr_objc_property_impl_kind"]={ | ||
Line 7,497: | Line 7,497: | ||
[c]=a, | [c]=a, | ||
[m]={"14a49e2fbe1c",1291746723,"Implement AST import for Objective-C property implementations"}, | [m]={"14a49e2fbe1c",1291746723,"Implement AST import for Objective-C property implementations"}, | ||
[n]={{F, | [n]={{F,5607,"ExpectedDecl ASTNodeImporter::VisitObjCPropertyImplDecl(ObjCPropertyImplDecl *D) {\n if (!ToImpl) {\n } else {\n // Check that we have the same kind of property implementation (@synthesize\n // vs. @dynamic).\n if (D->getPropertyImplementation() != ToImpl->getPropertyImplementation()) {\n Importer.FromDiag(D->getLocation(), diag::note_odr_objc_property_impl_kind) << D->getPropertyDecl()->getDeclName() << (D->getPropertyImplementation() == ObjCPropertyImplDecl::Dynamic);"}} | ||
}, | }, | ||
["note_odr_objc_superclass"]={ | ["note_odr_objc_superclass"]={ | ||
Line 7,509: | Line 7,509: | ||
[c]=a, | [c]=a, | ||
[m]={"7244b0bb860b",1266366870,"Implement AST importing of Objective-C instance variables. "}, | [m]={"7244b0bb860b",1266366870,"Implement AST importing of Objective-C instance variables. "}, | ||
[n]={{F, | [n]={{F,5185,"Error ASTNodeImporter::ImportDefinition(ObjCInterfaceDecl *From, ObjCInterfaceDecl *To, ImportDefinitionKind Kind) {\n if (To->getDefinition()) {\n if ((bool)FromSuper != (bool)ToSuper || (FromSuper && !declaresSameEntity(FromSuper, ToSuper))) {\n if (ToSuper)\n Importer.ToDiag(To->getSuperClassLoc(), diag::note_odr_objc_superclass) << To->getSuperClass()->getDeclName();"},{F,5192,"Error ASTNodeImporter::ImportDefinition(ObjCInterfaceDecl *From, ObjCInterfaceDecl *To, ImportDefinitionKind Kind) {\n if (To->getDefinition()) {\n if ((bool)FromSuper != (bool)ToSuper || (FromSuper && !declaresSameEntity(FromSuper, ToSuper))) {\n if (From->getSuperClass())\n Importer.FromDiag(From->getSuperClassLoc(), diag::note_odr_objc_superclass) << From->getSuperClass()->getDeclName();"},{F,5454,"ExpectedDecl ASTNodeImporter::VisitObjCImplementationDecl(ObjCImplementationDecl *D) {\n if (!Impl) {\n } else {\n // Verify that the existing @implementation has the same superclass.\n if ((Super && !Impl->getSuperClass()) || (!Super && Impl->getSuperClass()) || (Super && Impl->getSuperClass() && !declaresSameEntity(Super->getCanonicalDecl(), Impl->getSuperClass()))) {\n // FIXME: It would be nice to have the location of the superclass\n // below.\n if (Impl->getSuperClass())\n Importer.ToDiag(Impl->getLocation(), diag::note_odr_objc_superclass) << Impl->getSuperClass()->getDeclName();"},{F,5461,"ExpectedDecl ASTNodeImporter::VisitObjCImplementationDecl(ObjCImplementationDecl *D) {\n if (!Impl) {\n } else {\n // Verify that the existing @implementation has the same superclass.\n if ((Super && !Impl->getSuperClass()) || (!Super && Impl->getSuperClass()) || (Super && Impl->getSuperClass() && !declaresSameEntity(Super->getCanonicalDecl(), Impl->getSuperClass()))) {\n if (D->getSuperClass())\n Importer.FromDiag(D->getLocation(), diag::note_odr_objc_superclass) << D->getSuperClass()->getDeclName();"}} | ||
}, | }, | ||
["note_odr_objc_synthesize_ivar_here"]={ | ["note_odr_objc_synthesize_ivar_here"]={ | ||
Line 7,521: | Line 7,521: | ||
[c]=a, | [c]=a, | ||
[m]={"14a49e2fbe1c",1291746723,"Implement AST import for Objective-C property implementations"}, | [m]={"14a49e2fbe1c",1291746723,"Implement AST import for Objective-C property implementations"}, | ||
[n]={{F, | [n]={{F,5623,"ExpectedDecl ASTNodeImporter::VisitObjCPropertyImplDecl(ObjCPropertyImplDecl *D) {\n if (!ToImpl) {\n } else {\n // For @synthesize, check that we have the same\n if (D->getPropertyImplementation() == ObjCPropertyImplDecl::Synthesize && Ivar != ToImpl->getPropertyIvarDecl()) {\n Importer.FromDiag(D->getPropertyIvarDeclLoc(), diag::note_odr_objc_synthesize_ivar_here) << D->getPropertyIvarDecl()->getDeclName();"}} | ||
}, | }, | ||
["note_odr_parameter_pack_non_pack"]={ | ["note_odr_parameter_pack_non_pack"]={ | ||
Line 7,533: | Line 7,533: | ||
[c]=a, | [c]=a, | ||
[m]={"a082a49d9e71",1291144490,"Implement basic AST importing and merging support for class template"}, | [m]={"a082a49d9e71",1291144490,"Implement basic AST importing and merging support for class template"}, | ||
[n]={{v, | [n]={{v,1841,"static bool IsStructurallyEquivalent(StructuralEquivalenceContext &Context, TemplateTypeParmDecl *D1, TemplateTypeParmDecl *D2) {\n if (D1->isParameterPack() != D2->isParameterPack()) {\n if (Context.Complain) {\n Context.Diag1(D1->getLocation(), diag::note_odr_parameter_pack_non_pack) << D1->isParameterPack();"},{v,1859,"static bool IsStructurallyEquivalent(StructuralEquivalenceContext &Context, NonTypeTemplateParmDecl *D1, NonTypeTemplateParmDecl *D2) {\n if (D1->isParameterPack() != D2->isParameterPack()) {\n if (Context.Complain) {\n Context.Diag1(D1->getLocation(), diag::note_odr_parameter_pack_non_pack) << D1->isParameterPack();"},{v,1890,"static bool IsStructurallyEquivalent(StructuralEquivalenceContext &Context, TemplateTemplateParmDecl *D1, TemplateTemplateParmDecl *D2) {\n if (D1->isParameterPack() != D2->isParameterPack()) {\n if (Context.Complain) {\n Context.Diag1(D1->getLocation(), diag::note_odr_parameter_pack_non_pack) << D1->isParameterPack();"}} | ||
}, | }, | ||
["note_odr_tag_kind_here"]={ | ["note_odr_tag_kind_here"]={ | ||
Line 7,545: | Line 7,545: | ||
[c]=a, | [c]=a, | ||
[m]={Gb,1265916115,Fb}, | [m]={Gb,1265916115,Fb}, | ||
[n]={{v, | [n]={{v,1480,"/// Determine structural equivalence of two records.\nstatic bool IsStructurallyEquivalent(StructuralEquivalenceContext &Context, RecordDecl *D1, RecordDecl *D2) {\n if (D1->isUnion() != D2->isUnion()) {\n if (Context.Complain) {\n Context.Diag1(D1->getLocation(), diag::note_odr_tag_kind_here) << D1->getDeclName() << (unsigned)D1->getTagKind();"}} | ||
}, | }, | ||
["note_odr_template_parameter_here"]={ | ["note_odr_template_parameter_here"]={ | ||
Line 7,557: | Line 7,557: | ||
[c]=a, | [c]=a, | ||
[m]={"a082a49d9e71",1291144490,"Implement basic AST importing and merging support for class template"}, | [m]={"a082a49d9e71",1291144490,"Implement basic AST importing and merging support for class template"}, | ||
[n]={{v, | [n]={{v,1819,"static bool IsStructurallyEquivalent(StructuralEquivalenceContext &Context, TemplateParameterList *Params1, TemplateParameterList *Params2) {\n for (unsigned I = 0, N = Params1->size(); I != N; ++I) {\n if (Params1->getParam(I)->getKind() != Params2->getParam(I)->getKind()) {\n if (Context.Complain) {\n Context.Diag1(Params1->getParam(I)->getLocation(), diag::note_odr_template_parameter_here);"}} | ||
}, | }, | ||
["note_odr_template_parameter_list"]={ | ["note_odr_template_parameter_list"]={ | ||
Line 7,569: | Line 7,569: | ||
[c]=a, | [c]=a, | ||
[m]={"a082a49d9e71",1291144490,"Implement basic AST importing and merging support for class template"}, | [m]={"a082a49d9e71",1291144490,"Implement basic AST importing and merging support for class template"}, | ||
[n]={{v, | [n]={{v,1807,"static bool IsStructurallyEquivalent(StructuralEquivalenceContext &Context, TemplateParameterList *Params1, TemplateParameterList *Params2) {\n if (Params1->size() != Params2->size()) {\n if (Context.Complain) {\n Context.Diag1(Params1->getTemplateLoc(), diag::note_odr_template_parameter_list);"}} | ||
}, | }, | ||
["note_odr_value_here"]={ | ["note_odr_value_here"]={ | ||
Line 7,581: | Line 7,581: | ||
[c]=a, | [c]=a, | ||
[m]={"3aed6cdd5e61",1265663379,"Implement basic importing and merging of variable declarations within"}, | [m]={"3aed6cdd5e61",1265663379,"Implement basic importing and merging of variable declarations within"}, | ||
[n]={{F, | [n]={{F,3545,"ExpectedDecl ASTNodeImporter::VisitFunctionDecl(FunctionDecl *D) {\n }\n // Try to find a function in our own (\"to\") context with the same name, same\n // type, and in the same context as the function we\'re importing.\n else if (!LexicalDC->isFunctionOrMethod()) {\n for (auto *FoundDecl : FoundDecls) {\n if (auto *FoundFunction = dyn_cast<FunctionDecl>(FoundDecl)) {\n Importer.ToDiag(FoundFunction->getLocation(), diag::note_odr_value_here) << FoundFunction->getType();"},{F,3917,"ExpectedDecl ASTNodeImporter::VisitFieldDecl(FieldDecl *D) {\n for (auto *FoundDecl : FoundDecls) {\n if (FieldDecl *FoundField = dyn_cast<FieldDecl>(FoundDecl)) {\n Importer.ToDiag(FoundField->getLocation(), diag::note_odr_value_here) << FoundField->getType();"},{F,3996,"ExpectedDecl ASTNodeImporter::VisitIndirectFieldDecl(IndirectFieldDecl *D) {\n for (unsigned I = 0, N = FoundDecls.size(); I != N; ++I) {\n if (auto *FoundField = dyn_cast<IndirectFieldDecl>(FoundDecls[I])) {\n Importer.ToDiag(FoundField->getLocation(), diag::note_odr_value_here) << FoundField->getType();"},{F,4187,"ExpectedDecl ASTNodeImporter::VisitObjCIvarDecl(ObjCIvarDecl *D) {\n for (auto *FoundDecl : FoundDecls) {\n if (ObjCIvarDecl *FoundIvar = dyn_cast<ObjCIvarDecl>(FoundDecl)) {\n Importer.ToDiag(FoundIvar->getLocation(), diag::note_odr_value_here) << FoundIvar->getType();"},{F,4298,"ExpectedDecl ASTNodeImporter::VisitVarDecl(VarDecl *D) {\n if (D->isFileVarDecl()) {\n for (auto *FoundDecl : FoundDecls) {\n if (auto *FoundVar = dyn_cast<VarDecl>(FoundDecl)) {\n Importer.ToDiag(FoundVar->getLocation(), diag::note_odr_value_here) << FoundVar->getType();"},{F,4523,"ExpectedDecl ASTNodeImporter::VisitObjCMethodDecl(ObjCMethodDecl *D) {\n for (auto *FoundDecl : FoundDecls) {\n if (auto *FoundMethod = dyn_cast<ObjCMethodDecl>(FoundDecl)) {\n // Check parameter types.\n for (ObjCMethodDecl::param_iterator P = D->param_begin(), PEnd = D->param_end(), FoundP = FoundMethod->param_begin(); P != PEnd; ++P, ++FoundP) {\n if (!Importer.IsStructurallyEquivalent((*P)->getType(), (*FoundP)->getType())) {\n Importer.ToDiag((*FoundP)->getLocation(), diag::note_odr_value_here) << (*FoundP)->getType();"},{F,5503,"ExpectedDecl ASTNodeImporter::VisitObjCPropertyDecl(ObjCPropertyDecl *D) {\n for (auto *FoundDecl : FoundDecls) {\n if (auto *FoundProp = dyn_cast<ObjCPropertyDecl>(FoundDecl)) {\n // Check property types.\n if (!Importer.IsStructurallyEquivalent(D->getType(), FoundProp->getType())) {\n Importer.ToDiag(FoundProp->getLocation(), diag::note_odr_value_here) << FoundProp->getType();"},{v,1872,"static bool IsStructurallyEquivalent(StructuralEquivalenceContext &Context, NonTypeTemplateParmDecl *D1, NonTypeTemplateParmDecl *D2) {\n // Check types.\n if (!IsStructurallyEquivalent(Context, D1->getType(), D2->getType())) {\n if (Context.Complain) {\n Context.Diag1(D1->getLocation(), diag::note_odr_value_here) << D1->getType();"}} | ||
}, | }, | ||
["note_odr_virtual_base"]={ | ["note_odr_virtual_base"]={ | ||
Line 7,593: | Line 7,593: | ||
[c]=a, | [c]=a, | ||
[m]={Gb,1265916115,Fb}, | [m]={Gb,1265916115,Fb}, | ||
[n]={{v, | [n]={{v,1607,"/// Determine structural equivalence of two records.\nstatic bool IsStructurallyEquivalent(StructuralEquivalenceContext &Context, RecordDecl *D1, RecordDecl *D2) {\n if (auto *D1CXX = dyn_cast<CXXRecordDecl>(D1)) {\n if (auto *D2CXX = dyn_cast<CXXRecordDecl>(D2)) {\n // Check the base classes.\n for (CXXRecordDecl::base_class_iterator Base1 = D1CXX->bases_begin(), BaseEnd1 = D1CXX->bases_end(), Base2 = D2CXX->bases_begin(); Base1 != BaseEnd1; ++Base1, ++Base2) {\n // Check virtual vs. non-virtual inheritance mismatch.\n if (Base1->isVirtual() != Base2->isVirtual()) {\n if (Context.Complain) {\n Context.Diag2(Base2->getBeginLoc(), diag::note_odr_virtual_base) << Base2->isVirtual() << Base2->getSourceRange();"}} | ||
}, | }, | ||
["note_omp_assumption_clause_continue_here"]={ | ["note_omp_assumption_clause_continue_here"]={ | ||
Line 7,605: | Line 7,605: | ||
[c]=Q, | [c]=Q, | ||
[m]={"38d18d93534d",1601621202,"[SVE] Add support to vectorize_width loop pragma for scalable vectors"}, | [m]={"38d18d93534d",1601621202,"[SVE] Add support to vectorize_width loop pragma for scalable vectors"}, | ||
[n]={{"clang/lib/Parse/ParseOpenMP.cpp", | [n]={{"clang/lib/Parse/ParseOpenMP.cpp",1690,"/// `omp assumes` or `omp begin/end assumes` <clause> [[,]<clause>]...\n/// where\n///\n/// clause:\n/// \'ext_IMPL_DEFINED\'\n/// \'absent\' \'(\' directive-name [, directive-name]* \')\'\n/// \'contains\' \'(\' directive-name [, directive-name]* \')\'\n/// \'holds\' \'(\' scalar-expression \')\'\n/// \'no_openmp\'\n/// \'no_openmp_routines\'\n/// \'no_parallelism\'\n///\nvoid Parser::ParseOpenMPAssumesDirective(OpenMPDirectiveKind DKind, SourceLocation Loc) {\n auto SkipBraces = [&](llvm::StringRef Spelling, bool IssueNote) {\n if (IssueNote && T.getCloseLocation().isValid())\n Diag(T.getCloseLocation(), diag::note_omp_assumption_clause_continue_here);"}} | ||
} | } | ||
}; | }; |
edits