aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/ExprConstant.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2012-01-26 04:47:34 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2012-01-26 04:47:34 +0000
commitf2e4cd760a5836ee8941d1b9be6b2e2c2dde23e6 (patch)
tree8151f4c5c980c7594c60bde85347299f97c36792 /lib/AST/ExprConstant.cpp
parent98b940b7feda40c7440762d85b22d06c9aeb2587 (diff)
constexpr: evaluate (bool)&x as true when x is a local variable or a temporary.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149045 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/AST/ExprConstant.cpp')
-rw-r--r--lib/AST/ExprConstant.cpp4
1 files changed, 0 insertions, 4 deletions
diff --git a/lib/AST/ExprConstant.cpp b/lib/AST/ExprConstant.cpp
index 1c0d9eae69..6a292c3925 100644
--- a/lib/AST/ExprConstant.cpp
+++ b/lib/AST/ExprConstant.cpp
@@ -950,10 +950,6 @@ static bool EvalPointerValueAsBool(const CCValue &Value, bool &Result) {
return true;
}
- // Require the base expression to be a global l-value.
- // FIXME: C++11 requires such conversions. Remove this check.
- if (!IsGlobalLValue(Value.getLValueBase())) return false;
-
// We have a non-null base. These are generally known to be true, but if it's
// a weak declaration it can be null at runtime.
Result = true;