if (!sentinelExpr) return;
if (sentinelExpr->isTypeDependent()) return;
if (sentinelExpr->isValueDependent()) return;
+
+ // nullptr_t is always treated as null.
+ if (sentinelExpr->getType()->isNullPtrType()) return;
+
if (sentinelExpr->getType()->isAnyPointerType() &&
sentinelExpr->IgnoreParenCasts()->isNullPointerConstant(Context,
Expr::NPC_ValueDependentIsNull))
// Test that we prefer g(void*) over g(bool).
static_assert(is_same<decltype(g(nullptr)), void*>::value, "");
}
+
+namespace test2 {
+ void f(int, ...) __attribute__((sentinel));
+
+ void g() {
+ // nullptr can be used as the sentinel value.
+ f(10, nullptr);
+ }
+}