diff options
author | David Blaikie <dblaikie@gmail.com> | 2012-06-06 20:45:41 +0000 |
---|---|---|
committer | David Blaikie <dblaikie@gmail.com> | 2012-06-06 20:45:41 +0000 |
commit | 581deb3da481053c4993c7600f97acf7768caac5 (patch) | |
tree | 9c3cfe3a1f156e2ac3d7edc4d1a5fdaed4589c1a /lib/Sema/SemaDeclCXX.cpp | |
parent | 1ada2a65833266c139010bedfad87e58e5a7d74d (diff) |
Revert Decl's iterators back to pointer value_type rather than reference value_type
In addition, I've made the pointer and reference typedef 'void' rather than T*
just so they can't get misused. I would've omitted them entirely but
std::distance likes them to be there even if it doesn't use them.
This rolls back r155808 and r155869.
Review by Doug Gregor incorporating feedback from Chandler Carruth.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158104 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaDeclCXX.cpp')
-rw-r--r-- | lib/Sema/SemaDeclCXX.cpp | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/lib/Sema/SemaDeclCXX.cpp b/lib/Sema/SemaDeclCXX.cpp index e7a22165da..2b7d1bfcd8 100644 --- a/lib/Sema/SemaDeclCXX.cpp +++ b/lib/Sema/SemaDeclCXX.cpp @@ -833,8 +833,8 @@ static void CheckConstexprCtorInitializer(Sema &SemaRef, I != E; ++I) // If an anonymous union contains an anonymous struct of which any member // is initialized, all members must be initialized. - if (!RD->isUnion() || Inits.count(&*I)) - CheckConstexprCtorInitializer(SemaRef, Dcl, &*I, Inits, Diagnosed); + if (!RD->isUnion() || Inits.count(*I)) + CheckConstexprCtorInitializer(SemaRef, Dcl, *I, Inits, Diagnosed); } } @@ -943,7 +943,7 @@ bool Sema::CheckConstexprFunctionBody(const FunctionDecl *Dcl, Stmt *Body) { bool Diagnosed = false; for (CXXRecordDecl::field_iterator I = RD->field_begin(), E = RD->field_end(); I != E; ++I) - CheckConstexprCtorInitializer(*this, Dcl, &*I, Inits, Diagnosed); + CheckConstexprCtorInitializer(*this, Dcl, *I, Inits, Diagnosed); if (Diagnosed) return false; } @@ -3150,7 +3150,7 @@ DiagnoseBaseOrMemInitializerOrder(Sema &SemaRef, if (Field->isUnnamedBitfield()) continue; - IdealInitKeys.push_back(GetKeyForTopLevelField(&*Field)); + IdealInitKeys.push_back(GetKeyForTopLevelField(*Field)); } unsigned NumIdealInits = IdealInitKeys.size(); @@ -3350,7 +3350,7 @@ Sema::MarkBaseAndMemberDestructorsReferenced(SourceLocation Location, // Non-static data members. for (CXXRecordDecl::field_iterator I = ClassDecl->field_begin(), E = ClassDecl->field_end(); I != E; ++I) { - FieldDecl *Field = &*I; + FieldDecl *Field = *I; if (Field->isInvalidDecl()) continue; @@ -3807,7 +3807,7 @@ void Sema::CheckCompletedCXXClass(CXXRecordDecl *Record) { MEnd = Record->method_end(); M != MEnd; ++M) { if (!M->isStatic()) - DiagnoseHiddenVirtualMethods(Record, &*M); + DiagnoseHiddenVirtualMethods(Record, *M); } } @@ -3865,7 +3865,7 @@ void Sema::CheckExplicitlyDefaultedMethods(CXXRecordDecl *Record) { ME = Record->method_end(); MI != ME; ++MI) if (!MI->isInvalidDecl() && MI->isExplicitlyDefaulted()) - CheckExplicitlyDefaultedSpecialMember(&*MI); + CheckExplicitlyDefaultedSpecialMember(*MI); } void Sema::CheckExplicitlyDefaultedSpecialMember(CXXMethodDecl *MD) { @@ -4327,7 +4327,7 @@ bool SpecialMemberDeletionInfo::shouldDeleteForField(FieldDecl *FD) { CXXRecordDecl *UnionFieldRecord = UnionFieldType->getAsCXXRecordDecl(); if (UnionFieldRecord && - shouldDeleteForClassSubobject(UnionFieldRecord, &*UI)) + shouldDeleteForClassSubobject(UnionFieldRecord, *UI)) return true; } @@ -4464,7 +4464,7 @@ bool Sema::ShouldDeleteSpecialMember(CXXMethodDecl *MD, CXXSpecialMember CSM, for (CXXRecordDecl::field_iterator FI = RD->field_begin(), FE = RD->field_end(); FI != FE; ++FI) if (!FI->isInvalidDecl() && !FI->isUnnamedBitfield() && - SMI.shouldDeleteForField(&*FI)) + SMI.shouldDeleteForField(*FI)) return true; if (SMI.shouldDeleteForAllConstMembers()) @@ -6816,7 +6816,7 @@ void Sema::DeclareInheritedConstructors(CXXRecordDecl *ClassDecl) { // results from omitting any ellipsis parameter specification and // successively omitting parameters with a default argument from the // end of the parameter-type-list. - CXXConstructorDecl *BaseCtor = &*CtorIt; + CXXConstructorDecl *BaseCtor = *CtorIt; bool CanBeCopyOrMove = BaseCtor->isCopyOrMoveConstructor(); const FunctionProtoType *BaseCtorType = BaseCtor->getType()->getAs<FunctionProtoType>(); @@ -7647,7 +7647,7 @@ void Sema::DefineImplicitCopyAssignment(SourceLocation CurrentLocation, CXXScopeSpec SS; // Intentionally empty LookupResult MemberLookup(*this, Field->getDeclName(), Loc, LookupMemberName); - MemberLookup.addDecl(&*Field); + MemberLookup.addDecl(*Field); MemberLookup.resolveKind(); ExprResult From = BuildMemberReferenceExpr(OtherRef, OtherRefType, Loc, /*IsArrow=*/false, @@ -8182,7 +8182,7 @@ void Sema::DefineImplicitMoveAssignment(SourceLocation CurrentLocation, CXXScopeSpec SS; // Intentionally empty LookupResult MemberLookup(*this, Field->getDeclName(), Loc, LookupMemberName); - MemberLookup.addDecl(&*Field); + MemberLookup.addDecl(*Field); MemberLookup.resolveKind(); ExprResult From = BuildMemberReferenceExpr(OtherRef, OtherRefType, Loc, /*IsArrow=*/false, @@ -10667,7 +10667,7 @@ void Sema::MarkVirtualMembersReferenced(SourceLocation Loc, const CXXRecordDecl *RD) { for (CXXRecordDecl::method_iterator i = RD->method_begin(), e = RD->method_end(); i != e; ++i) { - CXXMethodDecl *MD = &*i; + CXXMethodDecl *MD = *i; // C++ [basic.def.odr]p2: // [...] A virtual member function is used if it is not pure. [...] |