2004-04-20 Eric Christopher <echristo@redhat.com>
authorechristo <echristo@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 20 Apr 2004 21:50:12 +0000 (21:50 +0000)
committerechristo <echristo@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 20 Apr 2004 21:50:12 +0000 (21:50 +0000)
* gcc.dg/charset/extern.c: New test.
* g++.dg/charset/extern3.cc: Ditto.

2004-04-20  Eric Christopher  <echristo@redhat.com>

* cp/parser.c (cp_parser_declaration): Move translate
up before tokens are lexed.

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

gcc/ChangeLog
gcc/cp/parser.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/charset/extern3.cc [new file with mode: 0644]
gcc/testsuite/gcc.dg/charset/extern.c [new file with mode: 0644]

index fb0b092..58436c3 100644 (file)
@@ -1,3 +1,8 @@
+2004-04-20  Eric Christopher  <echristo@redhat.com>
+
+       * cp/parser.c (cp_parser_declaration): Move translate
+       up before tokens are lexed.
+
 2004-04-20  Uros Bizjak  <uros@kss-loka.si>
 
        * optabs.h (enum optab_index): Add new OTI_asin and OTI_acos.
@@ -31,7 +36,7 @@
        * doc/invoke.texi (Optimize options): Move -frename-registers
        to "Not triggered by any -O level" section.  Adjust commentary
        accordingly.
-                                       
+
 2004-04-20  Anil Paranjpe   <anilp1@kpitcummins.com>
 
        * toplev.c (compile_file): Move targetm.asm_out.file_end call to end.
index a7f49e0..fde2f5a 100644 (file)
@@ -6349,6 +6349,8 @@ cp_parser_declaration (cp_parser* parser)
   if (token1.type != CPP_EOF)
     token2 = *cp_lexer_peek_nth_token (parser->lexer, 2);
 
+  c_lex_string_translate = true;
+
   /* If the next token is `extern' and the following token is a string
      literal, then we have a linkage specification.  */
   if (token1.keyword == RID_EXTERN
@@ -6398,8 +6400,6 @@ cp_parser_declaration (cp_parser* parser)
   else
     /* Try to parse a block-declaration, or a function-definition.  */
     cp_parser_block_declaration (parser, /*statement_p=*/false);
-
-  c_lex_string_translate = true;
 }
 
 /* Parse a block-declaration.
index c88423e..f0f5ef4 100644 (file)
@@ -1,3 +1,8 @@
+2004-04-20  Eric Christopher  <echristo@redhat.com>
+
+       * gcc.dg/charset/extern.c: New test.
+       * g++.dg/charset/extern3.cc: Ditto.
+
 2004-04-20  Uros Bizjak  <uros@kss-loka.si>
 
        * gcc.dg/builtins-39.c: New test.
 2004-04-17  Laurent GUERBY <laurent@guerby.net>
 
        * ada/acats/run_all.sh: use -O2 by default.
-       
+
 2004-04-17  Richard Sandiford  <rsandifo@redhat.com>
 
        * gcc.dg/vr-mult-[12].c: New tests.
diff --git a/gcc/testsuite/g++.dg/charset/extern3.cc b/gcc/testsuite/g++.dg/charset/extern3.cc
new file mode 100644 (file)
index 0000000..5e46ca6
--- /dev/null
@@ -0,0 +1,11 @@
+/* { dg-do compile }
+   { dg-require-iconv "IBM-1047" }
+   { dg-final { scan-assembler-not "abcdefghijklmnopqrstuvwxyz" } } */
+
+extern char *bar;
+
+extern void foo (void)
+{
+   char str[]="abcdefghijklmnopqrstuvwxyz";
+   bar = str;
+}
diff --git a/gcc/testsuite/gcc.dg/charset/extern.c b/gcc/testsuite/gcc.dg/charset/extern.c
new file mode 100644 (file)
index 0000000..5e46ca6
--- /dev/null
@@ -0,0 +1,11 @@
+/* { dg-do compile }
+   { dg-require-iconv "IBM-1047" }
+   { dg-final { scan-assembler-not "abcdefghijklmnopqrstuvwxyz" } } */
+
+extern char *bar;
+
+extern void foo (void)
+{
+   char str[]="abcdefghijklmnopqrstuvwxyz";
+   bar = str;
+}