// constant expression even though 'a' is still in scope.
return ObscureTheTruth(b ? a : k);
}
- constexpr int n1a = MaybeReturnJunk(false, 0); // ok
- constexpr int n2a = MaybeReturnJunk(true, 0); // expected-error {{must be initialized by a constant expression}}
+ constexpr int n1a = MaybeReturnNonstaticRef(false, 0); // ok
+ constexpr int n2a = MaybeReturnNonstaticRef(true, 0); // expected-error {{must be initialized by a constant expression}}
constexpr int InternalReturnJunk(int n) {
// FIXME: We should reject this: it never produces a constant expression.