diff options
| author | Richard Smith <richard-llvm@metafoo.co.uk> | 2018-10-30 02:02:49 +0000 |
|---|---|---|
| committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2018-10-30 02:02:49 +0000 |
| commit | d2e69dfddbed3dccc7926cdf01e6aa32f47a0570 (patch) | |
| tree | 19f42d86224a092777aab4fb1f18186668d7f54f /clang/lib/CodeGen/CGExprScalar.cpp | |
| parent | 2f3e8b3d2e4c8679d891568ddc7b6fc73d19c4aa (diff) | |
PR23833, DR2140: an lvalue-to-rvalue conversion on a glvalue of type
nullptr_t does not access memory.
We now reuse CK_NullToPointer to represent a conversion from a glvalue
of type nullptr_t to a prvalue of nullptr_t where necessary.
llvm-svn: 345562
Diffstat (limited to 'clang/lib/CodeGen/CGExprScalar.cpp')
| -rw-r--r-- | clang/lib/CodeGen/CGExprScalar.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/CodeGen/CGExprScalar.cpp b/clang/lib/CodeGen/CGExprScalar.cpp index c0cb8ad17115..a2b3f99573eb 100644 --- a/clang/lib/CodeGen/CGExprScalar.cpp +++ b/clang/lib/CodeGen/CGExprScalar.cpp @@ -1895,14 +1895,14 @@ Value *ScalarExprEmitter::VisitCastExpr(CastExpr *CE) { case CK_NullToPointer: if (MustVisitNullValue(E)) - (void) Visit(E); + CGF.EmitIgnoredExpr(E); return CGF.CGM.getNullPointer(cast<llvm::PointerType>(ConvertType(DestTy)), DestTy); case CK_NullToMemberPointer: { if (MustVisitNullValue(E)) - (void) Visit(E); + CGF.EmitIgnoredExpr(E); const MemberPointerType *MPT = CE->getType()->getAs<MemberPointerType>(); return CGF.CGM.getCXXABI().EmitNullMemberPointer(MPT); |
