diff options
author | Joseph Myers <joseph@codesourcery.com> | 2009-05-03 15:07:41 +0100 |
---|---|---|
committer | Joseph Myers <jsm28@gcc.gnu.org> | 2009-05-03 15:07:41 +0100 |
commit | fa5da7dee34affe9a2bbf01350845b803e493e0c (patch) | |
tree | c88e41715d209f86ef9fef3ae5a484b7788fc273 /gcc | |
parent | 2ddd5020a18df527dd769c8513697d59671ad154 (diff) | |
download | gcc-fa5da7dee34affe9a2bbf01350845b803e493e0c.zip gcc-fa5da7dee34affe9a2bbf01350845b803e493e0c.tar.gz gcc-fa5da7dee34affe9a2bbf01350845b803e493e0c.tar.bz2 |
c-common.c (reswords): Add _Imaginary.
* c-common.c (reswords): Add _Imaginary.
* c-common.c (enum rid): Add RID_IMAGINARY.
testsuite:
* gcc.dg/c99-complex-3.c: New test.
From-SVN: r147075
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/c-common.c | 1 | ||||
-rw-r--r-- | gcc/c-common.h | 4 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/testsuite/gcc.dg/c99-complex-3.c | 7 |
5 files changed, 21 insertions, 0 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog index 4fd93e5..225919e 100644 --- a/gcc/ChangeLog +++ b/gcc/ChangeLog @@ -1,3 +1,8 @@ +2009-05-03 Joseph Myers <joseph@codesourcery.com> + + * c-common.c (reswords): Add _Imaginary. + * c-common.c (enum rid): Add RID_IMAGINARY. + 2009-05-03 Paolo Bonzini <bonzini@gnu.org> * tree.h (TYPE_VECTOR_OPAQUE): Fix documentation. diff --git a/gcc/c-common.c b/gcc/c-common.c index 7ee7a09..d877c0f 100644 --- a/gcc/c-common.c +++ b/gcc/c-common.c @@ -730,6 +730,7 @@ const struct c_common_resword c_common_reswords[] = { { "_Bool", RID_BOOL, D_CONLY }, { "_Complex", RID_COMPLEX, 0 }, + { "_Imaginary", RID_IMAGINARY, D_CONLY }, { "_Decimal32", RID_DFLOAT32, D_CONLY | D_EXT }, { "_Decimal64", RID_DFLOAT64, D_CONLY | D_EXT }, { "_Decimal128", RID_DFLOAT128, D_CONLY | D_EXT }, diff --git a/gcc/c-common.h b/gcc/c-common.h index 616273a..1444880 100644 --- a/gcc/c-common.h +++ b/gcc/c-common.h @@ -63,6 +63,10 @@ enum rid /* ObjC */ RID_IN, RID_OUT, RID_INOUT, RID_BYCOPY, RID_BYREF, RID_ONEWAY, + /* C (reserved and imaginary types not implemented, so any use is a + syntax error) */ + RID_IMAGINARY, + /* C */ RID_INT, RID_CHAR, RID_FLOAT, RID_DOUBLE, RID_VOID, RID_ENUM, RID_STRUCT, RID_UNION, RID_IF, RID_ELSE, diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index bdb6f44..fe172c5 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,9 @@ 2009-05-03 Joseph Myers <joseph@codesourcery.com> + * gcc.dg/c99-complex-3.c: New test. + +2009-05-03 Joseph Myers <joseph@codesourcery.com> + * gcc.dg/cpp/utf8-5byte-1.c: New test. 2009-05-02 Joseph Myers <joseph@codesourcery.com> diff --git a/gcc/testsuite/gcc.dg/c99-complex-3.c b/gcc/testsuite/gcc.dg/c99-complex-3.c new file mode 100644 index 0000000..f1f7a1f --- /dev/null +++ b/gcc/testsuite/gcc.dg/c99-complex-3.c @@ -0,0 +1,7 @@ +/* Test for _Imaginary: when imaginary types are not implemented, this + is still a keyword and must give a syntax error if used rather than + being treated as an identifier. */ +/* { dg-do compile } */ +/* { dg-options "-std=iso9899:1999 -pedantic-errors" } */ + +float _Imaginary; /* { dg-error "expected" } */ |