|
clang 24.0.0git
|
#include "clang/AST/ASTContext.h"#include "clang/AST/CXXInheritance.h"#include "clang/AST/DeclCXX.h"#include "clang/AST/DeclFriend.h"#include "clang/AST/DeclObjC.h"#include "clang/AST/DependentDiagnostic.h"#include "clang/AST/ExprCXX.h"#include "clang/Basic/Specifiers.h"#include "clang/Sema/DelayedDiagnostic.h"#include "clang/Sema/Initialization.h"#include "clang/Sema/Lookup.h"#include "clang/Sema/Template.h"#include "clang/Sema/TemplateDeduction.h"#include "llvm/ADT/ScopeExit.h"Go to the source code of this file.
Classes | |
| class | FriendTemplateMatchContext |
Enumerations | |
| enum | AccessResult { AR_accessible , AR_inaccessible , AR_dependent } |
| A copy of Sema's enum without AR_delayed. More... | |
Functions | |
| static CXXRecordDecl * | FindDeclaringClass (NamedDecl *D) |
| static CanQual< FunctionProtoType > | GetCanonicalFunctionProto (ASTContext &Context, QualType Ty) |
| static CanQual< FunctionProtoType > | GetCanonicalFunctionProto (ASTContext &Context, const FunctionDecl *FD) |
| static const TemplateSpecializationType * | GetQualifierClassTemplateSpecializationType (ASTContext &Context, NestedNameSpecifier NNS) |
| static FunctionTemplateDecl * | TryGetFunctionTemplateDecl (FunctionDecl *FD) |
| static ClassTemplateDecl * | GetClassTemplatePattern (ClassTemplateDecl *CTD) |
| static ClassTemplateDecl * | GetClassTemplateDecl (CXXRecordDecl *RD) |
| static TemplateParameterList * | SubstTemplateParameterList (Sema &S, TemplateParameterList *TPL, DeclContext *DC, const MultiLevelTemplateArgumentList &Args) |
| static AccessResult | DeduceTemplateArguments (Sema &S, FriendTemplateDecl *FTD, DeclContext *DC, const TemplateSpecializationType *TST, ArrayRef< TemplateParameterList * > TPLs, TemplateSpecCandidateSet *FailedTSC, MultiLevelTemplateArgumentList &DeducedArgs) |
| static bool | HasSameFunctionType (Sema &S, QualType FriendType, QualType ContextType, SourceLocation Loc) |
| static bool | MightInstantiateTo (const CXXRecordDecl *From, const CXXRecordDecl *To) |
| Checks whether one class might instantiate to the other. | |
| static AccessResult | IsDerivedFromInclusive (const CXXRecordDecl *Derived, const CXXRecordDecl *Target) |
| Checks whether one class is derived from another, inclusively. | |
| static bool | MightInstantiateTo (DeclContext *Context, DeclContext *Friend) |
| static bool | MightInstantiateTo (CanQualType Context, CanQualType Friend) |
| static bool | MightInstantiateTo (CanQual< FunctionProtoType > Context, CanQual< FunctionProtoType > Friend) |
| static bool | MightInstantiateTo (ASTContext &Ctx, DeclarationName Context, DeclarationName Friend) |
| static bool | MightInstantiateTo (ASTContext &Ctx, FunctionDecl *Context, FunctionDecl *Friend) |
| static bool | MightInstantiateTo (ASTContext &Ctx, FunctionTemplateDecl *Context, FunctionTemplateDecl *Friend) |
| static AccessResult | MatchesFriend (Sema &S, const EffectiveContext &EC, const CXXRecordDecl *Friend) |
| static AccessResult | MatchesFriend (Sema &S, const EffectiveContext &EC, CanQualType Friend) |
| static AccessResult | MatchesFriend (Sema &S, const EffectiveContext &EC, ClassTemplateDecl *Friend) |
| Determines whether the given friend class template matches anything in the effective context. | |
| static AccessResult | MatchesFriend (Sema &S, const EffectiveContext &EC, FunctionDecl *Friend) |
| Determines whether the given friend function matches anything in the effective context. | |
| static AccessResult | MatchesFriend (Sema &S, const EffectiveContext &EC, FunctionTemplateDecl *Friend) |
| Determines whether the given friend function template matches anything in the effective context. | |
| static AccessResult | MatchesFriend (Sema &S, const EffectiveContext &EC, NamedDecl *ND) |
| static AccessResult | MatchesFriend (Sema &S, FriendTemplateDecl *FTD, DeclarationName FriendName, TagTypeKind FriendTagKind, ClassTemplateDecl *ContextCTD, const TemplateSpecializationType *FriendTST, ArrayRef< TemplateParameterList * > TPLs, TemplateParameterList *MemberTPL, TemplateSpecCandidateSet *FailedTSC) |
| static AccessResult | MatchesFriend (Sema &S, const EffectiveContext &EC, FriendTemplateDecl *FTD, ClassTemplateDecl *FriendCTD, NestedNameSpecifier Qualifier, TemplateSpecCandidateSet *FailedTSC) |
| static AccessResult | MatchesFriend (Sema &S, const EffectiveContext &EC, FriendTemplateDecl *FTD, TemplateName FriendTemplate, ClassTemplateDecl *FriendCTD, TemplateSpecCandidateSet *FailedTSC) |
| static AccessResult | MatchesFriend (Sema &S, const EffectiveContext &EC, FriendTemplateDecl *FTD, ClassTemplateDecl *FriendCTD, TemplateSpecCandidateSet *FailedTSC) |
| static AccessResult | MatchesFriend (Sema &S, FriendTemplateDecl *FTD, FunctionDecl *FriendFD, FunctionDecl *ContextFD, const TemplateSpecializationType *FriendTST, ArrayRef< TemplateParameterList * > TPLs, TemplateSpecCandidateSet *FailedTSC) |
| static AccessResult | MatchesFriend (Sema &S, const EffectiveContext &EC, FriendTemplateDecl *FTD, FunctionDecl *FriendFD, TemplateSpecCandidateSet *FailedTSC) |
| static AccessResult | MatchesFriend (Sema &S, const EffectiveContext &EC, FriendTemplateDecl *FTD, NamedDecl *Friend, TemplateSpecCandidateSet *FailedTSC) |
| static AccessResult | MatchesFriend (Sema &S, const EffectiveContext &EC, FriendTemplateDecl *FTD, TypeSourceInfo *FriendTSI, TemplateSpecCandidateSet *FailedTSC) |
| static AccessResult | MatchesFriend (Sema &S, const EffectiveContext &EC, FriendDecl *FriendD) |
| Determines whether the given friend declaration matches anything in the effective context. | |
| static AccessResult | MatchesFriend (Sema &S, const EffectiveContext &EC, FriendTemplateDecl *FTD, TemplateSpecCandidateSet *FailedTSC) |
| static AccessResult | GetFriendKind (Sema &S, const EffectiveContext &EC, const CXXRecordDecl *Class, TemplateSpecCandidateSet *FailedTSC) |
| static AccessResult | GetProtectedFriendKind (Sema &S, const EffectiveContext &EC, const CXXRecordDecl *InstanceContext, const CXXRecordDecl *NamingClass, TemplateSpecCandidateSet *FailedTSC) |
| Search for a class P that EC is a friend of, under the constraint InstanceContext <= P if InstanceContext exists, or else NamingClass <= P and with the additional restriction that a protected member of NamingClass would have some natural access in P, which implicitly imposes the constraint that P <= NamingClass. | |
| static AccessResult | HasAccess (Sema &S, const EffectiveContext &EC, const CXXRecordDecl *NamingClass, AccessSpecifier Access, const AccessTarget &Target, TemplateSpecCandidateSet *FailedTSC) |
| static CXXBasePath * | FindBestPath (Sema &S, const EffectiveContext &EC, AccessTarget &Target, AccessSpecifier FinalAccess, CXXBasePaths &Paths) |
| Finds the best path from the naming class to the declaring class, taking friend declarations into account. | |
| static bool | TryDiagnoseProtectedAccess (Sema &S, const EffectiveContext &EC, AccessTarget &Target) |
| Given that an entity has protected natural access, check whether access might be denied because of the protected member access restriction. | |
| static void | diagnoseBadDirectAccess (Sema &S, const EffectiveContext &EC, AccessTarget &entity) |
| We are unable to access a given declaration due to its direct access control; diagnose that. | |
| static void | DiagnoseAccessPath (Sema &S, const EffectiveContext &EC, AccessTarget &entity) |
| Diagnose the path which caused the given declaration or base class to become inaccessible. | |
| static void | DiagnoseBadAccess (Sema &S, SourceLocation Loc, const EffectiveContext &EC, AccessTarget &Entity) |
| static bool | IsMicrosoftUsingDeclarationAccessBug (Sema &S, SourceLocation AccessLoc, AccessTarget &Entity) |
| MSVC has a bug where if during an using declaration name lookup, the declaration found is unaccessible (private) and that declaration was bring into scope via another using declaration whose target declaration is accessible (public) then no error is generated. | |
| static AccessResult | IsAccessible (Sema &S, const EffectiveContext &EC, AccessTarget &Entity, TemplateSpecCandidateSet *FailedTSC) |
| Determines whether the accessed entity is accessible. | |
| static void | DelayDependentAccess (Sema &S, const EffectiveContext &EC, SourceLocation Loc, const AccessTarget &Entity) |
| static AccessResult | CheckEffectiveAccess (Sema &S, const EffectiveContext &EC, SourceLocation Loc, AccessTarget &Entity, TemplateSpecCandidateSet *FailedTSC) |
| static AccessResult | CheckEffectiveAccess (Sema &S, const EffectiveContext &EC, SourceLocation Loc, AccessTarget &Entity) |
| static Sema::AccessResult | CheckAccess (Sema &S, SourceLocation Loc, AccessTarget &Entity) |
| enum AccessResult |
A copy of Sema's enum without AR_delayed.
| Enumerator | |
|---|---|
| AR_accessible | |
| AR_inaccessible | |
| AR_dependent | |
Definition at line 32 of file SemaAccess.cpp.
|
static |
Definition at line 2032 of file SemaAccess.cpp.
References clang::Sema::DelayedDiagnostics::add(), AR_accessible, clang::Sema::AR_accessible, clang::Sema::AR_delayed, AR_dependent, clang::Sema::AR_dependent, AR_inaccessible, clang::Sema::AR_inaccessible, clang::AS_public, CheckEffectiveAccess(), clang::Sema::CurContext, clang::Sema::DelayedDiagnostics, clang::Sema::getCurScope(), clang::Scope::getParent(), clang::Scope::isFriendScope(), clang::sema::DelayedDiagnostic::makeAccess(), and clang::Sema::DelayedDiagnostics::shouldDelayDiagnostics().
Referenced by clang::Sema::CheckAddressOfMemberAccess(), clang::Sema::CheckAllocationAccess(), clang::Sema::CheckConstructorAccess(), clang::Sema::CheckDestructorAccess(), clang::Sema::CheckLookupAccess(), clang::Sema::CheckMemberAccess(), clang::Sema::CheckMemberOperatorAccess(), clang::Sema::CheckStructuredBindingMemberAccess(), clang::Sema::CheckUnresolvedLookupAccess(), clang::Sema::CheckUnresolvedMemberAccess(), clang::Sema::HandleDependentAccessCheck(), and clang::Sema::isMemberAccessibleForDeletion().
|
static |
Definition at line 2018 of file SemaAccess.cpp.
References clang::AS_public, CheckEffectiveAccess(), and clang::FriendTemplate.
|
static |
Definition at line 1985 of file SemaAccess.cpp.
References AR_accessible, AR_dependent, AR_inaccessible, DelayDependentAccess(), DiagnoseBadAccess(), clang::Sema::getLangOpts(), IsAccessible(), IsMicrosoftUsingDeclarationAccessBug(), and clang::TemplateSpecCandidateSet::NoteCandidates().
Referenced by CheckAccess(), CheckEffectiveAccess(), clang::Sema::CheckFriendAccess(), and clang::Sema::HandleDelayedAccessCheck().
|
static |
Definition at line 357 of file SemaAccess.cpp.
References AR_accessible, AR_dependent, AR_inaccessible, clang::Sema::Context, clang::declaresSameEntity(), clang::Sema::DeduceTemplateArguments(), GetClassTemplatePattern(), clang::RedeclarableTemplateDecl::getInjectedTemplateArgs(), and clang::Decl::getLocation().
Referenced by clang::Sema::BuildTypeAwareUsualDelete(), FriendTemplateMatchContext::deduce(), DeduceTemplateArguments(), DeduceTemplateArguments(), DeduceTemplateArguments(), DeduceTemplateArgumentsByTypeMatch(), isAtLeastAsSpecializedAs(), MatchesFriend(), clang::Sema::ResolveSingleFunctionTemplateSpecialization(), and clang::Sema::usesPartialOrExplicitSpecialization().
|
static |
Definition at line 1968 of file SemaAccess.cpp.
References clang::DependentDiagnostic::Access, clang::Sema::Context, clang::DependentDiagnostic::Create(), and clang::DeclContext::isDependentContext().
Referenced by CheckEffectiveAccess().
|
static |
Diagnose the path which caused the given declaration or base class to become inaccessible.
Definition at line 1722 of file SemaAccess.cpp.
References clang::CXXBasePath::Access, AR_accessible, AR_dependent, AR_inaccessible, clang::AS_none, clang::AS_private, clang::AS_protected, clang::AS_public, clang::SemaBase::Diag(), diagnoseBadDirectAccess(), FindBestPath(), clang::Decl::getAccess(), clang::CXXBaseSpecifier::getAccessSpecifier(), clang::CXXBaseSpecifier::getAccessSpecifierAsWritten(), clang::SourceRange::getBegin(), clang::CXXRecordDecl::getCanonicalDecl(), clang::CXXBaseSpecifier::getSourceRange(), and HasAccess().
Referenced by DiagnoseBadAccess().
|
static |
Definition at line 1833 of file SemaAccess.cpp.
References clang::AS_protected, clang::Sema::Context, clang::SemaBase::Diag(), DiagnoseAccessPath(), clang::ASTContext::getCanonicalTagType(), and clang::NamedDecl::getDeclName().
Referenced by CheckEffectiveAccess().
|
static |
We are unable to access a given declaration due to its direct access control; diagnose that.
Definition at line 1664 of file SemaAccess.cpp.
References clang::AS_protected, clang::cast(), clang::DeclContext::decls(), clang::SemaBase::Diag(), FindDeclaringClass(), clang::Decl::getAccess(), clang::Decl::getDeclContext(), clang::Decl::getLocation(), clang::DeclContext::getParent(), clang::Decl::getPreviousDecl(), clang::isa(), clang::CXXRecordDecl::isInjectedClassName(), clang::Decl::isOutOfLine(), and TryDiagnoseProtectedAccess().
Referenced by DiagnoseAccessPath().
|
static |
Finds the best path from the naming class to the declaring class, taking friend declarations into account.
C++0x [class.access.base]p5: A member m is accessible at the point R when named in class N if [M1] m as a member of N is public, or [M2] m as a member of N is private, and R occurs in a member or friend of class N, or [M3] m as a member of N is protected, and R occurs in a member or friend of class N, or in a member or friend of a class P derived from N, where m as a member of P is public, private, or protected, or [M4] there exists a base class B of N that is accessible at R, and m is accessible at R when named in class B.
C++0x [class.access.base]p4: A base class B of N is accessible at R, if [B1] an invented public member of B would be a public member of N, or [B2] R occurs in a member or friend of class N, and an invented public member of B would be a private or protected member of N, or [B3] R occurs in a member or friend of a class P derived from N, and an invented public member of B would be a private or protected member of P, or [B4] there exists a class S such that B is a base class of S accessible at R and S is a base class of N accessible at R.
Along a single inheritance path we can restate both of these iteratively:
First, we note that M1-4 are equivalent to B1-4 if the member is treated as a notional base of its declaring class with inheritance access equivalent to the member's access. Therefore we need only ask whether a class B is accessible from a class N in context R.
Let B_1 .. B_n be the inheritance path in question (i.e. where B_1 = N, B_n = B, and for all i, B_{i+1} is a direct base class of B_i). For i in 1..n, we will calculate ACAB(i), the access to the closest accessible base in the path: Access(a, b) = (* access on the base specifier from a to b *) Merge(a, forbidden) = forbidden Merge(a, private) = forbidden Merge(a, b) = min(a,b) Accessible(c, forbidden) = false Accessible(c, private) = (R is c) || IsFriend(c, R) Accessible(c, protected) = (R derived from c) || IsFriend(c, R) Accessible(c, public) = true ACAB(n) = public ACAB(i) = let AccessToBase = Merge(Access(B_i, B_{i+1}), ACAB(i+1)) in if Accessible(B_i, AccessToBase) then public else AccessToBase
B is an accessible base of N at R iff ACAB(1) = public.
| FinalAccess | the access of the "final step", or AS_public if there is no final step. |
Definition at line 1496 of file SemaAccess.cpp.
References clang::CXXBasePath::Access, AR_accessible, AR_dependent, AR_inaccessible, clang::AS_none, clang::AS_private, clang::AS_public, clang::CXXBasePaths::begin(), clang::CXXBasePaths::end(), clang::CXXRecordDecl::getCanonicalDecl(), HasAccess(), clang::CXXRecordDecl::isDerivedFrom(), and Next.
Referenced by DiagnoseAccessPath(), and IsAccessible().
|
static |
Definition at line 64 of file SemaAccess.cpp.
References clang::cast(), clang::Decl::getDeclContext(), clang::isa(), and clang::RecordDecl::isAnonymousStructOrUnion().
Referenced by diagnoseBadDirectAccess().
|
static |
Definition at line 285 of file SemaAccess.cpp.
References GetCanonicalFunctionProto(), and clang::ValueDecl::getType().
|
static |
Definition at line 279 of file SemaAccess.cpp.
References clang::CanQual< T >::getAs().
Referenced by GetCanonicalFunctionProto(), and MightInstantiateTo().
|
static |
Definition at line 331 of file SemaAccess.cpp.
References clang::CXXRecordDecl::getDescribedClassTemplate().
Referenced by MatchesFriend(), and MatchesFriend().
|
static |
Definition at line 325 of file SemaAccess.cpp.
References clang::ClassTemplateDecl::getInstantiatedFromMemberTemplate().
Referenced by DeduceTemplateArguments().
|
static |
Definition at line 1132 of file SemaAccess.cpp.
References AR_accessible, AR_dependent, AR_inaccessible, clang::Friend, and MatchesFriend().
Referenced by GetProtectedFriendKind(), and HasAccess().
|
static |
Search for a class P that EC is a friend of, under the constraint InstanceContext <= P if InstanceContext exists, or else NamingClass <= P and with the additional restriction that a protected member of NamingClass would have some natural access in P, which implicitly imposes the constraint that P <= NamingClass.
This isn't quite the condition laid out in the standard. Instead of saying that a notional protected member of NamingClass would have to have some natural access in P, it says the actual target has to have some natural access in P, which opens up the possibility that the target (which is not necessarily a member of NamingClass) might be more accessible along some path not passing through it. That's really a bad idea, though, because it introduces two problems:
Definition at line 1278 of file SemaAccess.cpp.
References AR_accessible, AR_dependent, AR_inaccessible, clang::CXXRecordDecl::getCanonicalDecl(), and GetFriendKind().
Referenced by HasAccess().
|
static |
Definition at line 290 of file SemaAccess.cpp.
References clang::Type::getAs(), clang::Type::getAsNonAliasTemplateSpecializationType(), clang::NestedNameSpecifier::getAsType(), clang::NestedNameSpecifier::getKind(), and clang::NestedNameSpecifier::Type.
Referenced by MatchesFriend(), MatchesFriend(), and MatchesFriend().
|
static |
Definition at line 1297 of file SemaAccess.cpp.
References AR_accessible, AR_dependent, AR_inaccessible, clang::AS_private, clang::AS_protected, clang::AS_public, clang::CXXRecordDecl::getCanonicalDecl(), GetFriendKind(), clang::Sema::getLangOpts(), GetProtectedFriendKind(), IsDerivedFromInclusive(), and MightInstantiateTo().
Referenced by DiagnoseAccessPath(), FindBestPath(), and IsAccessible().
|
static |
Definition at line 424 of file SemaAccess.cpp.
References clang::Type::castAs(), clang::Sema::CheckEquivalentExceptionSpec(), clang::Sema::Context, clang::ASTContext::hasSameFunctionTypeIgnoringExceptionSpec(), and clang::SemaBase::PDiag().
Referenced by MatchesFriend().
|
static |
Determines whether the accessed entity is accessible.
Public members have been weeded out by this point.
Definition at line 1889 of file SemaAccess.cpp.
References clang::CXXBasePath::Access, AR_accessible, AR_dependent, AR_inaccessible, clang::AS_none, clang::AS_public, FindBestPath(), and HasAccess().
Referenced by CheckEffectiveAccess().
|
static |
Checks whether one class is derived from another, inclusively.
Properly indicates when it couldn't be determined due to dependence.
This should probably be donated to AST or at least Sema.
Definition at line 461 of file SemaAccess.cpp.
References AR_accessible, AR_dependent, AR_inaccessible, clang::CXXRecordDecl::bases(), clang::CXXRecordDecl::getCanonicalDecl(), clang::CXXRecordDecl::hasDefinition(), clang::DeclContext::isDependentContext(), clang::CXXRecordDecl::isLambda(), MightInstantiateTo(), and clang::T.
Referenced by HasAccess(), and TryDiagnoseProtectedAccess().
|
static |
MSVC has a bug where if during an using declaration name lookup, the declaration found is unaccessible (private) and that declaration was bring into scope via another using declaration whose target declaration is accessible (public) then no error is generated.
Example: class A { public: int f(); }; class B : public A { private: using A::f; }; class C : public B { private: using B::f; };
Here, B::f is private so this should fail in Standard C++, but because B::f refers to A::f which is public MSVC accepts it.
Definition at line 1868 of file SemaAccess.cpp.
References clang::AS_private, clang::AS_protected, clang::AS_public, clang::SemaBase::Diag(), clang::Decl::getAccess(), and clang::NamedDecl::getQualifiedNameAsString().
Referenced by CheckEffectiveAccess().
|
static |
Definition at line 617 of file SemaAccess.cpp.
References AR_dependent, AR_inaccessible, clang::Friend, and MatchesFriend().
|
static |
Determines whether the given friend class template matches anything in the effective context.
Definition at line 632 of file SemaAccess.cpp.
References AR_accessible, AR_dependent, AR_inaccessible, clang::cast(), clang::declaresSameEntity(), clang::Friend, clang::Decl::getDeclContext(), clang::NamedDecl::getDeclName(), clang::isa(), and MightInstantiateTo().
|
static |
Definition at line 601 of file SemaAccess.cpp.
References AR_accessible, AR_dependent, AR_inaccessible, clang::Friend, and MightInstantiateTo().
Referenced by GetFriendKind(), MatchesFriend(), MatchesFriend(), MatchesFriend(), MatchesFriend(), MatchesFriend(), MatchesFriend(), MatchesFriend(), MatchesFriend(), MatchesFriend(), and MatchesFriend().
|
static |
Determines whether the given friend declaration matches anything in the effective context.
Definition at line 1102 of file SemaAccess.cpp.
References AR_accessible, AR_inaccessible, clang::Friend, clang::FriendDecl::getFriendDecl(), clang::FriendDecl::getFriendType(), clang::Decl::isInvalidDecl(), MatchesFriend(), and clang::T.
|
static |
Definition at line 781 of file SemaAccess.cpp.
References AR_accessible, AR_dependent, AR_inaccessible, clang::Sema::Context, GetClassTemplateDecl(), clang::NamedDecl::getDeclName(), GetQualifierClassTemplateSpecializationType(), clang::TagDecl::getTagKind(), clang::ClassTemplateDecl::getTemplatedDecl(), clang::FriendTemplateDecl::getTemplateParameterLists(), and MatchesFriend().
|
static |
Definition at line 823 of file SemaAccess.cpp.
References clang::TagDecl::getQualifier(), clang::ClassTemplateDecl::getTemplatedDecl(), and MatchesFriend().
|
static |
Definition at line 941 of file SemaAccess.cpp.
References AR_accessible, AR_dependent, AR_inaccessible, clang::Sema::Context, clang::DeclaratorDecl::getQualifier(), GetQualifierClassTemplateSpecializationType(), clang::FriendTemplateDecl::getTemplateParameterLists(), and MatchesFriend().
|
static |
Definition at line 965 of file SemaAccess.cpp.
References clang::Friend, clang::FriendTemplate, clang::FriendTemplateDecl::getFriendTemplateName(), and MatchesFriend().
|
static |
Definition at line 812 of file SemaAccess.cpp.
References clang::FriendTemplate, clang::TagDecl::getQualifier(), clang::ClassTemplateDecl::getTemplatedDecl(), and MatchesFriend().
|
static |
Definition at line 1118 of file SemaAccess.cpp.
References AR_accessible, clang::Friend, clang::FriendTemplateDecl::getFriendDecl(), clang::FriendDecl::getFriendType(), clang::Decl::isInvalidDecl(), and MatchesFriend().
|
static |
Definition at line 979 of file SemaAccess.cpp.
References AR_accessible, AR_dependent, AR_inaccessible, clang::Sema::Context, FriendTemplateMatchContext::deduce(), DeduceTemplateArguments(), clang::FriendTemplate, clang::Type::getAs(), clang::TypeLoc::getAs(), clang::ASTContext::getCanonicalTagType(), clang::ASTContext::getCanonicalType(), GetClassTemplateDecl(), clang::Decl::getDeclContext(), clang::NamedDecl::getDeclName(), FriendTemplateMatchContext::getDeducedArgs(), clang::FriendTemplateDecl::getFriendTemplateName(), clang::Decl::getLocation(), GetQualifierClassTemplateSpecializationType(), clang::KeywordHelpers::getTagTypeKindForKeyword(), clang::ClassTemplateDecl::getTemplatedDecl(), clang::FriendTemplateDecl::getTemplateParameterLists(), clang::TypeSourceInfo::getType(), clang::TypeSourceInfo::getTypeLoc(), FriendTemplateMatchContext::hasDeducedArgs(), FriendTemplateMatchContext::hasErrorOccurred(), clang::ASTContext::hasSameType(), clang::DeclContext::isDependentContext(), clang::Type::isDependentType(), clang::TemplateName::isNull(), clang::TagDecl::isUnion(), MatchesFriend(), clang::Sema::SubstFriendType(), and clang::Union.
|
static |
Determines whether the given friend function matches anything in the effective context.
Definition at line 684 of file SemaAccess.cpp.
References AR_accessible, AR_dependent, AR_inaccessible, clang::Sema::Context, clang::Friend, and MightInstantiateTo().
|
static |
Determines whether the given friend function template matches anything in the effective context.
Definition at line 703 of file SemaAccess.cpp.
References AR_accessible, AR_dependent, AR_inaccessible, clang::Sema::Context, clang::Friend, MightInstantiateTo(), and TryGetFunctionTemplateDecl().
|
static |
Definition at line 727 of file SemaAccess.cpp.
References clang::cast(), clang::Decl::getCanonicalDecl(), clang::isa(), and MatchesFriend().
|
static |
Definition at line 743 of file SemaAccess.cpp.
References AR_accessible, AR_dependent, AR_inaccessible, FriendTemplateMatchContext::deduce(), clang::Decl::getDeclContext(), clang::NamedDecl::getDeclName(), FriendTemplateMatchContext::getDeducedArgs(), clang::Decl::getLexicalDeclContext(), clang::Decl::getLocation(), clang::ClassTemplateDecl::getTemplatedDecl(), clang::TemplateDecl::getTemplateParameters(), FriendTemplateMatchContext::hasDeducedArgs(), FriendTemplateMatchContext::hasErrorOccurred(), clang::DeclContext::isDependentContext(), clang::TagDecl::isUnion(), SubstTemplateParameterList(), clang::Sema::TemplateParameterListsAreEqual(), clang::Sema::TPL_TemplateMatch, and clang::Union.
|
static |
Definition at line 832 of file SemaAccess.cpp.
References AR_accessible, AR_dependent, AR_inaccessible, clang::Sema::AreConstraintExpressionsEqual(), clang::ASTTemplateArgumentListInfo::arguments(), clang::AssociatedConstraint::ConstraintExpr, clang::Sema::Context, clang::declaresSameEntity(), FriendTemplateMatchContext::deduce(), clang::Sema::DeduceTemplateArguments(), clang::FriendTemplate, clang::ActionResult< PtrTy, Compress >::get(), clang::Decl::getDeclContext(), clang::NamedDecl::getDeclName(), FriendTemplateMatchContext::getDeducedArgs(), clang::FunctionDecl::getDescribedFunctionTemplate(), clang::ASTTemplateArgumentListInfo::getLAngleLoc(), clang::Decl::getLexicalDeclContext(), clang::Decl::getLocation(), clang::ASTTemplateArgumentListInfo::getRAngleLoc(), clang::FunctionTemplateDecl::getTemplatedDecl(), clang::TemplateDecl::getTemplateParameters(), clang::FunctionDecl::getTemplateSpecializationArgsAsWritten(), clang::DeclaratorDecl::getTrailingRequiresClause(), clang::ValueDecl::getType(), FriendTemplateMatchContext::hasDeducedArgs(), FriendTemplateMatchContext::hasErrorOccurred(), HasSameFunctionType(), clang::DeclContext::isDependentContext(), clang::AssociatedConstraint::isNull(), clang::QualType::isNull(), clang::ActionResult< PtrTy, Compress >::isUsable(), MightInstantiateTo(), clang::Sema::ContextRAII::pop(), clang::TemplateArgumentListInfo::setLAngleLoc(), clang::TemplateArgumentListInfo::setRAngleLoc(), clang::Sema::SubstConstraintExprWithoutSatisfaction(), clang::Sema::SubstTemplateArguments(), SubstTemplateParameterList(), clang::Sema::SubstType(), clang::Success, clang::Sema::TemplateParameterListsAreEqual(), clang::Sema::TPL_TemplateMatch, and TryGetFunctionTemplateDecl().
|
static |
Definition at line 556 of file SemaAccess.cpp.
References clang::DeclarationName::CXXConstructorName, clang::DeclarationName::CXXConversionFunctionName, clang::DeclarationName::CXXDestructorName, clang::Friend, clang::ASTContext::getCanonicalType(), and MightInstantiateTo().
|
static |
Definition at line 576 of file SemaAccess.cpp.
References clang::Friend, GetCanonicalFunctionProto(), clang::DeclContext::isDependentContext(), and MightInstantiateTo().
|
static |
Definition at line 595 of file SemaAccess.cpp.
References clang::Friend, and MightInstantiateTo().
|
static |
Definition at line 538 of file SemaAccess.cpp.
References clang::Friend, and MightInstantiateTo().
|
static |
Definition at line 527 of file SemaAccess.cpp.
References clang::Friend.
|
static |
Checks whether one class might instantiate to the other.
Definition at line 437 of file SemaAccess.cpp.
References clang::Decl::getDeclContext(), clang::NamedDecl::getDeclName(), clang::DeclContext::getPrimaryContext(), and clang::DeclContext::isFileContext().
Referenced by HasAccess(), IsDerivedFromInclusive(), MatchesFriend(), MatchesFriend(), MatchesFriend(), MatchesFriend(), MatchesFriend(), MightInstantiateTo(), MightInstantiateTo(), MightInstantiateTo(), and MightInstantiateTo().
|
static |
Definition at line 508 of file SemaAccess.cpp.
References clang::Friend.
|
static |
Definition at line 338 of file SemaAccess.cpp.
References clang::TemplateParameterList::asArray(), clang::Sema::Context, clang::TemplateParameterList::Create(), clang::ActionResult< PtrTy, Compress >::get(), clang::TemplateParameterList::getLAngleLoc(), clang::TemplateParameterList::getRAngleLoc(), clang::TemplateParameterList::getRequiresClause(), clang::TemplateParameterList::getTemplateLoc(), clang::ActionResult< PtrTy, Compress >::isUsable(), clang::Sema::SubstConstraintExprWithoutSatisfaction(), and clang::Sema::SubstTemplateParams().
Referenced by MatchesFriend(), and MatchesFriend().
|
static |
Given that an entity has protected natural access, check whether access might be denied because of the protected member access restriction.
Definition at line 1589 of file SemaAccess.cpp.
References AR_accessible, AR_dependent, AR_inaccessible, clang::cast(), clang::Sema::Context, clang::SemaBase::Diag(), clang::Decl::getAsFunction(), clang::ASTContext::getCanonicalTagType(), clang::Decl::getLocation(), clang::isa(), and IsDerivedFromInclusive().
Referenced by diagnoseBadDirectAccess().
|
static |
Definition at line 307 of file SemaAccess.cpp.
References clang::FunctionTemplateDecl::getCanonicalDecl(), clang::FunctionDecl::getDescribedFunctionTemplate(), clang::FunctionDecl::getPrimaryTemplate(), and clang::FunctionDecl::getTemplateInstantiationPattern().
Referenced by MatchesFriend(), and MatchesFriend().