In the C Standard (6.2.2 Linkages of identifiers) there is written enough clear
4 For an identifier declared with the storage-class specifier extern in a scope in which a prior declaration of that identifier is visible,31) if the prior declaration specifies internal or external linkage, the linkage of the identifier at the later declaration is the same as the linkage specified at the prior declaration. If no prior declaration is visible, or if the prior declaration specifies no linkage, then the identifier has external linkage.
However I can not find a similar statement in the C++ Standard looking through its section 6.5 Program and linkage.
The question arises due to the following quote from the C++ 17 Standard
3 A name having namespace scope (6.3.6) has internal linkage if it is the name of
(3.2) — a non-inline variable of non-volatile const-qualified type that is neither explicitly declared extern nor previously declared to have external linkage; or
Now consider the following declarations
const int x = 100;
extern const int x;
So it is unclear whether the code is ill-formed or the constant x
has internal linkage though it is declared with the specifier extern
or the Standard has a defect in the description of this paragraph or I missed the quote in the C++ Standard similar to the quote from the C Standard.
static int b; // b has internal linkage
extern int b; // b still has internal linkage
one that comes close. – 1201ProgramAlarm