[cfe-commits] r57313 - in /cfe/trunk: lib/Sema/SemaDeclCXX.cpp test/SemaCXX/class.cpp
Sebastian Redl
sebastian.redl at getdesigned.at
Thu Oct 9 04:52:24 PDT 2008
On Wed, 08 Oct 2008 22:20:31 -0000, Argiris Kirtzidis <akyrtzi at gmail.com>
wrote:
> class C {
> static const int number = 50;
> static int arr[number];
> };
>
> Here's how it worked:
> -GetTypeForDeclarator was called from both Sema::ActOnCXXMemberDeclarator
> and Sema::ActOnDeclarator.
> -VariableArrayTypes are not uniqued so two VariableArrayTypes were
created
> with the same DeclRefExpr.
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.
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