aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaExceptionSpec.cpp
diff options
context:
space:
mode:
authorSebastian Redl <sebastian.redl@getdesigned.at>2009-10-14 14:38:54 +0000
committerSebastian Redl <sebastian.redl@getdesigned.at>2009-10-14 14:38:54 +0000
commitc3a3b7b38440384944614ea6e93cf8d238d3d5f2 (patch)
treeca9689d00d066c6a01576f03bb1532d01929775a /lib/Sema/SemaExceptionSpec.cpp
parent09270cc1b9cdd4c50012cb7984df8745e05833e5 (diff)
Do exception spec compatibility tests for member pointers, too.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@84098 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaExceptionSpec.cpp')
-rw-r--r--lib/Sema/SemaExceptionSpec.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/Sema/SemaExceptionSpec.cpp b/lib/Sema/SemaExceptionSpec.cpp
index 4171ecea8a..261bebf955 100644
--- a/lib/Sema/SemaExceptionSpec.cpp
+++ b/lib/Sema/SemaExceptionSpec.cpp
@@ -26,6 +26,8 @@ static const FunctionProtoType *GetUnderlyingFunction(QualType T)
T = PtrTy->getPointeeType();
else if (const ReferenceType *RefTy = T->getAs<ReferenceType>())
T = RefTy->getPointeeType();
+ else if (const MemberPointerType *MPTy = T->getAs<MemberPointerType>())
+ T = MPTy->getPointeeType();
return T->getAs<FunctionProtoType>();
}
@@ -171,6 +173,9 @@ bool Sema::CheckExceptionSpecSubset(unsigned DiagID, unsigned NoteID,
SubE = Subset->exception_end(); SubI != SubE; ++SubI) {
// Take one type from the subset.
QualType CanonicalSubT = Context.getCanonicalType(*SubI);
+ // Unwrap pointers and references so that we can do checks within a class
+ // hierarchy. Don't unwrap member pointers; they don't have hierarchy
+ // conversions on the pointee.
bool SubIsPointer = false;
if (const ReferenceType *RefTy = CanonicalSubT->getAs<ReferenceType>())
CanonicalSubT = RefTy->getPointeeType();