OSDN Git Service

Index: libcpp/ChangeLog
authorgeoffk <geoffk@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 15 Mar 2005 09:55:41 +0000 (09:55 +0000)
committergeoffk <geoffk@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 15 Mar 2005 09:55:41 +0000 (09:55 +0000)
2005-03-14  Geoffrey Keating  <geoffk@apple.com>

* lex.c (forms_identifier_p): Disable UCNs in C89 mode.

Index: gcc/testsuite/ChangeLog
2005-03-14  Geoffrey Keating  <geoffk@apple.com>

* gcc.dg/cpp/ucnid-6.c: New.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@96475 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/cpp/ucnid-6.c [new file with mode: 0644]
libcpp/ChangeLog
libcpp/lex.c

index 765cc43..6805e68 100644 (file)
@@ -15,6 +15,8 @@
 
 2005-03-14  Geoffrey Keating  <geoffk@apple.com>
 
+       * gcc.dg/cpp/ucnid-6.c: New.
+
        * gcc.dg/cpp/normalize-1.c: New.
        * gcc.dg/cpp/normalize-2.c: New.
        * gcc.dg/cpp/normalize-3.c: New.
diff --git a/gcc/testsuite/gcc.dg/cpp/ucnid-6.c b/gcc/testsuite/gcc.dg/cpp/ucnid-6.c
new file mode 100644 (file)
index 0000000..9ee0858
--- /dev/null
@@ -0,0 +1,5 @@
+/* { dg-do compile } */
+/* { dg-options "-std=c89" } */
+#define a b(
+#define b(x) q
+int a\u00aa);
index 9f4303c..043acee 100644 (file)
@@ -1,5 +1,9 @@
 2005-03-14  Geoffrey Keating  <geoffk@apple.com>
 
+       * lex.c (forms_identifier_p): Disable UCNs in C89 mode.
+
+2005-03-14  Geoffrey Keating  <geoffk@apple.com>
+       
        * init.c (cpp_create_reader): Default warn_normalize to normalized_C.
        * charset.c: Update for new format of ucnid.h.
        (ucn_valid_in_identifier): Update for new format of ucnid.h.
index 9bcb91c..289f7b3 100644 (file)
@@ -476,7 +476,8 @@ forms_identifier_p (cpp_reader *pfile, int first,
     }
 
   /* Is this a syntactically valid UCN?  */
-  if (*buffer->cur == '\\'
+  if ((CPP_OPTION (pfile, cplusplus) || CPP_OPTION (pfile, c99))
+      && *buffer->cur == '\\'
       && (buffer->cur[1] == 'u' || buffer->cur[1] == 'U'))
     {
       buffer->cur += 2;