|
@@ -507,6 +507,7 @@ bool Sema::CheckQualifiedMemberReference(Expr *BaseExpr,
|
|
QualType BaseType,
|
|
QualType BaseType,
|
|
const CXXScopeSpec &SS,
|
|
const CXXScopeSpec &SS,
|
|
const LookupResult &R) {
|
|
const LookupResult &R) {
|
|
|
|
+ BaseType = BaseType.getNonReferenceType(); // HLSL Change
|
|
CXXRecordDecl *BaseRecord =
|
|
CXXRecordDecl *BaseRecord =
|
|
cast_or_null<CXXRecordDecl>(computeDeclContext(BaseType));
|
|
cast_or_null<CXXRecordDecl>(computeDeclContext(BaseType));
|
|
if (!BaseRecord) {
|
|
if (!BaseRecord) {
|
|
@@ -704,6 +705,7 @@ Sema::BuildMemberReferenceExpr(Expr *Base, QualType BaseType,
|
|
TypoExpr *TE = nullptr;
|
|
TypoExpr *TE = nullptr;
|
|
QualType RecordTy = BaseType;
|
|
QualType RecordTy = BaseType;
|
|
if (IsArrow) RecordTy = RecordTy->getAs<PointerType>()->getPointeeType();
|
|
if (IsArrow) RecordTy = RecordTy->getAs<PointerType>()->getPointeeType();
|
|
|
|
+ RecordTy = RecordTy.getNonReferenceType(); // HLSL Change - implicit this is a reference.
|
|
if (LookupMemberExprInRecord(*this, R, nullptr,
|
|
if (LookupMemberExprInRecord(*this, R, nullptr,
|
|
RecordTy->getAs<RecordType>(), OpLoc, IsArrow,
|
|
RecordTy->getAs<RecordType>(), OpLoc, IsArrow,
|
|
SS, TemplateArgs != nullptr, TE))
|
|
SS, TemplateArgs != nullptr, TE))
|
|
@@ -1051,7 +1053,7 @@ Sema::BuildMemberReferenceExpr(Expr *BaseExpr, QualType BaseExprType,
|
|
CheckCXXThisCapture(Loc);
|
|
CheckCXXThisCapture(Loc);
|
|
|
|
|
|
// HLSL Change Starts - adjust this from T* to T&-like
|
|
// HLSL Change Starts - adjust this from T* to T&-like
|
|
- if (getLangOpts().HLSL && BaseExprType->isPointerType())
|
|
|
|
|
|
+ if (getLangOpts().HLSL)
|
|
BaseExpr = genereateHLSLThis(Loc, BaseExprType, /*isImplicit=*/true);
|
|
BaseExpr = genereateHLSLThis(Loc, BaseExprType, /*isImplicit=*/true);
|
|
else
|
|
else
|
|
BaseExpr = new (Context) CXXThisExpr(Loc, BaseExprType,/*isImplicit=*/true);
|
|
BaseExpr = new (Context) CXXThisExpr(Loc, BaseExprType,/*isImplicit=*/true);
|
|
@@ -1768,9 +1770,9 @@ Sema::BuildImplicitMemberExpr(const CXXScopeSpec &SS,
|
|
if (SS.getRange().isValid())
|
|
if (SS.getRange().isValid())
|
|
Loc = SS.getRange().getBegin();
|
|
Loc = SS.getRange().getBegin();
|
|
CheckCXXThisCapture(Loc);
|
|
CheckCXXThisCapture(Loc);
|
|
- if (getLangOpts().HLSL && ThisTy->isPointerType()) {
|
|
|
|
|
|
+ if (getLangOpts().HLSL) {
|
|
baseExpr = genereateHLSLThis(Loc, ThisTy, /*isImplicit=*/true);
|
|
baseExpr = genereateHLSLThis(Loc, ThisTy, /*isImplicit=*/true);
|
|
- ThisTy = ThisTy->getAs<PointerType>()->getPointeeType();
|
|
|
|
|
|
+ ThisTy = ThisTy->getPointeeType();
|
|
} else
|
|
} else
|
|
baseExpr = new (Context) CXXThisExpr(loc, ThisTy, /*isImplicit=*/true);
|
|
baseExpr = new (Context) CXXThisExpr(loc, ThisTy, /*isImplicit=*/true);
|
|
}
|
|
}
|