diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-02-10 07:41:06 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-02-10 07:41:06 +0000 |
commit | 864b1cf13b288c5099911e1265431ffdcac060a4 (patch) | |
tree | 52920fb94183ea3fb19c3f01f379d2771e3f9c94 /lib/AST/ExprConstant.cpp | |
parent | b880609697b3db5ae3df77387532f8b0cec89274 (diff) |
Update to new resolution for DR1458. When taking the address of an object of
incomplete class type which has an overloaded operator&, it's now just
unspecified whether the overloaded operator or the builtin is used.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@150234 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/ExprConstant.cpp')
-rw-r--r-- | lib/AST/ExprConstant.cpp | 12 |
1 files changed, 0 insertions, 12 deletions
diff --git a/lib/AST/ExprConstant.cpp b/lib/AST/ExprConstant.cpp index e43884e376..998bb705f9 100644 --- a/lib/AST/ExprConstant.cpp +++ b/lib/AST/ExprConstant.cpp @@ -2944,18 +2944,6 @@ bool PointerExprEvaluator::VisitBinaryOperator(const BinaryOperator *E) { } bool PointerExprEvaluator::VisitUnaryAddrOf(const UnaryOperator *E) { - QualType SrcTy = E->getSubExpr()->getType(); - // In C++, taking the address of an object of incomplete class type has - // undefined behavior if the complete class type has an overloaded operator&. - // DR1458 makes such expressions non-constant. - if (Info.getLangOpts().CPlusPlus && - SrcTy->isRecordType() && SrcTy->isIncompleteType()) { - const RecordType *RT = SrcTy->getAs<RecordType>(); - Info.CCEDiag(E->getExprLoc(), diag::note_constexpr_addr_of_incomplete, 1) - << SrcTy; - Info.Note(RT->getDecl()->getLocation(), diag::note_forward_declaration) - << RT->getDecl(); - } return EvaluateLValue(E->getSubExpr(), Result, Info); } |