aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorSebastian Redl <sebastian.redl@getdesigned.at>2010-04-23 17:18:26 +0000
committerSebastian Redl <sebastian.redl@getdesigned.at>2010-04-23 17:18:26 +0000
commit17e1d35848247cbc5ff31df58f0b67e85b64837c (patch)
tree707a7c0caecd597a4bca258fd799dcccbea24c66 /lib
parent37de281ac149a5c5f14e4935a3738d87370da3ed (diff)
Require a complete type for the lhs of member pointer dereference operations if the type isn't exactly the same as the container class. Fixes PR6783.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@102186 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/Sema/SemaExprCXX.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/Sema/SemaExprCXX.cpp b/lib/Sema/SemaExprCXX.cpp
index 7df1c5683c..007eecd0e8 100644
--- a/lib/Sema/SemaExprCXX.cpp
+++ b/lib/Sema/SemaExprCXX.cpp
@@ -1868,6 +1868,11 @@ QualType Sema::CheckPointerToMemberOperands(
}
if (!Context.hasSameUnqualifiedType(Class, LType)) {
+ // If we want to check the hierarchy, we need a complete type.
+ if (RequireCompleteType(Loc, LType, PDiag(diag::err_bad_memptr_lhs)
+ << OpSpelling << (int)isIndirect)) {
+ return QualType();
+ }
CXXBasePaths Paths(/*FindAmbiguities=*/true, /*RecordPaths=*/false,
/*DetectVirtual=*/false);
// FIXME: Would it be useful to print full ambiguity paths, or is that