decidedly non-reference, non-pointer type. Fixes <rdar://problem/
13090123>.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@173747
91177308-0d34-0410-b5e6-
96231b3b80d8
bool IsReference = Ty->isReferenceType();
QualType InnerTy
= IsReference ? Ty.getNonReferenceType() : Ty->getPointeeType();
+ if (InnerTy.isNull())
+ InnerTy = Ty;
if (!hasLValuePath()) {
// No lvalue path: just print the offset.
static_assert(and_value == false, "");
static_assert(or_value == true, "");
+
+namespace rdar13090123 {
+ typedef __INTPTR_TYPE__ intptr_t;
+
+ constexpr intptr_t f(intptr_t x) {
+ return (((x) >> 21) * 8); // expected-note{{subexpression not valid in a constant expression}}
+ }
+
+ extern "C" int foo;
+
+ constexpr intptr_t i = f((intptr_t)&foo - 10); // expected-error{{constexpr variable 'i' must be initialized by a constant expression}} \
+ // expected-note{{in call to 'f((char*)&foo + -10)'}}
+}