aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorVille Voutilainen <ville.voutilainen@gmail.com>2009-08-26 00:21:25 +0300
committerJason Merrill <jason@gcc.gnu.org>2009-08-25 17:21:25 -0400
commitf4e8a9430d5b2692da88cbbcd2162f45c6c8d978 (patch)
treee305bb77dbb3c71345fe71ff46eb2173c487e887 /gcc
parent7b5cbb57032c98320bc7b5ba9da3dab8362a393d (diff)
downloadgcc-f4e8a9430d5b2692da88cbbcd2162f45c6c8d978.zip
gcc-f4e8a9430d5b2692da88cbbcd2162f45c6c8d978.tar.gz
gcc-f4e8a9430d5b2692da88cbbcd2162f45c6c8d978.tar.bz2
* c-common.c (c_common_reswords) add the alignof keyword,
with same RID as __alignof and __alignof__ From-SVN: r151097
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog5
-rw-r--r--gcc/c-common.c1
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/g++.dg/cpp0x/alignof.C5
4 files changed, 16 insertions, 0 deletions
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 <ville.voutilainen@gmail.com>
+
+ * c-common.c (c_common_reswords) add the alignof keyword,
+ with same RID as __alignof and __alignof__
+
2009-08-25 Anatoly Sokolov <aesok@post.ru>
* 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 <ville.voutilainen@gmail.com>
+
+ * g++.dg/cpp0x/alignof.C: New. Tests that the alignof
+ keyword works in the same manner as __alignof.
+
2009-08-25 Thomas Koenig <tkoenig@gcc.gnu.org>
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)");
+}