aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaExprCXX.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-10-13 20:41:14 +0000
committerDouglas Gregor <dgregor@apple.com>2010-10-13 20:41:14 +0000
commit7d520baec9b762633a09d31ee0db12e41fe2758a (patch)
tree798b4f8dd1513ddd109e87e85664479d33d7d864 /lib/Sema/SemaExprCXX.cpp
parent43c0a4cae05cf78225d5996cf7d62d7a133d665c (diff)
There is no reason for dereferencing a pointer-to-member to require
that the class type into which the pointer points be complete, even though the standard requires it. GCC/EDG do not require a complete type here, so we're calling this a problem with the standard. Fixes PR8328. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116429 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaExprCXX.cpp')
-rw-r--r--lib/Sema/SemaExprCXX.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/Sema/SemaExprCXX.cpp b/lib/Sema/SemaExprCXX.cpp
index 00a3e27edc..3863479476 100644
--- a/lib/Sema/SemaExprCXX.cpp
+++ b/lib/Sema/SemaExprCXX.cpp
@@ -2279,8 +2279,11 @@ QualType Sema::CheckPointerToMemberOperands(
QualType Class(MemPtr->getClass(), 0);
- if (RequireCompleteType(Loc, Class, diag::err_memptr_rhs_to_incomplete))
- return QualType();
+ // Note: C++ [expr.mptr.oper]p2-3 says that the class type into which the
+ // member pointer points must be completely-defined. However, there is no
+ // reason for this semantic distinction, and the rule is not enforced by
+ // other compilers. Therefore, we do not check this property, as it is
+ // likely to be considered a defect.
// C++ 5.5p2
// [...] to its first operand, which shall be of class T or of a class of