[cfe-commits] r57313 - in /cfe/trunk: lib/Sema/SemaDeclCXX.cpp test/SemaCXX/class.cpp
Argiris Kirtzidis
akyrtzi at gmail.com
Thu Oct 9 05:41:23 PDT 2008
Sebastian Redl wrote:
>
> Why would this create a VariableArrayType anyway? The inline-initialized
> static const int is a constant expression and should create a variable
> of known size.
Yeah, good question. For:
const int n=2;
int x[n+3];
it seems more appropriate for C++ to fold the type of 'x' into int[5].
Later on, in order to be able to find the 'n' reference in the AST,
"n+3" expression could be added in the (previously discussed)
'TypeSpecifier' node in the AST.
-Argiris
>
> Or are all arrays whose size references an expression considered
> variable for the sake of preserving the source expression?
>
> Sebastian
>
More information about the cfe-commits
mailing list