Commit Message

Hi,
in mainline and 4.8, at variance with 4.7, for:
enum { A };
static const char *a[] = {
[A] = "a"
};
check_array_designated_initializer is called by reshape_init* with
ce->index a CONST_DECL, not an INTEGER_CST. Thus I wondered if in such
cases it's just matter of using integral_constant_value on it, thus
something like the below (which passes testing on x86_64-linux).
Thanks,
Paolo.
//////////////////////

Comments

On 03/26/2013 08:09 AM, Paolo Carlini wrote:
> check_array_designated_initializer is called by reshape_init* with> ce->index a CONST_DECL, not an INTEGER_CST. Thus I wondered if in such> cases it's just matter of using integral_constant_value on it, thus> something like the below (which passes testing on x86_64-linux).
Any constant-expression can go there, so I think I'd use
cxx_constant_value unconditionally.
Jason