OSDN Git Service

Some raw string changes from N3077
authorjason <jason@138bc75d-0d04-0410-961f-82ee72b054a4>
Mon, 29 Mar 2010 15:00:43 +0000 (15:00 +0000)
committerMasaki Muranaka <monaka@monami-software.com>
Sun, 23 May 2010 05:15:11 +0000 (14:15 +0900)
* charset.c (cpp_interpret_string): Change inner delimiters to ().
* lex.c (lex_raw_string): Likewise.  Also disallow '\' in delimiter.

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

gcc/testsuite/ChangeLog
libcpp/ChangeLog
libcpp/lex.c

index 36fb604..72fd240 100644 (file)
@@ -1,3 +1,16 @@
+2010-03-29  Jason Merrill  <jason@redhat.com>
+
+       N3077
+       * g++.dg/ext/raw-string-1.C: Change [] to ().
+       * g++.dg/ext/raw-string-2.C: Change [] to ().
+       Don't use \ in delimiter.
+       * g++.dg/ext/raw-string-3.C: Change [] to ().
+       * g++.dg/ext/raw-string-4.C: Change [] to ().
+       * g++.dg/ext/raw-string-5.C: Change [] to ().
+       Test for error on \ in delimiter.
+       * g++.dg/ext/raw-string-6.C: Change [] to ().
+       * g++.dg/ext/raw-string-7.C: Change [] to ().
+
 2010-03-29  Jie Zhang  <jie@codesourcery.com>
 
        PR 43564
index cc77ca0..24030fb 100644 (file)
@@ -1,77 +1,5 @@
-2010-04-25  Joseph Myers  <joseph@codesourcery.com>
-
-       * include/cpplib.h (enum c_lang): Add CLK_GNUC1X and CLK_STDC1X.
-       * init.c (lang_defaults): Add entries for new language variants.
-       (cpp_init_builtins): Define __STDC_VERSION__ to 201000L for C1X
-       variants.
-
-2010-04-09  Manuel López-Ibáñez <manu@gcc.gnu.org>
-
-       PR cpp/43195
-       * files.c (report_missing_guard): Test for #pragma once.
-
-2010-04-07  Simon Baldwin  <simonb@google.com>
-
-       * directives.c (do_diagnostic): Add warning reason argument,
-       call appropriate error reporting function for code.
-       (directive_diagnostics): Call specific warning functions with
-       warning reason where appropriate.
-       (do_error, do_warning, do_pragma_dependency): Add warning reason
-       argument to do_diagnostic calls.
-       * macro.c (_cpp_warn_if_unused_macro, enter_macro_context,
-       _cpp_create_definition): Call specific warning functions with
-       warning reason where appropriate.
-       * Makefile.in: Add new diagnostic functions to gettext translations.
-       * include/cpplib.h (struct cpp_callbacks): Add warning reason code
-       to error callback.
-       (CPP_DL_WARNING, CPP_DL_WARNING_SYSHDR, CPP_DL_PEDWARN, CPP_DL_ERROR,
-       CPP_DL_ICE, CPP_DL_NOTE, CPP_DL_FATAL): Replace macros with enums.
-       (CPP_W_NONE, CPP_W_DEPRECATED, CPP_W_COMMENTS,
-       CPP_W_MISSING_INCLUDE_DIRS, CPP_W_TRIGRAPHS, CPP_W_MULTICHAR,
-       CPP_W_TRADITIONAL, CPP_W_LONG_LONG, CPP_W_ENDIF_LABELS,
-       CPP_W_NUM_SIGN_CHANGE, CPP_W_VARIADIC_MACROS,
-       CPP_W_BUILTIN_MACRO_REDEFINED, CPP_W_DOLLARS, CPP_W_UNDEF,
-       CPP_W_UNUSED_MACROS, CPP_W_CXX_OPERATOR_NAMES, CPP_W_NORMALIZE,
-       CPP_W_INVALID_PCH, CPP_W_WARNING_DIRECTIVE): New enums for cpp
-       warning reason codes.
-       (cpp_warning, cpp_pedwarning, cpp_warning_syshdr,
-       cpp_warning_with_line, cpp_pedwarning_with_line,
-       cpp_warning_with_line_syshdr): New specific error reporting functions.
-       * pch.c (cpp_valid_state): Call specific warning functions with
-       warning reason where appropriate.
-       * errors.c (cpp_diagnostic, cpp_diagnostic_with_line): New central
-       diagnostic handlers.
-       (cpp_warning, cpp_pedwarning, cpp_warning_syshdr,
-       cpp_warning_with_line, cpp_pedwarning_with_line,
-       cpp_warning_with_line_syshdr): New specific error reporting functions.
-       * expr.c (cpp_classify_number, eval_token, num_unary_op): Call
-       specific warning functions with warning reason where appropriate.
-       * lex.c (_cpp_process_line_notes, _cpp_skip_block_comment,
-       warn_about_normalization, lex_identifier_intern, lex_identifier,
-       _cpp_lex_direct): Ditto.
-       * charset.c (_cpp_valid_ucn, convert_hex, convert_escape,
-       narrow_str_to_charconst): Ditto.
-
-2010-04-06  Jakub Jelinek  <jakub@redhat.com>
-
-       PR preprocessor/43642
-       * lex.c (lex_raw_string): Change type of TYPE variable to
-       unsigned char.
-
-2010-04-02  Ralf Wildenhues  <Ralf.Wildenhues@gmx.de>
-
-       * aclocal.m4: Regenerate.
-
 2010-03-29  Jason Merrill  <jason@redhat.com>
 
-       More N3077 raw string changes
-       * charset.c (cpp_interpret_string): Don't transform UCNs in raw
-       strings.
-       * lex.c (bufring_append): Split out from...
-       (lex_raw_string): ...here.  Undo trigraph and line splicing
-       transformations.  Do process line notes in multi-line literals.
-       (_cpp_process_line_notes): Ignore notes that were already handled.
-
        Some raw string changes from N3077
        * charset.c (cpp_interpret_string): Change inner delimiters to ().
        * lex.c (lex_raw_string): Likewise.  Also disallow '\' in delimiter.
index f628272..6afb220 100644 (file)
@@ -818,66 +818,6 @@ lex_raw_string (cpp_reader *pfile, cpp_token *token, const uchar *base,
                  BUF_APPEND (" ", 1);
                }
 
-             BUF_APPEND ("\n", 1);
-             break;
-
-           case 0:
-             /* Already handled.  */
-             break;
-
-           default:
-             if (_cpp_trigraph_map[note->type])
-               {
-                 /* Don't warn about this trigraph in
-                    _cpp_process_line_notes, since trigraphs show up as
-                    trigraphs in raw strings.  */
-                 uchar type = note->type;
-                 note->type = 0;
-
-                 if (!CPP_OPTION (pfile, trigraphs))
-                   /* If we didn't convert the trigraph in the first
-                      place, don't do anything now either.  */
-                   break;
-
-                 BUF_APPEND (base, cur - base);
-                 base = cur;
-                 BUF_APPEND ("??", 2);
-
-                 /* ??/ followed by newline gets two line notes, one for
-                    the trigraph and one for the backslash/newline.  */
-                 if (type == '/' && note[1].pos == cur)
-                   {
-                     if (note[1].type != '\\'
-                         && note[1].type != ' ')
-                       abort ();
-                     BUF_APPEND ("/", 1);
-                     ++note;
-                     goto after_backslash;
-                   }
-                 /* The ) from ??) could be part of the suffix.  */
-                 else if (type == ')'
-                          && strncmp ((const char *) cur+1,
-                                      (const char *) raw_prefix,
-                                      raw_prefix_len) == 0
-                          && cur[raw_prefix_len+1] == '"')
-                   {
-                     cur += raw_prefix_len+2;
-                     goto break_outer_loop;
-                   }
-                 else
-                   {
-                     /* Skip the replacement character.  */
-                     base = ++cur;
-                     BUF_APPEND (&type, 1);
-                   }
-               }
-             else
-               abort ();
-             break;
-           }
-       }
-      c = *cur++;
-
       if (c == ')'
          && strncmp ((const char *) cur, (const char *) raw_prefix,
                      raw_prefix_len) == 0