@@ -670,8 +670,7 @@ class RecordMemberExprValidatorCCC final : public CorrectionCandidateCallback {
670
670
}
671
671
672
672
static bool LookupMemberExprInRecord (Sema &SemaRef, LookupResult &R,
673
- Expr *BaseExpr,
674
- QualType RTy,
673
+ Expr *BaseExpr, QualType RTy,
675
674
SourceLocation OpLoc, bool IsArrow,
676
675
CXXScopeSpec &SS, bool HasTemplateArgs,
677
676
SourceLocation TemplateKWLoc,
@@ -695,9 +694,8 @@ static bool LookupMemberExprInRecord(Sema &SemaRef, LookupResult &R,
695
694
SourceRange BaseRange = BaseExpr ? BaseExpr->getSourceRange () : SourceRange ();
696
695
if (!RTy->isDependentType () &&
697
696
!SemaRef.isThisOutsideMemberFunctionBody (RTy) &&
698
- SemaRef.RequireCompleteType (OpLoc, RTy,
699
- diag::err_typecheck_incomplete_tag,
700
- BaseRange))
697
+ SemaRef.RequireCompleteType (
698
+ OpLoc, RTy, diag::err_typecheck_incomplete_tag, BaseRange))
701
699
return true ;
702
700
703
701
if (HasTemplateArgs || TemplateKWLoc.isValid ()) {
@@ -792,26 +790,22 @@ static ExprResult LookupMemberExpr(Sema &S, LookupResult &R,
792
790
Decl *ObjCImpDecl, bool HasTemplateArgs,
793
791
SourceLocation TemplateKWLoc);
794
792
795
- ExprResult
796
- Sema::BuildMemberReferenceExpr (Expr *Base, QualType BaseType,
797
- SourceLocation OpLoc, bool IsArrow,
798
- CXXScopeSpec &SS,
799
- SourceLocation TemplateKWLoc,
800
- NamedDecl *FirstQualifierInScope,
801
- const DeclarationNameInfo &NameInfo,
802
- const TemplateArgumentListInfo *TemplateArgs,
803
- const Scope *S,
804
- ActOnMemberAccessExtraArgs *ExtraArgs) {
793
+ ExprResult Sema::BuildMemberReferenceExpr (
794
+ Expr *Base, QualType BaseType, SourceLocation OpLoc, bool IsArrow,
795
+ CXXScopeSpec &SS, SourceLocation TemplateKWLoc,
796
+ NamedDecl *FirstQualifierInScope, const DeclarationNameInfo &NameInfo,
797
+ const TemplateArgumentListInfo *TemplateArgs, const Scope *S,
798
+ ActOnMemberAccessExtraArgs *ExtraArgs) {
805
799
LookupResult R (*this , NameInfo, LookupMemberName);
806
800
807
801
// Implicit member accesses.
808
802
if (!Base) {
809
803
TypoExpr *TE = nullptr ;
810
804
QualType RecordTy = BaseType;
811
805
if (IsArrow) RecordTy = RecordTy->castAs <PointerType>()->getPointeeType ();
812
- if (LookupMemberExprInRecord (
813
- * this , R, nullptr , RecordTy, OpLoc, IsArrow ,
814
- SS, TemplateArgs != nullptr , TemplateKWLoc, TE))
806
+ if (LookupMemberExprInRecord (* this , R, nullptr , RecordTy, OpLoc, IsArrow,
807
+ SS, TemplateArgs != nullptr , TemplateKWLoc ,
808
+ TE))
815
809
return ExprError ();
816
810
if (TE)
817
811
return TE;
@@ -1006,9 +1000,8 @@ Sema::BuildMemberReferenceExpr(Expr *BaseExpr, QualType BaseExprType,
1006
1000
1007
1001
if (R.wasNotFoundInCurrentInstantiation () ||
1008
1002
(SS.isValid () && !computeDeclContext (SS, false ))) {
1009
- return ActOnDependentMemberExpr (BaseExpr, BaseExprType,
1010
- IsArrow, OpLoc,
1011
- SS, TemplateKWLoc, FirstQualifierInScope,
1003
+ return ActOnDependentMemberExpr (BaseExpr, BaseExprType, IsArrow, OpLoc, SS,
1004
+ TemplateKWLoc, FirstQualifierInScope,
1012
1005
R.getLookupNameInfo (), TemplateArgs);
1013
1006
}
1014
1007
@@ -1048,9 +1041,8 @@ Sema::BuildMemberReferenceExpr(Expr *BaseExpr, QualType BaseExprType,
1048
1041
1049
1042
if (R.empty ()) {
1050
1043
// Rederive where we looked up.
1051
- DeclContext *DC = (SS.isSet ()
1052
- ? computeDeclContext (SS, false )
1053
- : BaseType->getAsRecordDecl ());
1044
+ DeclContext *DC = (SS.isSet () ? computeDeclContext (SS, false )
1045
+ : BaseType->getAsRecordDecl ());
1054
1046
1055
1047
if (ExtraArgs) {
1056
1048
ExprResult RetryExpr;
@@ -1077,7 +1069,7 @@ Sema::BuildMemberReferenceExpr(Expr *BaseExpr, QualType BaseExprType,
1077
1069
}
1078
1070
}
1079
1071
1080
- if (DC) {
1072
+ if (DC) {
1081
1073
Diag (R.getNameLoc (), diag::err_no_member)
1082
1074
<< MemberName << DC
1083
1075
<< (BaseExpr ? BaseExpr->getSourceRange () : SourceRange ());
@@ -1317,9 +1309,9 @@ static ExprResult LookupMemberExpr(Sema &S, LookupResult &R,
1317
1309
1318
1310
QualType BaseType = BaseExpr.get ()->getType ();
1319
1311
1320
- #if 0
1312
+ #if 0
1321
1313
assert(!BaseType->isDependentType());
1322
- #endif
1314
+ #endif
1323
1315
1324
1316
DeclarationName MemberName = R.getLookupName ();
1325
1317
SourceLocation MemberLoc = R.getNameLoc ();
@@ -1332,12 +1324,12 @@ static ExprResult LookupMemberExpr(Sema &S, LookupResult &R,
1332
1324
if (const PointerType *Ptr = BaseType->getAs <PointerType>())
1333
1325
BaseType = Ptr->getPointeeType ();
1334
1326
else if (!BaseType->isDependentType ()) {
1335
- if (const ObjCObjectPointerType *Ptr
1336
- = BaseType->getAs <ObjCObjectPointerType>())
1337
- BaseType = Ptr->getPointeeType ();
1327
+ if (const ObjCObjectPointerType *Ptr =
1328
+ BaseType->getAs <ObjCObjectPointerType>())
1329
+ BaseType = Ptr->getPointeeType ();
1338
1330
else if (BaseType->isRecordType ()) {
1339
1331
// Recover from arrow accesses to records, e.g.:
1340
- // struct MyRecord foo;
1332
+ // struct MyRecord foo;
1341
1333
// foo->bar
1342
1334
// This is actually well-formed in C++ if MyRecord has an
1343
1335
// overloaded operator->, but that should have been dealt with
@@ -1356,7 +1348,6 @@ static ExprResult LookupMemberExpr(Sema &S, LookupResult &R,
1356
1348
<< BaseType << BaseExpr.get ()->getSourceRange ();
1357
1349
return ExprError ();
1358
1350
}
1359
-
1360
1351
}
1361
1352
}
1362
1353
@@ -1378,8 +1369,8 @@ static ExprResult LookupMemberExpr(Sema &S, LookupResult &R,
1378
1369
// Handle field access to simple records.
1379
1370
if (BaseType->getAsRecordDecl () || BaseType->isDependentType ()) {
1380
1371
TypoExpr *TE = nullptr ;
1381
- if (LookupMemberExprInRecord (S, R, BaseExpr.get (), BaseType, OpLoc, IsArrow, SS,
1382
- HasTemplateArgs, TemplateKWLoc, TE))
1372
+ if (LookupMemberExprInRecord (S, R, BaseExpr.get (), BaseType, OpLoc, IsArrow,
1373
+ SS, HasTemplateArgs, TemplateKWLoc, TE))
1383
1374
return ExprError ();
1384
1375
1385
1376
// Returning valid-but-null is how we indicate to the caller that
0 commit comments