Author: aaronballman Date: Tue Jul 21 17:33:52 2015 New Revision: 242846 URL: http://llvm.org/viewvc/llvm-project?rev=242846&view=rev Log: Use range-based for loops; NFC.
Modified: cfe/trunk/lib/Sema/SemaExprCXX.cpp Modified: cfe/trunk/lib/Sema/SemaExprCXX.cpp URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaExprCXX.cpp?rev=242846&r1=242845&r2=242846&view=diff ============================================================================== --- cfe/trunk/lib/Sema/SemaExprCXX.cpp (original) +++ cfe/trunk/lib/Sema/SemaExprCXX.cpp Tue Jul 21 17:33:52 2015 @@ -3884,15 +3884,13 @@ static bool EvaluateUnaryTypeTrait(Sema bool FoundConstructor = false; unsigned FoundTQs; - DeclContext::lookup_result R = Self.LookupConstructors(RD); - for (DeclContext::lookup_iterator Con = R.begin(), - ConEnd = R.end(); Con != ConEnd; ++Con) { + for (const auto *ND : Self.LookupConstructors(RD)) { // A template constructor is never a copy constructor. // FIXME: However, it may actually be selected at the actual overload // resolution point. - if (isa<FunctionTemplateDecl>(*Con)) + if (isa<FunctionTemplateDecl>(ND)) continue; - CXXConstructorDecl *Constructor = cast<CXXConstructorDecl>(*Con); + const CXXConstructorDecl *Constructor = cast<CXXConstructorDecl>(ND); if (Constructor->isCopyConstructor(FoundTQs)) { FoundConstructor = true; const FunctionProtoType *CPT @@ -3924,13 +3922,11 @@ static bool EvaluateUnaryTypeTrait(Sema return true; bool FoundConstructor = false; - DeclContext::lookup_result R = Self.LookupConstructors(RD); - for (DeclContext::lookup_iterator Con = R.begin(), - ConEnd = R.end(); Con != ConEnd; ++Con) { + for (const auto *ND : Self.LookupConstructors(RD)) { // FIXME: In C++0x, a constructor template can be a default constructor. - if (isa<FunctionTemplateDecl>(*Con)) + if (isa<FunctionTemplateDecl>(ND)) continue; - CXXConstructorDecl *Constructor = cast<CXXConstructorDecl>(*Con); + const CXXConstructorDecl *Constructor = cast<CXXConstructorDecl>(ND); if (Constructor->isDefaultConstructor()) { FoundConstructor = true; const FunctionProtoType *CPT _______________________________________________ cfe-commits mailing list cfe-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits