From e463efd7ee550cdd15f88ef9101a3020e4929f2e Mon Sep 17 00:00:00 2001 From: jason Date: Tue, 25 Aug 2009 21:21:25 +0000 Subject: [PATCH] * c-common.c (c_common_reswords) add the alignof keyword, with same RID as __alignof and __alignof__ git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@151097 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/ChangeLog | 5 +++++ gcc/c-common.c | 1 + gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/g++.dg/cpp0x/alignof.C | 5 +++++ 4 files changed, 16 insertions(+) create mode 100644 gcc/testsuite/g++.dg/cpp0x/alignof.C diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 4d4a8e6..03ffa9b 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 ee4991a..a19489c 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 702fb68..eff7d26 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 0000000..8e8f715 --- /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)"); +} -- 2.7.4