[cfe-dev] CodeGen/statements.c: Don't understand test and its failure
Chris Lattner
clattner at apple.com
Thu Oct 15 08:50:31 PDT 2009
On Oct 15, 2009, at 8:42 AM, John Thompson wrote:
> On Windows, the CodeGen/statements.c test fails, apparently because
> of this error:
>
> 3><stdin>:23:17: error: initializer element is not a compile-time
> constant
> 3>static long x = &&bar - &&baz;
> 3> ^~~~~~~~~~~~~
> First, what does a unary "&&" do on a variable? Address of an
> address? It doesn't seem to make sense.
>
> Second, why would it result in an error in VC++-built Clang, but not
> on other platforms? (I tried using other target triples, but there
> was no change.)
>
> I know I'll probably have to debug it, but understanding the first
> might help.
This is the GNU address of a label extension. Can you remove the
'static' (which will allow it to parse) and paste what clang-cc -ast-
dump shows for that statement?
-Chris
More information about the cfe-dev
mailing list