r296068 - Simplify and pass a more useful source location when computing an exception
Richard Smith via cfe-commits
cfe-commits at lists.llvm.org
Thu Feb 23 17:36:58 PST 2017
Author: rsmith
Date: Thu Feb 23 19:36:58 2017
New Revision: 296068
URL: http://llvm.org/viewvc/llvm-project?rev=296068&view=rev
Log:
Simplify and pass a more useful source location when computing an exception
specification for an implicit special member.
Modified:
cfe/trunk/lib/Sema/SemaDeclCXX.cpp
Modified: cfe/trunk/lib/Sema/SemaDeclCXX.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaDeclCXX.cpp?rev=296068&r1=296067&r2=296068&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaDeclCXX.cpp (original)
+++ cfe/trunk/lib/Sema/SemaDeclCXX.cpp Thu Feb 23 19:36:58 2017
@@ -6097,20 +6097,9 @@ ComputeDefaultedSpecialMemberExceptionSp
static Sema::ImplicitExceptionSpecification
computeImplicitExceptionSpec(Sema &S, SourceLocation Loc, CXXMethodDecl *MD) {
- switch (auto CSM = S.getSpecialMember(MD)) {
- case Sema::CXXDefaultConstructor:
- return ComputeDefaultedSpecialMemberExceptionSpec(
- S, Loc, MD, Sema::CXXDefaultConstructor, nullptr);
- case Sema::CXXCopyConstructor:
- case Sema::CXXCopyAssignment:
- case Sema::CXXMoveConstructor:
- case Sema::CXXMoveAssignment:
- case Sema::CXXDestructor:
- return ComputeDefaultedSpecialMemberExceptionSpec(
- S, MD->getLocation(), MD, CSM, nullptr);
- case Sema::CXXInvalid:
- break;
- }
+ auto CSM = S.getSpecialMember(MD);
+ if (CSM != Sema::CXXInvalid)
+ return ComputeDefaultedSpecialMemberExceptionSpec(S, Loc, MD, CSM, nullptr);
auto *CD = cast<CXXConstructorDecl>(MD);
assert(CD->getInheritedConstructor() &&
More information about the cfe-commits
mailing list