const objects are named constantsAuthors: Jay Ghiron
Date: 2026-11-04
Submitted against: C2Y (N3998 draft)
Status: Open
This issue is about the wording added by N3833. Consider the following:
static const int a=a;
static const int b=_Generic((int(*)[b])0,int(*)[2]:1,default:2);
There does not appear to be anything that prohibits these identifiers from being named constants. More generally, there is nothing that requires the initializer to come before the named constant. Surely it is not intended to allow for a named constant to depend upon its own value, so it should be prohibited. A correction should also consider whether redeclarations in an inner scope inhibit uses in named constants:
static const int c=1;
int main(){
extern const int c;
/* should c still be a named constant? */
}