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;
void f()
{
int a;
- EVAL_EXPR(15, (_Bool)&a); // expected-error {{fields must have a constant size}}
+ EVAL_EXPR(15, (_Bool)&a);
}
// FIXME: Turn into EVAL_EXPR test once we have more folding.
constexpr int n = f(T(5));
static_assert(f(T(5)) == 5, "");
+constexpr bool b(int n) { return &n; }
+static_assert(b(0), "");
+
}
namespace Union {