diff options
| author | Richard Smith <richard-llvm@metafoo.co.uk> | 2018-11-03 02:23:33 +0000 |
|---|---|---|
| committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2018-11-03 02:23:33 +0000 |
| commit | ebc4635e79d821d484c241908398981d4921d5a6 (patch) | |
| tree | d1a95f35f48e2cd368d7fc7a226afb75315bfcee /lib/CodeGen/CGExprAgg.cpp | |
| parent | 463f16491d79cdf784a1715540c4d7f5581b3d65 (diff) | |
| download | clang-ebc4635e79d821d484c241908398981d4921d5a6.tar.gz | |
Revert r345562: "PR23833, DR2140: an lvalue-to-rvalue conversion on a glvalue of type"
This exposes a (known) CodeGen bug: it can't cope with emitting lvalue
expressions that denote non-odr-used but usable-in-constant-expression
variables. See PR39528 for a testcase.
Reverted for now until that issue can be fixed.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@346065 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/CGExprAgg.cpp')
| -rw-r--r-- | lib/CodeGen/CGExprAgg.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/CodeGen/CGExprAgg.cpp b/lib/CodeGen/CGExprAgg.cpp index 0bbf3a6c56..42481939fa 100644 --- a/lib/CodeGen/CGExprAgg.cpp +++ b/lib/CodeGen/CGExprAgg.cpp @@ -1300,8 +1300,7 @@ static bool isSimpleZero(const Expr *E, CodeGenFunction &CGF) { // (int*)0 - Null pointer expressions. if (const CastExpr *ICE = dyn_cast<CastExpr>(E)) return ICE->getCastKind() == CK_NullToPointer && - CGF.getTypes().isPointerZeroInitializable(E->getType()) && - !E->HasSideEffects(CGF.getContext()); + CGF.getTypes().isPointerZeroInitializable(E->getType()); // '\0' if (const CharacterLiteral *CL = dyn_cast<CharacterLiteral>(E)) return CL->getValue() == 0; |
