You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A declaration of a block variable with linkage that has an initializer is ill-formed.
IIUC the intent is to prohibit
voidf() {
externint x = 1;
}
But it seems that the variable x is not a block variable, because it does not belong to the block scope, because the target scope of its declaration is the innermost enclosing namespace scope ([dcl.meaning.general]/(3.5)).
I think this sentence should instead talk about the immediate scope of the declaration.
Right; "block-scope variable" → "block variable" seemed trivially correct when we disentangled block/local variables, but of course the old terminology was imprecise and required interpretation! Oops.
[dcl.init.general]/5:
IIUC the intent is to prohibit
But it seems that the variable
x
is not a block variable, because it does not belong to the block scope, because the target scope of its declaration is the innermost enclosing namespace scope ([dcl.meaning.general]/(3.5)).I think this sentence should instead talk about the immediate scope of the declaration.
cc @opensdh
The text was updated successfully, but these errors were encountered: