[patch] Correctly align arrays of int64_t on 32 bit systems

Rafael EspĂ­ndola rafael.espindola at gmail.com
Wed Aug 7 14:58:10 PDT 2013


> Should foo[n] really return different results depending on the value of
> n? That feels wrong to me.

This is (and was) the odd case for x86_64. We accept but gcc rejects this

-----------------------------
long long int foo[1];
long long int bar[2];

static_assert(alignof(foo) == 8, "foo");
static_assert(alignof(bar) == 16, "bar");
-----------------------------

Richard, gcc is correct in here, right? If so I can try to code a
patch replacing RefAsPointee with a more generic ForAlignof.

Cheers,
Rafael



More information about the cfe-commits mailing list