summaryrefslogtreecommitdiffstats
path: root/clang/lib
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib')
-rw-r--r--clang/lib/Sema/SemaExpr.cpp4
-rw-r--r--clang/lib/Sema/SemaExprCXX.cpp2
-rw-r--r--clang/lib/Sema/SemaType.cpp6
3 files changed, 11 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaExpr.cpp b/clang/lib/Sema/SemaExpr.cpp
index bfb98413a8a..d55ac5ee833 100644
--- a/clang/lib/Sema/SemaExpr.cpp
+++ b/clang/lib/Sema/SemaExpr.cpp
@@ -677,6 +677,10 @@ ExprResult Sema::DefaultLvalueConversion(Expr *E) {
if (T.hasQualifiers())
T = T.getUnqualifiedType();
+ if (T->isMemberPointerType() &&
+ Context.getTargetInfo().getCXXABI().isMicrosoft())
+ RequireCompleteType(E->getExprLoc(), T, 0);
+
UpdateMarkingForLValueToRValue(E);
// Loading a __weak object implicitly retains the value, so we need a cleanup to
diff --git a/clang/lib/Sema/SemaExprCXX.cpp b/clang/lib/Sema/SemaExprCXX.cpp
index a48e634c3cd..e52aca14869 100644
--- a/clang/lib/Sema/SemaExprCXX.cpp
+++ b/clang/lib/Sema/SemaExprCXX.cpp
@@ -4507,6 +4507,8 @@ QualType Sema::CheckPointerToMemberOperands(ExprResult &LHS, ExprResult &RHS,
<< OpSpelling << RHSType << RHS.get()->getSourceRange();
return QualType();
}
+ //if (Context.getTargetInfo().getCXXABI().isMicrosoft())
+ // RequireCompleteType(Loc, QualType(MemPtr, 0), 0);
QualType Class(MemPtr->getClass(), 0);
diff --git a/clang/lib/Sema/SemaType.cpp b/clang/lib/Sema/SemaType.cpp
index 6b7a49dc335..63e69d3281b 100644
--- a/clang/lib/Sema/SemaType.cpp
+++ b/clang/lib/Sema/SemaType.cpp
@@ -6253,9 +6253,13 @@ bool Sema::RequireCompleteExprType(Expr *E, TypeDiagnoser &Diagnoser){
QualType T = E->getType();
// Fast path the case where the type is already complete.
- if (!T->isIncompleteType())
+ if (!T->isIncompleteType()) {
+ if (T->isMemberPointerType() &&
+ Context.getTargetInfo().getCXXABI().isMicrosoft())
+ RequireCompleteType(E->getExprLoc(), T, 0);
// FIXME: The definition might not be visible.
return false;
+ }
// Incomplete array types may be completed by the initializer attached to
// their definitions. For static data members of class templates and for
OpenPOWER on IntegriCloud