If #1 and #2 do declare the same entity, then C++20 [basic.def.odr]/1 is violated since the same entity is being defined twice. If #1 and #2 do not declare the same entity, then C++20 [basic.scope.declarative]/4 (the corresponding paragraph in N4659 having been quoted by the OP) is violated. So in either case, the program is ill-formed (and in either case, a diagnostic is required).
But which one is it? Thanks to Declarations and where to find them being accepted into C++23, we finally have an answer. In the DIS, [basic.link]/8 states that
Two declarations of entities declare the same entity if, considering declarations of unnamed types to introduce their names for linkage purposes, if any (9.2.4, 9.7.1), they correspond (6.4.1), have the same target scope
that is not a function or template parameter scope, and either
- they appear in the same translation unit, or
- they both declare names with module linkage and are attached to the same module, or
- they both declare names with external linkage.
The two a
's obviously appear in the same translation unit and have the same target scope. Do they correspond? [basic.scope.scope]/4 says yes: they correspond because they both introduce the same name (and none of the listed exceptions applies).
So a single variable named a
is being defined twice, and that's why the program is ill-formed.