When the function is called with no argument for the corresponding parameter, the default argument is evaluated.
In a default argument, a parameter must not appear as a potentially evaluated expression.
A function's parameters declared before a default argument are in scope and can obscure the namespace and class member name.
It provides the following example:
int h(int a, int b = sizeof(a)); // OK, unevaluated operand
So, this function declaration
void f(int y = sizeof(y)) {}
is correct because, according to C++17 8.3.3 Sizeof:, y is not an evaluated operand in this expression sizeof(y).
1 The size-of operator returns the number of bytes in the operand's object representation.
The operand is either an expression or a parenthesized type-id, which is an unevaluated operand (Clause 8).
and C++17 6.3.2 Declaration Point:
1 Except as noted below, a name's point of declaration is immediately after its complete declarator (Clause 11) and before its initializer (if any).