On Wed, Aug 7, 2013 at 5:04 PM, Richard Smith <[email protected]> wrote:
> On Wed, Aug 7, 2013 at 2:58 PM, Rafael Espíndola < > [email protected]> wrote: > >> > 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? > > > To quote Clang, 'alignof' applied to an expression is a GNU extension. > Thus we should presumably do what GCC does -- C++ doesn't have a notion of > the alignment of a declaration as distinct from the alignment of its type. > OK, so that's not strictly-speaking true, but it doesn't have a notion of the alignment being increased because all globals happen to be 16-byte aligned on the target system. > > >> If so I can try to code a >> patch replacing RefAsPointee with a more generic ForAlignof. >> >> Cheers, >> Rafael >> > >
_______________________________________________ cfe-commits mailing list [email protected] http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
