Address constant

Address constants (C99 6.6p9) are not handled. (r43994)

The standard says that the rules for constant expressions in
initializers are more lax than for other constant expressions. Does
this mean isConstantInitializer is needed in addition to
isConstantExpr, like isIntegerConstantExpr?

It seems that current isConstantExpr is used as isConstantInitializer,
so I patched isConstantExpr directly.

A rather incomplete implementation and a test is attached.

address-constant.txt (979 Bytes)

A little better implementation and a little better test is attached. I
paste the test inline for comments.

// RUN: clang -fsyntax-only -verify %s

int i;
int a = {0};
struct { int i; } s;

int *array = {&i, a, &s.i};

address-constant.txt (2.44 KB)

Patch looks great, thanks!
http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20071112/002837.html

-Chris