Go to the documentation of this file.
25 using namespace clang;
35 return !Bases.count(
Base->getCanonicalDecl());
37 return BaseIsNotInSet(Record) && Record->
forallBases(BaseIsNotInSet);
90 assert(!R.
empty() && (*R.
begin())->isCXXClassMember());
95 (!isa<CXXMethodDecl>(DC) || cast<CXXMethodDecl>(DC)->isStatic());
101 bool hasNonInstance =
false;
102 bool isField =
false;
106 D = D->getUnderlyingDecl();
108 if (D->isCXXInstanceMember()) {
109 isField |= isa<FieldDecl>(D) || isa<MSPropertyDecl>(D) ||
110 isa<IndirectFieldDecl>(D);
115 hasNonInstance =
true;
133 assert(!AbstractInstanceResult);
155 if (isStaticContext) {
159 return AbstractInstanceResult ? AbstractInstanceResult
165 contextClass = MD->
getParent()->getCanonicalDecl();
167 contextClass = cast<CXXRecordDecl>(DC);
175 if (R.getNamingClass() &&
182 Classes.insert(R.getNamingClass()->getCanonicalDecl());
190 AbstractInstanceResult ? AbstractInstanceResult :
209 CXXMethodDecl *Method = dyn_cast<CXXMethodDecl>(FunctionLevelDC);
213 bool InStaticMethod = Method && Method->
isStatic();
214 bool IsField = isa<FieldDecl>(Rep) || isa<IndirectFieldDecl>(Rep);
216 if (IsField && InStaticMethod)
218 SemaRef.
Diag(Loc, diag::err_invalid_member_use_in_static_method)
219 << Range << nameInfo.
getName();
220 else if (ContextClass && RepClass && SS.
isEmpty() && !InStaticMethod &&
221 !RepClass->
Equals(ContextClass) && RepClass->
Encloses(ContextClass))
224 SemaRef.
Diag(Loc, diag::err_nested_non_static_member_use)
225 << IsField << RepClass << nameInfo.
getName() << ContextClass << Range;
227 SemaRef.
Diag(Loc, diag::err_invalid_non_static_member_use)
228 << nameInfo.
getName() << Range;
230 SemaRef.
Diag(Loc, diag::err_member_call_without_object)
241 return BuildImplicitMemberExpr(SS, TemplateKWLoc, R, TemplateArgs,
true, S);
246 return BuildImplicitMemberExpr(SS, TemplateKWLoc, R, TemplateArgs,
false,
250 Diag(R.
getNameLoc(), diag::warn_cxx98_compat_non_static_member_use)
257 if (TemplateArgs || TemplateKWLoc.
isValid())
258 return BuildTemplateIdExpr(SS, TemplateKWLoc, R,
false, TemplateArgs);
259 return AsULE ? AsULE : BuildDeclarationNameExpr(SS, R,
false);
268 llvm_unreachable(
"unexpected instance member access kind");
290 return (len >= 1 && len <= 4) || len == 8 || len == 16;
314 bool HalvingSwizzle =
false;
318 bool HexSwizzle = (*compStr ==
's' || *compStr ==
'S') && compStr[1];
320 bool HasRepeated =
false;
321 bool HasIndex[16] = {};
327 if (!strcmp(compStr,
"hi") || !strcmp(compStr,
"lo") ||
328 !strcmp(compStr,
"even") || !strcmp(compStr,
"odd")) {
329 HalvingSwizzle =
true;
330 }
else if (!HexSwizzle &&
332 bool HasRGBA =
IsRGBA(*compStr);
335 if (HasRGBA !=
IsRGBA(*compStr))
337 if (HasIndex[Idx]) HasRepeated =
true;
338 HasIndex[Idx] =
true;
343 if (HasRGBA || (*compStr &&
IsRGBA(*compStr))) {
346 const char *DiagBegin = HasRGBA ? CompName->
getNameStart() : compStr;
347 S.
Diag(OpLoc, diag::ext_opencl_ext_vector_type_rgba_selector)
348 << StringRef(DiagBegin, 1) <<
SourceRange(CompLoc);
352 if (HexSwizzle) compStr++;
354 if (HasIndex[Idx]) HasRepeated =
true;
355 HasIndex[Idx] =
true;
360 if (!HalvingSwizzle && *compStr) {
363 S.
Diag(OpLoc, diag::err_ext_vector_component_name_illegal)
370 if (!HalvingSwizzle) {
378 S.
Diag(OpLoc, diag::err_ext_vector_component_exceeds_length)
388 unsigned SwizzleLength = CompName->
getLength();
394 S.
Diag(OpLoc, diag::err_opencl_ext_vector_component_invalid_length)
405 unsigned CompSize = HalvingSwizzle ? (vecType->
getNumElements() + 1) / 2
419 for (Sema::ExtVectorDeclsType::iterator
423 if ((*I)->getUnderlyingType() == VT)
441 for (
const auto *I : PDecl->
protocols()) {
454 Decl *GDecl =
nullptr;
455 for (
const auto *I : QIdTy->
quals()) {
469 for (
const auto *I : QIdTy->
quals()) {
498 if (PT && (!getLangOpts().ObjC ||
500 assert(BaseExpr &&
"cannot happen with implicit member accesses");
501 Diag(OpLoc, diag::err_typecheck_member_reference_struct_union)
508 isDependentScopeSpecifier(SS) ||
509 (TemplateArgs && llvm::any_of(TemplateArgs->
arguments(),
511 return Arg.getArgument().isDependent();
517 Context, BaseExpr, BaseType, IsArrow, OpLoc,
519 NameInfo, TemplateArgs);
536 SemaRef.
Diag(nameInfo.
getLoc(), diag::err_qualified_member_of_unrelated)
537 << SS.
getRange() << rep << BaseType;
557 cast_or_null<CXXRecordDecl>(computeDeclContext(BaseType));
568 if (!BaseExpr && !(*I)->isCXXInstanceMember())
595 explicit RecordMemberExprValidatorCCC(
const RecordType *RTy)
596 : Record(RTy->getDecl()) {
599 WantTypeSpecifiers =
false;
600 WantExpressionKeywords =
false;
601 WantCXXNamedCasts =
false;
602 WantFunctionLikeCasts =
false;
603 WantRemainingKeywords =
false;
606 bool ValidateCandidate(
const TypoCorrection &candidate)
override {
610 if (!ND || !(isa<ValueDecl>(ND) || isa<FunctionTemplateDecl>(ND)))
614 if (Record->containsDecl(ND))
617 if (
const auto *RD = dyn_cast<CXXRecordDecl>(Record)) {
619 for (
const auto &BS : RD->bases()) {
620 if (
const auto *BSTy = BS.getType()->getAs<
RecordType>()) {
621 if (BSTy->getDecl()->containsDecl(ND))
630 std::unique_ptr<CorrectionCandidateCallback> clone()
override {
631 return std::make_unique<RecordMemberExprValidatorCCC>(*
this);
651 diag::err_typecheck_incomplete_tag,
655 if (HasTemplateArgs || TemplateKWLoc.
isValid()) {
676 assert(DC &&
"Cannot handle non-computable dependent contexts in lookup");
678 if (!isa<TypeDecl>(DC)) {
702 RecordMemberExprValidatorCCC CCC(RTy);
707 assert(!TC.isKeyword() &&
708 "Got a keyword as a correction for a member!");
709 bool DroppedSpecifier =
710 TC.WillReplaceSpecifier() &&
711 Typo.getAsString() == TC.getAsString(SemaRef.getLangOpts());
712 SemaRef.diagnoseTypo(TC, SemaRef.PDiag(diag::err_no_member_suggest)
713 << Typo << DC << DroppedSpecifier
716 SemaRef.Diag(TypoLoc, diag::err_no_member) << Typo << DC << BaseRange;
720 LookupResult R(Q.SemaRef, Q.NameInfo, Q.LookupKind, Q.Redecl);
722 R.suppressDiagnostics();
723 R.setLookupName(TC.getCorrection());
728 BaseExpr, BaseExpr->getType(), OpLoc, IsArrow, SS,
SourceLocation(),
729 nullptr, R,
nullptr,
nullptr);
739 Decl *ObjCImpDecl,
bool HasTemplateArgs,
756 SS, TemplateKWLoc, FirstQualifierInScope,
757 NameInfo, TemplateArgs);
768 SS, TemplateArgs !=
nullptr, TemplateKWLoc, TE))
779 TemplateArgs !=
nullptr, TemplateKWLoc);
785 if (Result.isInvalid())
792 BaseType =
Base->getType();
796 OpLoc, IsArrow, SS, TemplateKWLoc,
797 FirstQualifierInScope, R, TemplateArgs, S,
806 Expr *baseObjectExpr,
821 assert(!baseObjectExpr &&
"anonymous struct/union is static data member?");
829 baseObjectExpr = result.
get();
832 assert((baseVariable || baseObjectExpr) &&
833 "referencing anonymous struct/union without a base variable or "
838 Expr *result = baseObjectExpr;
855 SS, field, foundDecl, memberNameInfo)
865 FieldDecl *field = cast<FieldDecl>(*FI++);
874 (FI == FEnd ? SS : EmptySS), field,
875 fakeFoundDecl, memberNameInfo)
904 FoundDecl, HadMultipleCandidates, MemberNameInfo, Ty,
905 VK, OK, TemplateArgs);
914 assert((!IsArrow ||
Base->isPRValue()) &&
915 "-> base must be a pointer prvalue");
918 Member, FoundDecl, MemberNameInfo, TemplateArgs, Ty,
942 for (; S != S->getFnParent(); S = S->getParent()) {
943 if (S->isFnTryCatchScope())
958 bool SuppressQualifierCheck,
969 if (!IsArrow && BaseExpr && BaseExpr->
isPRValue()) {
973 BaseExpr = Converted.
get();
987 if (S && BaseExpr && FD &&
988 (isa<CXXDestructorDecl>(FD) || isa<CXXConstructorDecl>(FD)) &&
991 Diag(MemberLoc, diag::warn_cdtor_function_try_handler_mem_expr)
992 << isa<CXXDestructorDecl>(FD);
1002 if (!IsArrow && BaseExpr) {
1005 bool MayBePseudoDestructor =
false;
1007 OpLoc, tok::arrow, ObjectType,
1008 MayBePseudoDestructor);
1012 ExtraArgs->
S, RetryExpr.
get(), OpLoc, tok::arrow, TempSS,
1019 Diag(OpLoc, diag::err_no_member_overloaded_arrow)
1038 if ((SS.
isSet() || !BaseExpr ||
1039 (isa<CXXThisExpr>(BaseExpr) &&
1040 cast<CXXThisExpr>(BaseExpr)->isImplicit())) &&
1041 !SuppressQualifierCheck &&
1054 BaseExpr, BaseExprType,
1057 TemplateKWLoc, MemberNameInfo,
1081 if (TemplateArgs || TemplateKWLoc.
isValid())
1085 FoundDecl, TemplateArgs);
1097 if (
FieldDecl *FD = dyn_cast<FieldDecl>(MemberDecl))
1109 FoundDecl, BaseExpr,
1112 if (
VarDecl *Var = dyn_cast<VarDecl>(MemberDecl)) {
1113 return BuildMemberExpr(BaseExpr, IsArrow, OpLoc, &SS, TemplateKWLoc, Var,
1115 MemberNameInfo, Var->getType().getNonReferenceType(),
1119 if (
CXXMethodDecl *MemberFn = dyn_cast<CXXMethodDecl>(MemberDecl)) {
1122 if (MemberFn->isInstance()) {
1127 type = MemberFn->getType();
1131 MemberFn, FoundDecl,
false,
1134 assert(!isa<FunctionDecl>(MemberDecl) &&
"member function not C++ method?");
1137 return BuildMemberExpr(BaseExpr, IsArrow, OpLoc, &SS, TemplateKWLoc, Enum,
1143 if (
VarTemplateDecl *VarTempl = dyn_cast<VarTemplateDecl>(MemberDecl)) {
1144 if (!TemplateArgs) {
1150 MemberNameInfo.
getLoc(), *TemplateArgs);
1157 BaseExpr, BaseExpr->
getType(), IsArrow, OpLoc, SS, TemplateKWLoc,
1158 FirstQualifierInScope, MemberNameInfo, TemplateArgs);
1165 BaseExpr, IsArrow, OpLoc, &SS, TemplateKWLoc, Var, FoundDecl,
1166 false, MemberNameInfo,
1171 if (isa<TypeDecl>(MemberDecl))
1172 Diag(MemberLoc, diag::err_typecheck_member_reference_type)
1173 << MemberName << BaseType <<
int(IsArrow);
1175 Diag(MemberLoc, diag::err_typecheck_member_reference_unknown)
1176 << MemberName << BaseType <<
int(IsArrow);
1193 if (!opty)
return false;
1221 return PT->getPointeeType()->isRecordType();
1228 if (IsArrow && !
Base->getType()->isFunctionType())
1247 Decl *ObjCImpDecl,
bool HasTemplateArgs,
1249 assert(BaseExpr.
get() &&
"no base expression");
1281 S.
Diag(OpLoc, diag::err_typecheck_member_reference_suggestion)
1289 S.
Diag(MemberLoc, diag::err_typecheck_member_reference_arrow)
1302 S.
PDiag(diag::warn_atomic_member_access));
1303 BaseType = ATy->getValueType().getUnqualifiedType();
1306 CK_AtomicToNonAtomic, BaseExpr.
get(),
nullptr,
1314 HasTemplateArgs, TemplateKWLoc, TE))
1342 (OTy->isObjCId() || OTy->isObjCClass()))
1347 if (OTy->isObjCId() &&
Member->isStr(
"isa"))
1352 ObjCImpDecl, HasTemplateArgs, TemplateKWLoc);
1357 diag::err_typecheck_incomplete_tag,
1374 S.
PDiag(diag::err_typecheck_member_reference_ivar_suggest)
1378 assert(!ClassDeclared);
1381 if (
auto *
Category = dyn_cast<ObjCCategoryDecl>(D))
1384 if (
auto *Implementation = dyn_cast<ObjCImplementationDecl>(D))
1385 ClassDeclared = Implementation->getClassInterface();
1386 else if (
auto *Interface = dyn_cast<ObjCInterfaceDecl>(D))
1387 ClassDeclared = Interface;
1389 assert(ClassDeclared &&
"cannot query interface");
1394 S.
Diag(MemberLoc, diag::err_property_found_suggest)
1400 S.
Diag(MemberLoc, diag::err_typecheck_member_reference_ivar)
1407 assert(ClassDeclared);
1422 ClassOfMethodDecl = MD->getClassInterface();
1431 dyn_cast<ObjCImplementationDecl>(ObjCImpDecl))
1432 ClassOfMethodDecl = IMPD->getClassInterface();
1434 dyn_cast<ObjCCategoryImplDecl>(ObjCImpDecl))
1435 ClassOfMethodDecl = CatImplClass->getClassInterface();
1441 S.
Diag(MemberLoc, diag::err_private_ivar_access)
1445 S.
Diag(MemberLoc, diag::err_protected_ivar_access)
1453 if (UO->getOpcode() == UO_Deref)
1456 if (
DeclRefExpr *DE = dyn_cast<DeclRefExpr>(BaseExp))
1458 S.
Diag(DE->getLocation(), diag::err_arc_weak_ivar_access);
1470 S.
Diag(MemberLoc, diag::warn_direct_ivar_access) << IV->
getDeclName();
1479 !S.
Diags.
isIgnored(diag::warn_arc_repeated_use_of_weak, MemberLoc))
1532 SMD = dyn_cast<ObjCMethodDecl>(SDecl);
1543 ObjCImpDecl, HasTemplateArgs, TemplateKWLoc);
1545 return ExprError(S.
Diag(MemberLoc, diag::err_property_not_found)
1546 << MemberName << BaseType);
1556 ObjCImpDecl, HasTemplateArgs, TemplateKWLoc);
1590 if (Getter || Setter) {
1598 ObjCImpDecl, HasTemplateArgs, TemplateKWLoc);
1600 return ExprError(S.
Diag(MemberLoc, diag::err_property_not_found)
1601 << MemberName << BaseType);
1614 S.
Diag(R.
getNameLoc(), diag::err_ext_vector_component_name_illegal)
1629 VK = POE->getSyntacticForm()->getValueKind();
1653 ObjCImpDecl, HasTemplateArgs, TemplateKWLoc);
1667 if (!IsArrow && Ptr->getPointeeType()->isRecordType() &&
1669 S.
Diag(OpLoc, diag::err_typecheck_member_reference_suggestion)
1679 ObjCImpDecl, HasTemplateArgs, TemplateKWLoc);
1686 BaseExpr, S.
PDiag(diag::err_member_reference_needs_call),
1693 ObjCImpDecl, HasTemplateArgs, TemplateKWLoc);
1696 S.
Diag(OpLoc, diag::err_typecheck_member_reference_struct_union)
1718 Decl *ObjCImpDecl) {
1725 Diag(
Id.getSourceRange().getBegin(),
1726 diag::ext_ms_explicit_constructor_call);
1734 NameInfo, TemplateArgs);
1737 bool IsArrow = (OpKind == tok::arrow);
1740 return ExprError(
Diag(OpLoc, diag::err_hlsl_operator_unsupported) << 2);
1747 if (Result.isInvalid())
return ExprError();
1748 Base = Result.get();
1750 if (
Base->getType()->isDependentType() || Name.isDependentName() ||
1753 TemplateKWLoc, FirstQualifierInScope,
1754 NameInfo, TemplateArgs);
1759 Base,
Base->getType(), OpLoc, IsArrow, SS, TemplateKWLoc,
1760 FirstQualifierInScope, NameInfo, TemplateArgs, S, &ExtraArgs);
1763 CheckMemberAccessOfNoDeref(cast<MemberExpr>(Res.
get()));
1768 void Sema::CheckMemberAccessOfNoDeref(
const MemberExpr *E) {
1788 CheckAddressOfNoDeref(E->
getBase());
1791 if (
const auto *Ptr = dyn_cast<PointerType>(
1793 if (Ptr->getPointeeType()->hasAttr(attr::NoDeref))
1820 QualType MemberType = Field->getType();
1842 Qualifiers Combined = BaseQuals + MemberQuals;
1843 if (Combined != MemberQuals)
1850 if (BaseType->
hasAttr(attr::NoDeref))
1855 auto *CurMethod = dyn_cast<CXXMethodDecl>(
CurContext);
1856 if (!(CurMethod && CurMethod->isDefaulted()))
1861 if (
Base.isInvalid())
1868 isa<CXXThisExpr>(
Base.get()->IgnoreParenImpCasts())) {
1871 MemberNameInfo.
getLoc());
1877 false, MemberNameInfo,
1878 MemberType, VK, OK);
1890 bool IsKnownInstance,
const Scope *S) {
1898 assert(!ThisTy.
isNull() &&
"didn't correctly pre-flight capture of 'this'");
1900 Expr *baseExpr =
nullptr;
1901 if (IsKnownInstance) {
1913 R, TemplateArgs, S);
Represents a C++ unqualified-id that has been parsed.
Represents an ObjC class declaration.
ExprResult BuildDeclarationNameExpr(const CXXScopeSpec &SS, LookupResult &R, bool NeedsADL, bool AcceptInvalidDecl=false)
DeclContext * CurContext
CurContext - This is the current declaration context of parsing.
ExprValueKind getValueKind() const
getValueKind - The value kind that this expression produces.
QualType getQualifiedType(SplitQualType split) const
Un-split a SplitQualType.
QualType getTypedefType(const TypedefNameDecl *Decl, QualType Underlying=QualType()) const
Return the unique reference to the type for the specified typedef-name decl.
bool LookupTemplateName(LookupResult &R, Scope *S, CXXScopeSpec &SS, QualType ObjectType, bool EnteringContext, bool &MemberOfUnknownSpecialization, RequiredTemplateKind RequiredTemplate=SourceLocation(), AssumedTemplateKind *ATK=nullptr, bool AllowTypoCorrection=true)
bool isRecordType() const
bool isDependentScopeSpecifier(const CXXScopeSpec &SS)
TypoExpr * CorrectTypoDelayed(const DeclarationNameInfo &Typo, Sema::LookupNameKind LookupKind, Scope *S, CXXScopeSpec *SS, CorrectionCandidateCallback &CCC, TypoDiagnosticGenerator TDG, TypoRecoveryCallback TRC, CorrectTypoKind Mode, DeclContext *MemberContext=nullptr, bool EnteringContext=false, const ObjCObjectPointerType *OPT=nullptr)
Try to "correct" a typo in the source code by finding visible declarations whose names are similar to...
Qualifiers::ObjCLifetime getObjCLifetime() const
Returns lifetime attribute of this type.
@ IMA_Instance
The reference is definitely an implicit instance member access.
ExprResult CheckPlaceholderExpr(Expr *E)
Check for operands with placeholder types and complain if found.
@ IMA_Field_Uneval_Context
protocol_range protocols() const
bool hasAttr(attr::Kind AK) const
Determine whether this type had the specified attribute applied to it (looking through top-level type...
chain_iterator chain_begin() const
const DeclAccessPair & getPair() const
void setTemplateSpecializationKind(TemplateSpecializationKind TSK, SourceLocation PointOfInstantiation=SourceLocation())
For a static data member that was instantiated from a static data member of a class template,...
@ OK_Ordinary
An ordinary object is located at an address in memory.
bool isCXXInstanceMember() const
Determine whether the given declaration is an instance member of a C++ class.
unsigned getOpenCLCompatibleVersion() const
Return the OpenCL version that kernel language is compatible with.
A trivial tuple used to represent a source range.
ObjCMethodFamily
A family of Objective-C methods.
DeclContext - This is used only as base class of specific decl types that can act as declaration cont...
bool isSingleResult() const
Determines if this names a single result which is not an unresolved value using decl.
Simple class containing the result of Sema::CorrectTypo.
chain_iterator chain_end() const
void MarkMemberReferenced(MemberExpr *E)
Perform reference-marking and odr-use handling for a MemberExpr.
ObjCImplementationDecl - Represents a class definition - this is where method definitions are specifi...
VarDecl * isOpenMPCapturedDecl(ValueDecl *D, bool CheckScopeInfo=false, unsigned StopAt=0)
Check if the specified variable is used in one of the private clauses (private, firstprivate,...
sema::FunctionScopeInfo * getCurFunction() const
@ IMA_Static
The reference is definitely not an instance member access.
static DiagnosticBuilder Diag(DiagnosticsEngine *Diags, const LangOptions &Features, FullSourceLoc TokLoc, const char *TokBegin, const char *TokRangeBegin, const char *TokRangeEnd, unsigned DiagID)
Produce a diagnostic highlighting some portion of a literal.
@ OCL_Weak
Reading or writing from this object requires a barrier call.
@ UnevaluatedAbstract
The current expression occurs within an unevaluated operand that unconditionally permits abstract ref...
static int getPointAccessorIdx(char c)
bool RequireCompleteDeclContext(CXXScopeSpec &SS, DeclContext *DC)
Require that the context specified by SS be complete.
Encodes a location in the source.
A member reference to an MSPropertyDecl.
Qualifiers getQualifiers() const
Retrieve the set of qualifiers applied to this type.
ExprResult ActOnStartCXXMemberReference(Scope *S, Expr *Base, SourceLocation OpLoc, tok::TokenKind OpKind, ParsedType &ObjectType, bool &MayBePseudoDestructor)
bool isIgnored(unsigned DiagID, SourceLocation Loc) const
Determine whether the diagnostic is known to be ignored.
This represents a decl that may have a name.
SourceLocation getBegin() const
ExprResult TemporaryMaterializationConversion(Expr *E)
If E is a prvalue denoting an unmaterialized temporary, materialize it as an xvalue.
static MemberExpr * Create(const ASTContext &C, Expr *Base, bool IsArrow, SourceLocation OperatorLoc, NestedNameSpecifierLoc QualifierLoc, SourceLocation TemplateKWLoc, ValueDecl *MemberDecl, DeclAccessPair FoundDecl, DeclarationNameInfo MemberNameInfo, const TemplateArgumentListInfo *TemplateArgs, QualType T, ExprValueKind VK, ExprObjectKind OK, NonOdrUseReason NOUR)
NamedDecl * getUnderlyingDecl()
Looks through UsingDecls and ObjCCompatibleAliasDecls for the underlying named decl.
QualType getNonReferenceType() const
If Type is a reference type (e.g., const int&), returns the type that the reference refers to ("const...
CanQualType PseudoObjectTy
QualType getObjCSelRedefinitionType() const
Retrieve the type that 'SEL' has been defined to, which may be different from the built-in 'SEL' if '...
SourceRange getSourceRange() const LLVM_READONLY
SourceLocation tokens are not useful in isolation - they are low level value objects created/interpre...
Represents a C++ member access expression for which lookup produced a set of overloaded functions.
A (possibly-)qualified type.
ExprObjectKind getObjectKind() const
getObjectKind - The object kind that this expression produces.
AccessControl getAccessControl() const
ObjCMethodDecl * lookupClassMethod(Selector Sel) const
Lookup a class method for a given selector.
The iterator over UnresolvedSets.
Represents a member of a struct/union/class.
Represents the results of name lookup.
The collection of all-type qualifiers we support.
ExprResult BuildMemberReferenceExpr(Expr *Base, QualType BaseType, SourceLocation OpLoc, bool IsArrow, CXXScopeSpec &SS, SourceLocation TemplateKWLoc, NamedDecl *FirstQualifierInScope, const DeclarationNameInfo &NameInfo, const TemplateArgumentListInfo *TemplateArgs, const Scope *S, ActOnMemberAccessExtraArgs *ExtraArgs=nullptr)
const internal::VariadicAllOfMatcher< Type > type
Matches Types in the clang AST.
bool isUnresolvedExceptionSpec(ExceptionSpecificationType ESpecType)
SemaDiagnosticBuilder Diag(SourceLocation Loc, unsigned DiagID, bool DeferHint=false)
Emit a diagnostic.
bool isObjCSelType() const
ObjCInterfaceDecl * getClassInterface()
ExprResult ActOnMemberAccessExpr(Scope *S, Expr *Base, SourceLocation OpLoc, tok::TokenKind OpKind, CXXScopeSpec &SS, SourceLocation TemplateKWLoc, UnqualifiedId &Member, Decl *ObjCImpDecl)
The main callback when the parser finds something like expression .
ExprObjectKind
A further classification of the kind of object referenced by an l-value or x-value.
@ DiscardedStatement
The current expression occurs within a discarded statement.
bool LookupQualifiedName(LookupResult &R, DeclContext *LookupCtx, bool InUnqualifiedLookup=false)
Perform qualified name lookup into a given context.
UnaryOperator - This represents the unary-expression's (except sizeof and alignof),...
@ PotentiallyEvaluatedIfUsed
The current expression is potentially evaluated, but any declarations referenced inside that expressi...
@ IMA_Mixed_StaticContext
The reference may be to an instance member, but it might be invalid if so, because the context is not...
Represents a C++ nested-name-specifier or a global scope specifier.
QualType getObjCIdRedefinitionType() const
Retrieve the type that id has been defined to, which may be different from the built-in id if id has ...
IdentifierInfo * getAsIdentifierInfo() const
Retrieve the IdentifierInfo * stored in this declaration name, or null if this declaration name isn't...
SmallVector< ExpressionEvaluationContextRecord, 8 > ExprEvalContexts
A stack of expression evaluation contexts.
static Decl * FindGetterSetterNameDecl(const ObjCObjectPointerType *QIdTy, IdentifierInfo *Member, const Selector &Sel, ASTContext &Context)
ObjCInterfaceDecl * getInterface() const
Gets the interface declaration for this object type, if the base type really is an interface.
Expr * IgnoreImpCasts() LLVM_READONLY
Skip past any implicit casts which might surround this expression until reaching a fixed point.
The name of a declaration.
SourceLocation getNameLoc() const
Gets the location of the identifier.
const ObjCObjectType * getObjectType() const
Gets the type pointed to by this ObjC pointer.
IdentifierTable & getIdentifierTable()
bool isUnevaluatedContext() const
Determines whether we are currently in a context that is not evaluated as per C++ [expr] p5.
void recordUseOfWeak(const ExprT *E, bool IsRead=true)
Record that a weak object was accessed.
static void diagnoseInstanceReference(Sema &SemaRef, const CXXScopeSpec &SS, NamedDecl *Rep, const DeclarationNameInfo &nameInfo)
Diagnose a reference to a field with no object available.
ExprResult BuildFieldReferenceExpr(Expr *BaseExpr, bool IsArrow, SourceLocation OpLoc, const CXXScopeSpec &SS, FieldDecl *Field, DeclAccessPair FoundDecl, const DeclarationNameInfo &MemberNameInfo)
DeclContext * getNonTransparentContext()
Represents a class type in Objective C.
RAII class used to determine whether SFINAE has trapped any errors that occur during template argumen...
bool isExtVectorType() const
QualType getAttributedType(attr::Kind attrKind, QualType modifiedType, QualType equivalentType)
bool isSet() const
Deprecated.
bool isUnresolvableResult() const
ObjCPropertyRefExpr - A dot-syntax expression to access an ObjC property.
CanQualType BoundMemberTy
const LangOptions & getLangOpts() const
ArrayRef< NamedDecl * >::const_iterator chain_iterator
FunctionDecl * getCurFunctionDecl(bool AllowLambda=false)
Returns a pointer to the innermost enclosing function, or nullptr if the current context is not insid...
@ LookupMemberName
Member name lookup, which finds the names of class/struct/union members.
bool RequireCompleteType(SourceLocation Loc, QualType T, CompleteTypeKind Kind, TypeDiagnoser &Diagnoser)
Ensure that the type T is a complete type.
@ IMA_Unresolved_StaticContext
The reference may be to an unresolved using declaration and the context is not an instance method.
ExprResult BuildAnonymousStructUnionMemberReference(const CXXScopeSpec &SS, SourceLocation nameLoc, IndirectFieldDecl *indirectField, DeclAccessPair FoundDecl=DeclAccessPair::make(nullptr, AS_none), Expr *baseObjectExpr=nullptr, SourceLocation opLoc=SourceLocation())
QualType getExtVectorType(QualType VectorType, unsigned NumElts) const
Return the unique reference to an extended vector type of the specified element type and size.
@ UnevaluatedList
The current expression occurs within a braced-init-list within an unevaluated operand.
DeclResult CheckVarTemplateId(VarTemplateDecl *Template, SourceLocation TemplateLoc, SourceLocation TemplateNameLoc, const TemplateArgumentListInfo &TemplateArgs)
Get the specialization of the given variable template corresponding to the specified argument list,...
A helper class that allows the use of isa/cast/dyncast to detect TagType objects of structs/unions/cl...
A reference to a name which we were able to look up during parsing but could not resolve to a specifi...
A convenient class for passing around template argument information.
AccessSpecifier getAccess() const
static bool IsInFnTryBlockHandler(const Scope *S)
Determine if the given scope is within a function-try-block handler.
static DeclAccessPair make(NamedDecl *D, AccessSpecifier AS)
ExprResult HandleExprPropertyRefExpr(const ObjCObjectPointerType *OPT, Expr *BaseExpr, SourceLocation OpLoc, DeclarationName MemberName, SourceLocation MemberLoc, SourceLocation SuperLoc, QualType SuperType, bool Super)
HandleExprPropertyRefExpr - Handle foo.bar where foo is a pointer to an objective C interface.
static void DiagnoseQualifiedMemberReference(Sema &SemaRef, Expr *BaseExpr, QualType BaseType, const CXXScopeSpec &SS, NamedDecl *rep, const DeclarationNameInfo &nameInfo)
We know that the given qualified member reference points only to declarations which do not belong to ...
void setHadMultipleCandidates(bool V=true)
Sets the flag telling whether this expression refers to a method that was resolved from an overloaded...
@ IMA_Abstract
The reference is a contextually-permitted abstract member reference.
Scope - A scope is a transient data structure that is used while parsing the program.
SourceLocation getEnd() const
A POD class for pairing a NamedDecl* with an access specifier.
ExprResult DefaultFunctionArrayConversion(Expr *E, bool Diagnose=true)
DefaultFunctionArrayConversion (C99 6.3.2.1p3, C99 6.3.2.1p4).
Represents difference between two FPOptions values.
Holds long-lived AST nodes (such as types and decls) that can be referred to throughout the semantic ...
ActionResult< Expr * > ExprResult
ObjCMethodDecl * lookupPrivateMethod(const Selector &Sel, bool Instance=true) const
Lookup a method in the classes implementation hierarchy.
SelectorTable & getSelectorTable()
const T * getAs() const
Member-template getAs<specific type>'.
bool hasErrorOccurred() const
Determine whether any SFINAE errors have been trapped.
@ OK_BitField
A bitfield object is a bitfield on a C or C++ record.
bool isInvalidDecl() const
NamedDecl * FindFirstQualifierInScope(Scope *S, NestedNameSpecifier *NNS)
If the given nested-name-specifier begins with a bare identifier (e.g., Base::), perform name lookup ...
@ Unevaluated
The current expression and its subexpressions occur within an unevaluated operand (C++11 [expr]p7),...
static bool IsRGBA(char c)
Determine whether input char is from rgba component set.
ObjCIvarDecl * lookupInstanceVariable(IdentifierInfo *IVarName, ObjCInterfaceDecl *&ClassDeclared)
Qualifiers getQualifiers() const
Retrieve all qualifiers.
unsigned getLength() const
Efficiently return the length of this identifier info.
DiagnosticsEngine & Diags
bool DiagRuntimeBehavior(SourceLocation Loc, const Stmt *Statement, const PartialDiagnostic &PD)
Conditionally issue a diagnostic based on the current evaluation context.
PseudoObjectExpr - An expression which accesses a pseudo-object l-value.
PartialDiagnostic PDiag(unsigned DiagID=0)
Build a partial diagnostic.
static ImplicitCastExpr * Create(const ASTContext &Context, QualType T, CastKind Kind, Expr *Operand, const CXXCastPath *BasePath, ExprValueKind Cat, FPOptionsOverride FPO)
bool isFunctionType() const
ExprResult ActOnDependentMemberExpr(Expr *Base, QualType BaseType, bool IsArrow, SourceLocation OpLoc, const CXXScopeSpec &SS, SourceLocation TemplateKWLoc, NamedDecl *FirstQualifierInScope, const DeclarationNameInfo &NameInfo, const TemplateArgumentListInfo *TemplateArgs)
Location wrapper for a TemplateArgument.
@ IK_ConstructorName
A constructor name.
Represents a variable declaration or definition.
QualType getObjCClassType() const
Represents the Objective-C Class type.
@ IMA_Unresolved
The reference may be to an unresolved using declaration.
QualType getPointeeType() const
If this is a pointer, ObjC object pointer, or block pointer, this returns the respective pointee.
ExprResult DefaultFunctionArrayLvalueConversion(Expr *E, bool Diagnose=true)
bool isExtVectorBoolType() const
ObjCCategoryImplDecl - An object of this class encapsulates a category @implementation declaration.
CanQualType getCanonicalType(QualType T) const
Return the canonical (structural) type corresponding to the specified potentially non-canonical type ...
An instance of this object exists for each enum constant that is defined.
bool forallBases(ForallBasesCallback BaseMatches) const
Determines if the given callback holds for all the direct or indirect base classes of this type.
A C++ nested-name-specifier augmented with source location information.
bool hasAddressSpace() const
DeclarationName getLookupName() const
Gets the name to look up.
const FunctionProtoType * ResolveExceptionSpec(SourceLocation Loc, const FunctionProtoType *FPT)
static IMAKind ClassifyImplicitMemberAccess(Sema &SemaRef, const LookupResult &R)
The given lookup names class member(s) and is not being used for an address-of-member expression.
@ IMA_Mixed
The reference may be an implicit instance member access.
ExprResult getOpenMPCapturedExpr(VarDecl *Capture, ExprValueKind VK, ExprObjectKind OK, SourceLocation Loc)
MemberExpr * BuildMemberExpr(Expr *Base, bool IsArrow, SourceLocation OpLoc, const CXXScopeSpec *SS, SourceLocation TemplateKWLoc, ValueDecl *Member, DeclAccessPair FoundDecl, bool HadMultipleCandidates, const DeclarationNameInfo &MemberNameInfo, QualType Ty, ExprValueKind VK, ExprObjectKind OK, const TemplateArgumentListInfo *TemplateArgs=nullptr)
static bool isPointerToRecordType(QualType T)
NestedNameSpecifierLoc getWithLocInContext(ASTContext &Context) const
Retrieve a nested-name-specifier with location information, copied into the given AST context.
ExprResult MaybeConvertParenListExprToParenExpr(Scope *S, Expr *ME)
This is not an AltiVec-style cast or or C++ direct-initialization, so turn the ParenListExpr into a s...
LookupNameKind
Describes the kind of name lookup to perform.
bool isDependentName() const
Determines whether the name itself is dependent, e.g., because it involves a C++ type that is itself ...
DeclarationName getName() const
getName - Returns the embedded declaration name.
TypoCorrection CorrectTypo(const DeclarationNameInfo &Typo, Sema::LookupNameKind LookupKind, Scope *S, CXXScopeSpec *SS, CorrectionCandidateCallback &CCC, CorrectTypoKind Mode, DeclContext *MemberContext=nullptr, bool EnteringContext=false, const ObjCObjectPointerType *OPT=nullptr, bool RecordFailure=true)
Try to "correct" a typo in the source code by finding visible declarations whose names are similar to...
static Decl * FindGetterSetterNameDeclFromProtocolList(const ObjCProtocolDecl *PDecl, IdentifierInfo *Member, const Selector &Sel, ASTContext &Context)
NamedDeclSetType UnusedPrivateFields
Set containing all declared private fields that are not used.
@ VK_LValue
An l-value expression is a reference to an object with independent storage.
void diagnoseTypo(const TypoCorrection &Correction, const PartialDiagnostic &TypoDiag, bool ErrorRecovery=true)
const T * castAs() const
Member-template castAs<specific type>.
ExprResult PerformObjectMemberConversion(Expr *From, NestedNameSpecifier *Qualifier, NamedDecl *FoundDecl, NamedDecl *Member)
Cast a base object to a member's actual type.
QualType getDesugaredType(const ASTContext &Context) const
Return the specified type with any "sugar" removed from the type.
Expr * IgnoreParenCasts() LLVM_READONLY
Skip past any parentheses and casts which might surround this expression until reaching a fixed point...
Represents a pointer to an Objective C object.
ExprResult BuildImplicitMemberExpr(const CXXScopeSpec &SS, SourceLocation TemplateKWLoc, LookupResult &R, const TemplateArgumentListInfo *TemplateArgs, bool IsDefiniteInstance, const Scope *S)
Builds an implicit member access expression.
llvm::ArrayRef< TemplateArgumentLoc > arguments() const
Represents a C++ struct/union/class.
@ IMA_Error_StaticContext
All possible referrents are instance members and the current context is not an instance method.
ExternalSemaSource * getExternalSource() const
TokenKind
Provides a simple uniform namespace for tokens from all C languages.
DeclContext * computeDeclContext(QualType T)
Compute the DeclContext that is associated with the given type.
bool isDependentType() const
Whether this type is a dependent type, meaning that its definition somehow depends on a template para...
@ VK_PRValue
A pr-value expression (in the C++11 taxonomy) produces a temporary value.
void suppressDiagnostics()
Suppress the diagnostics that would normally fire because of this lookup.
ExprResult ImpCastExprToType(Expr *E, QualType Type, CastKind CK, ExprValueKind VK=VK_PRValue, const CXXCastPath *BasePath=nullptr, CheckedConversionKind CCK=CCK_ImplicitConversion)
ImpCastExprToType - If Expr is not of type 'Type', insert an implicit cast.
bool empty() const
Return true if no decls were found.
bool CheckQualifiedMemberReference(Expr *BaseExpr, QualType BaseType, const CXXScopeSpec &SS, const LookupResult &R)
bool isPointerType() const
Represent the declaration of a variable (in which case it is an lvalue) a function (in which case it ...
bool tryToRecoverWithCall(ExprResult &E, const PartialDiagnostic &PD, bool ForceComplain=false, bool(*IsPlausibleResult)(QualType)=nullptr)
Try to recover by turning the given expression into a call.
static ExprResult BuildMSPropertyRefExpr(Sema &S, Expr *BaseExpr, bool IsArrow, const CXXScopeSpec &SS, MSPropertyDecl *PD, const DeclarationNameInfo &NameInfo)
Represents a C++ template name within the type system.
RedeclarationKind
Specifies whether (or how) name lookup is being performed for a redeclaration (vs.
static bool isProvablyNotDerivedFrom(Sema &SemaRef, CXXRecordDecl *Record, const BaseSet &Bases)
Determines if the given class is provably not derived from all of the prospective base classes.
@ IMA_Error_Unrelated
All possible referrents are instance members of an unrelated class.
Represents a prototype with parameter type info, e.g.
DeclContext * getParent()
getParent - Returns the containing DeclContext.
static Selector constructSetterSelector(IdentifierTable &Idents, SelectorTable &SelTable, const IdentifierInfo *Name)
Return the default setter selector for the given identifier.
llvm::SmallPtrSet< const CXXRecordDecl *, 4 > BaseSet
bool isNull() const
Return true if this QualType doesn't point to a type yet.
Decl - This represents one declaration (or definition), e.g.
void setBaseObjectType(QualType T)
Sets the base object type for this lookup.
Expr * IgnoreParenImpCasts() LLVM_READONLY
Skip past any parentheses and implicit casts which might surround this expression until reaching a fi...
Represents one property declaration in an Objective-C interface.
static QualType CheckExtVectorComponent(Sema &S, QualType baseType, ExprValueKind &VK, SourceLocation OpLoc, const IdentifierInfo *CompName, SourceLocation CompLoc)
Check an ext-vector component access expression.
ExprResult DefaultLvalueConversion(Expr *E)
bool isAccessorWithinNumElements(char c, bool isNumericAccessor) const
Sema - This implements semantic analysis and AST building for C.
bool DiagnoseUseOfDecl(NamedDecl *D, ArrayRef< SourceLocation > Locs, const ObjCInterfaceDecl *UnknownObjCClass=nullptr, bool ObjCPropertyAccess=false, bool AvoidPartialAvailabilityChecks=false, ObjCInterfaceDecl *ClassReciever=nullptr)
Determine whether the use of this declaration is valid, and emit any corresponding diagnostics.
TemplateSpecializationKind getTemplateSpecializationKind() const
If this variable is an instantiation of a variable template or a static data member of a class templa...
bool IvarBacksCurrentMethodAccessor(ObjCInterfaceDecl *IFace, ObjCMethodDecl *Method, ObjCIvarDecl *IV)
IvarBacksCurrentMethodAccessor - This routine returns 'true' if 'IV' is an ivar synthesized for 'Meth...
iterator begin(Source *source, bool LocalOnly=false)
bool Encloses(const DeclContext *DC) const
Determine whether this declaration context encloses the declaration context DC.
ObjCMethodDecl * getCurMethodDecl()
getCurMethodDecl - If inside of a method body, this returns a pointer to the method decl for the meth...
ExprValueKind
The categorization of expression values, currently following the C++11 scheme.
One of these records is kept for each identifier that is lexed.
DeclContext * getFunctionLevelDeclContext(bool AllowLambda=false)
If AllowLambda is true, treat lambda as function.
bool isThisOutsideMemberFunctionBody(QualType BaseType)
Determine whether the given type is the type of *this that is used outside of the body of a member fu...
ExprResult BuildPossibleImplicitMemberExpr(const CXXScopeSpec &SS, SourceLocation TemplateKWLoc, LookupResult &R, const TemplateArgumentListInfo *TemplateArgs, const Scope *S, UnresolvedLookupExpr *AsULE=nullptr)
Builds an expression which might be an implicit member expression.
const char * getNameStart() const
Return the beginning of the actual null-terminated string for this identifier.
Selector getNullarySelector(IdentifierInfo *ID)
Simple template class for restricting typo correction candidates to ones having a single Decl* of the...
@ ConstantEvaluated
The current context is "potentially evaluated" in C++11 terms, but the expression is evaluated at com...
ExtVectorElementExpr - This represents access to specific elements of a vector, and may occur on the ...
ObjCMethodDecl - Represents an instance or class method declaration.
ExtVectorDeclsType ExtVectorDecls
ExtVectorDecls - This is a list all the extended vector types.
@ OK_ObjCProperty
An Objective-C property is a logical field of an Objective-C object which is read and written via Obj...
TypoExpr - Internal placeholder for expressions where typo correction still needs to be performed and...
PointerType - C99 6.7.5.1 - Pointer Declarators.
static bool isRecordType(QualType T)
QualType CXXThisTypeOverride
When non-NULL, the C++ 'this' expression is allowed despite the current context not being a non-stati...
Scope * getCurScope() const
Retrieve the parser's current scope.
NameKind getNameKind() const
Determine what kind of name this is.
VarDecl * getVarDecl() const
@ IMA_Mixed_Unrelated
The reference may be to an instance member, but it is invalid if so, because the context is from an u...
ObjCMethodDecl * getInstanceMethod(Selector Sel, bool AllowHidden=false) const
Represents a field injected from an anonymous union/struct into the parent scope.
ExprResult PerformMemberExprBaseConversion(Expr *Base, bool IsArrow)
Perform conversions on the LHS of a member access expression.
QualType getElementType() const
Smart pointer class that efficiently represents Objective-C method names.
static int getNumericAccessorIdx(char c)
QualType getObjCClassRedefinitionType() const
Retrieve the type that Class has been defined to, which may be different from the built-in Class if C...
ObjCIvarDecl - Represents an ObjC instance variable.
An instance of this class represents the declaration of a property member.
CXXRecordDecl * getCanonicalDecl() override
Retrieves the "canonical" declaration of the given declaration.
ObjCIsaExpr - Represent X->isa and X.isa when X is an ObjC 'id' type.
NamedDecl * getCorrectionDecl() const
Gets the pointer to the declaration of the typo correction.
Represents an Objective-C protocol declaration.
NestedNameSpecifier * getScopeRep() const
Retrieve the representation of the nested-name-specifier.
bool isValid() const
Return true if this is a valid SourceLocation object.
Base class for callback objects used by Sema::CorrectTypo to check the validity of a potential typo c...
DeclarationName getDeclName() const
Get the actual, stored name of the declaration, which may be a special name.
static FixItHint CreateRemoval(CharSourceRange RemoveRange)
Create a code modification hint that removes the given source range.
static ExprResult LookupMemberExpr(Sema &S, LookupResult &R, ExprResult &BaseExpr, bool &IsArrow, SourceLocation OpLoc, CXXScopeSpec &SS, Decl *ObjCImpDecl, bool HasTemplateArgs, SourceLocation TemplateKWLoc)
Look up the given member of the given non-type-dependent expression.
bool isDependentContext() const
Determines whether this context is dependent on a template parameter.
Sema::LookupNameKind getLookupKind() const
Gets the kind of lookup to perform.
static bool IsValidOpenCLComponentSwizzleLength(unsigned len)
SourceRange getSourceRange() const LLVM_READONLY
getSourceRange - The range of the declaration name.
Optional< sema::TemplateDeductionInfo * > isSFINAEContext() const
Determines whether we are currently in a context where template argument substitution failures are no...
ObjCPropertyDecl * FindPropertyDeclaration(const IdentifierInfo *PropertyId, ObjCPropertyQueryKind QueryKind) const
FindPropertyDeclaration - Finds declaration of the property given its name in 'PropertyId' and return...
ExprResult BuildTemplateIdExpr(const CXXScopeSpec &SS, SourceLocation TemplateKWLoc, LookupResult &R, bool RequiresADL, const TemplateArgumentListInfo *TemplateArgs)
NamedDecl * getFoundDecl() const
Fetch the unique decl found by this lookup.
__device__ __2f16 float c
MemberExpr - [C99 6.5.2.3] Structure and Union Members.
static CXXDependentScopeMemberExpr * Create(const ASTContext &Ctx, Expr *Base, QualType BaseType, bool IsArrow, SourceLocation OperatorLoc, NestedNameSpecifierLoc QualifierLoc, SourceLocation TemplateKWLoc, NamedDecl *FirstQualifierFoundInScope, DeclarationNameInfo MemberNameInfo, const TemplateArgumentListInfo *TemplateArgs)
bool isSuperClassOf(const ObjCInterfaceDecl *I) const
isSuperClassOf - Return true if this class is the specified class or is a super class of the specifie...
RecordDecl * getDecl() const
QualType getPointerType(QualType T) const
Return the uniqued reference to the type for a pointer to the specified type.
ExtVectorType - Extended vector type.
void diagnoseMissingTemplateArguments(TemplateName Name, SourceLocation Loc)
Base for LValueReferenceType and RValueReferenceType.
QualType getPointeeType() const
Sema & getSema() const
Get the Sema object that this lookup result is searching with.
unsigned getNumElements() const
NonOdrUseReason getNonOdrUseReasonInCurrentContext(ValueDecl *D)
If D cannot be odr-used in the current expression evaluation context, return a reason explaining why.
@ TryScope
This is the scope of a C++ try statement.
bool isProvablyNotDerivedFrom(const CXXRecordDecl *Base) const
Determine whether this class is provably not derived from the type Base.
QualType getUsageType(QualType objectType) const
Retrieve the type of this instance variable when viewed as a member of a specific object type.
Declaration of a variable template.
bool hasSameUnqualifiedType(QualType T1, QualType T2) const
Determine whether the given types are equivalent after cvr-qualifiers have been removed.
void DecomposeUnqualifiedId(const UnqualifiedId &Id, TemplateArgumentListInfo &Buffer, DeclarationNameInfo &NameInfo, const TemplateArgumentListInfo *&TemplateArgs)
Decomposes the given name into a DeclarationNameInfo, its location, and possibly a list of template a...
This represents one expression.
bool isEmpty() const
No scope specifier.
bool isSpecificBuiltinType(unsigned K) const
Test for a particular builtin type.
SourceRange getRange() const
QualType getCurrentThisType()
Try to retrieve the type of the 'this' pointer.
@ TSK_ImplicitInstantiation
This template specialization was implicitly instantiated from a template.
SourceLocation getLoc() const
getLoc - Returns the main location of the declaration name.
DeclarationNameInfo - A collector data type for bundling together a DeclarationName and the correspnd...
static UnresolvedMemberExpr * Create(const ASTContext &Context, bool HasUnresolvedUsing, Expr *Base, QualType BaseType, bool IsArrow, SourceLocation OperatorLoc, NestedNameSpecifierLoc QualifierLoc, SourceLocation TemplateKWLoc, const DeclarationNameInfo &MemberNameInfo, const TemplateArgumentListInfo *TemplateArgs, UnresolvedSetIterator Begin, UnresolvedSetIterator End)
SourceLocation getLocation() const
A reference to a declared variable, function, enum, etc.
static bool ShouldTryAgainWithRedefinitionType(Sema &S, ExprResult &base)
Given that normal member access failed on the given expression, and given that the expression's type ...
Represents a struct/union/class.
bool Equals(const DeclContext *DC) const
Determine whether this declaration context is equivalent to the declaration context DC.
const DeclarationNameInfo & getLookupNameInfo() const
Gets the name info to look up.
ObjCIvarRefExpr - A reference to an ObjC instance variable.
NamedDecl * getRepresentativeDecl() const
Fetches a representative decl. Useful for lazy diagnostics.
bool isOverloadedResult() const
Determines if the results are overloaded.
static FixItHint CreateReplacement(CharSourceRange RemoveRange, StringRef Code)
Create a code modification hint that replaces the given source range with the given code string.
static bool LookupMemberExprInRecord(Sema &SemaRef, LookupResult &R, Expr *BaseExpr, const RecordType *RTy, SourceLocation OpLoc, bool IsArrow, CXXScopeSpec &SS, bool HasTemplateArgs, SourceLocation TemplateKWLoc, TypoExpr *&TE)
Expr * BuildCXXThisExpr(SourceLocation Loc, QualType Type, bool IsImplicit)
Build a CXXThisExpr and mark it referenced in the current context.
bool declaresSameEntity(const Decl *D1, const Decl *D2)
Determine whether two declarations declare the same entity.
@ ImmediateFunctionContext
In addition of being constant evaluated, the current expression occurs in an immediate function conte...
const CXXRecordDecl * getParent() const
Return the parent of this method declaration, which is the class in which this method is defined.
Represents a static or instance method of a struct/union/class.
bool isInvalid() const
An error occurred during parsing of the scope specifier.
DeclContext * getDeclContext()
Sema::RedeclarationKind redeclarationKind() const
@ PotentiallyEvaluated
The current expression is potentially evaluated at run time, which means that code may be generated t...