From: Ville Voutilainen Date: Tue, 25 Aug 2009 21:21:25 +0000 (+0300) Subject: * c-common.c (c_common_reswords) add the alignof keyword, X-Git-Tag: releases/gcc-4.5.0~3846 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f4e8a9430d5b2692da88cbbcd2162f45c6c8d978;p=thirdparty%2Fgcc.git * c-common.c (c_common_reswords) add the alignof keyword, with same RID as __alignof and __alignof__ From-SVN: r151097 --- diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 4d4a8e659f02..03ffa9b00849 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2009-08-25 Ville Voutilainen + + * c-common.c (c_common_reswords) add the alignof keyword, + with same RID as __alignof and __alignof__ + 2009-08-25 Anatoly Sokolov * hooks.h (hook_bool_const_int_const_int_true): Declare. diff --git a/gcc/c-common.c b/gcc/c-common.c index ee4991ad6238..a19489c49df9 100644 --- a/gcc/c-common.c +++ b/gcc/c-common.c @@ -619,6 +619,7 @@ const struct c_common_resword c_common_reswords[] = { "__typeof__", RID_TYPEOF, 0 }, { "__volatile", RID_VOLATILE, 0 }, { "__volatile__", RID_VOLATILE, 0 }, + { "alignof", RID_ALIGNOF, D_CXXONLY | D_CXX0X | D_CXXWARN }, { "asm", RID_ASM, D_ASM }, { "auto", RID_AUTO, 0 }, { "bool", RID_BOOL, D_CXXONLY | D_CXXWARN }, diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 702fb685ceb5..eff7d269e619 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2009-08-25 Ville Voutilainen + + * g++.dg/cpp0x/alignof.C: New. Tests that the alignof + keyword works in the same manner as __alignof. + 2009-08-25 Thomas Koenig PR libfortran/34670 diff --git a/gcc/testsuite/g++.dg/cpp0x/alignof.C b/gcc/testsuite/g++.dg/cpp0x/alignof.C new file mode 100644 index 000000000000..8e8f715cdf3d --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp0x/alignof.C @@ -0,0 +1,5 @@ +// { dg-options "-std=c++0x" } +int main(void) +{ + static_assert(alignof(int) == __alignof(int), "alignof(int) does not equal __alignof(int)"); +}