decl.c (grokfndecl): If ::main is found not to return int, correct it after issuing...
authorZack Weinberg <zack@gcc.gnu.org>
Thu, 23 Sep 2004 21:27:25 +0000 (21:27 +0000)
committerZack Weinberg <zack@gcc.gnu.org>
Thu, 23 Sep 2004 21:27:25 +0000 (21:27 +0000)
gcc/cp:
* decl.c (grokfndecl): If ::main is found not to return int,
correct it after issuing a diagnostic.
(grokdeclarator): If the incoming type was error_mark_node, do
not complain about declaring something with no type.
(start_function): Change check for ::main not returning int to
an assertion, as grokfndecl now catches this when the user did it.
* init.c (perform_member_init, sort_mem_initializers)
(emit_mem_initializers): Make most diagnostics be issued on
the line of current_function_decl, not whatever the current
input line is.
* parser.c (cp_lexer_peek_token_emit_debug_info): Surround
definition and declaration with #ifdef ENABLE_CHECKING.
Avoid unnecessary use of fprintf.
(cp_lexer_print_token, cp_lexer_debug_stream): Adjust stub
definitions to avoid warnings.
(cp_lexer_new_main): Add assertion that first token is not a
padding token.
(cp_lexer_new_from_token_array): Fold into ...
(cp_lexer_new_from_tokens): ... here.  Add assertion that
first token is not a padding token.
(cp_lexer_set_source_position_from_token): Move nearer to callers.
Remove unused lexer argument.
(cp_lexer_peek_token): Just print debugging report (if enabled)
and return lexer->next_token.
(cp_lexer_skip_purged_tokens): Delete.
(cp_lexer_next_token_is, cp_lexer_next_token_is_not): Make
inline, simplify bodies.
(cp_lexer_peek_nth_token): Add debugging report a la
cp_lexer_peek_token.
(cp_lexer_consume_token): Correct commentary.  Advance over
purged tokens here.  Set current source position here, from
token to be returned.  Avoid unnecessary use of fprintf.
(cp_lexer_purge_token): Advance next_token pointer over this and
subsequent purged tokens.
(cp_parser_error): Adjust source position to that of the
peeked token.
(cp_parser_push_lexer_for_tokens, cp_parser_pop_lexer): New functions.
(cp_parser_string_literal): Remove some excessive cleverness.
(cp_parser_enum_specifier): Call start_enum before consuming
the opening brace.
(cp_parser_member_declaration): Make the "extra semicolon"
diagnostic consistently-worded with the other place this is
diagnosed.  Explicitly set the diagnostic location to the
location of the offending semicolon.
(cp_parser_enclosed_template_argument_list): Use %</%> quoting
in diagnostics.  Do not use cp_parser_require.  Set location
of diagnostics about improper use of '>>' to location of
offending token.
(cp_parser_late_parsing_for_member):
Use cp_parser_push_lexer_for_tokens and cp_parser_pop_lexer.
(cp_parser_late_parsing_default_args): Likewise.  Manually
move some logic outside the loop.

gcc/testsuite:
* g++.dg/ext/complit1.C
* g++.dg/other/error2.C
* g++.dg/other/nontype-1.C
* g++.dg/parse/crash11.C
* g++.dg/parse/crash12.C
* g++.dg/parse/error15.C
* g++.dg/parse/error4.C
* g++.dg/parse/tmpl-outside1.C
* g++.dg/parse/too-many-tmpl-args1.C
* g++.dg/template/dependent-expr3.C
* g++.dg/template/error10.C
* g++.dg/template/instantiate1.C
* g++.dg/template/vtable2.C
* g++.dg/warn/Wshadow-1.C
* g++.dg/warn/weak1.C
* g++.old-deja/g++.brendan/crash16.C
* g++.old-deja/g++.brendan/crash18.C
* g++.old-deja/g++.brendan/crash48.C
* g++.old-deja/g++.brendan/crash49.C
* g++.old-deja/g++.brendan/crash55.C
* g++.old-deja/g++.brendan/crash56.C
* g++.old-deja/g++.brendan/crash8.C
* g++.old-deja/g++.brendan/enum11.C
* g++.old-deja/g++.brendan/enum8.C
* g++.old-deja/g++.brendan/enum9.C
* g++.old-deja/g++.brendan/friend3.C
* g++.old-deja/g++.brendan/misc14.C
* g++.old-deja/g++.bugs/900402_02.C
* g++.old-deja/g++.bugs/900404_03.C
* g++.old-deja/g++.bugs/900404_04.C
* g++.old-deja/g++.bugs/900428_03.C
* g++.old-deja/g++.jason/crash4.C
* g++.old-deja/g++.jason/overload21.C
* g++.old-deja/g++.jason/redecl1.C
* g++.old-deja/g++.jason/report.C
* g++.old-deja/g++.jason/rfg10.C
* g++.old-deja/g++.jason/template30.C
* g++.old-deja/g++.law/arm12.C
* g++.old-deja/g++.law/ctors5.C
* g++.old-deja/g++.law/cvt20.C
* g++.old-deja/g++.law/init10.C
* g++.old-deja/g++.law/init8.C
* g++.old-deja/g++.law/visibility17.C
* g++.old-deja/g++.law/visibility7.C
* g++.old-deja/g++.mike/net8.C
* g++.old-deja/g++.mike/p646.C
* g++.old-deja/g++.mike/p700.C
* g++.old-deja/g++.mike/p701.C
* g++.old-deja/g++.mike/p811.C
* g++.old-deja/g++.ns/template13.C
* g++.old-deja/g++.other/array3.C
* g++.old-deja/g++.other/crash25.C
* g++.old-deja/g++.other/dtor3.C
* g++.old-deja/g++.other/dtor4.C
* g++.old-deja/g++.other/main1.C
* g++.old-deja/g++.other/warn7.C
* g++.old-deja/g++.pt/crash11.C
* g++.old-deja/g++.pt/crash36.C
* g++.old-deja/g++.pt/spec22.C
* g++.old-deja/g++.pt/spec9.C
* g++.old-deja/g++.pt/ttp52.C
* g++.old-deja/g++.robertl/eb103.C
* g++.old-deja/g++.robertl/eb121.C
* g++.old-deja/g++.robertl/eb22.C
* g++.old-deja/g++.robertl/eb8.C:
Update locations and/or regexps of dg-error markers.
Remove markers for some bogus messages that are no longer issued.

libstdc++-v3:
* testsuite/20_util/memory/auto_ptr/assign_neg.cc
* testsuite/23_containers/map/operators/1_neg.cc
* testsuite/23_containers/set/operators/1_neg.cc:
Update locations and/or regexps of dg-error markers.

From-SVN: r87985

74 files changed:
gcc/cp/ChangeLog
gcc/cp/decl.c
gcc/cp/init.c
gcc/cp/parser.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/ext/complit1.C
gcc/testsuite/g++.dg/other/error2.C
gcc/testsuite/g++.dg/other/nontype-1.C
gcc/testsuite/g++.dg/parse/crash11.C
gcc/testsuite/g++.dg/parse/crash12.C
gcc/testsuite/g++.dg/parse/error15.C
gcc/testsuite/g++.dg/parse/error4.C
gcc/testsuite/g++.dg/parse/tmpl-outside1.C
gcc/testsuite/g++.dg/parse/too-many-tmpl-args1.C
gcc/testsuite/g++.dg/template/dependent-expr3.C
gcc/testsuite/g++.dg/template/error10.C
gcc/testsuite/g++.dg/template/instantiate1.C
gcc/testsuite/g++.dg/template/vtable2.C
gcc/testsuite/g++.dg/warn/Wshadow-1.C
gcc/testsuite/g++.dg/warn/weak1.C
gcc/testsuite/g++.old-deja/g++.brendan/crash16.C
gcc/testsuite/g++.old-deja/g++.brendan/crash18.C
gcc/testsuite/g++.old-deja/g++.brendan/crash48.C
gcc/testsuite/g++.old-deja/g++.brendan/crash49.C
gcc/testsuite/g++.old-deja/g++.brendan/crash55.C
gcc/testsuite/g++.old-deja/g++.brendan/crash56.C
gcc/testsuite/g++.old-deja/g++.brendan/crash8.C
gcc/testsuite/g++.old-deja/g++.brendan/enum11.C
gcc/testsuite/g++.old-deja/g++.brendan/enum8.C
gcc/testsuite/g++.old-deja/g++.brendan/enum9.C
gcc/testsuite/g++.old-deja/g++.brendan/friend3.C
gcc/testsuite/g++.old-deja/g++.brendan/misc14.C
gcc/testsuite/g++.old-deja/g++.bugs/900402_02.C
gcc/testsuite/g++.old-deja/g++.bugs/900404_03.C
gcc/testsuite/g++.old-deja/g++.bugs/900404_04.C
gcc/testsuite/g++.old-deja/g++.bugs/900428_03.C
gcc/testsuite/g++.old-deja/g++.jason/crash4.C
gcc/testsuite/g++.old-deja/g++.jason/overload21.C
gcc/testsuite/g++.old-deja/g++.jason/redecl1.C
gcc/testsuite/g++.old-deja/g++.jason/report.C
gcc/testsuite/g++.old-deja/g++.jason/rfg10.C
gcc/testsuite/g++.old-deja/g++.jason/template30.C
gcc/testsuite/g++.old-deja/g++.law/arm12.C
gcc/testsuite/g++.old-deja/g++.law/ctors5.C
gcc/testsuite/g++.old-deja/g++.law/cvt20.C
gcc/testsuite/g++.old-deja/g++.law/init10.C
gcc/testsuite/g++.old-deja/g++.law/init8.C
gcc/testsuite/g++.old-deja/g++.law/visibility17.C
gcc/testsuite/g++.old-deja/g++.law/visibility7.C
gcc/testsuite/g++.old-deja/g++.mike/net8.C
gcc/testsuite/g++.old-deja/g++.mike/p646.C
gcc/testsuite/g++.old-deja/g++.mike/p700.C
gcc/testsuite/g++.old-deja/g++.mike/p701.C
gcc/testsuite/g++.old-deja/g++.mike/p811.C
gcc/testsuite/g++.old-deja/g++.ns/template13.C
gcc/testsuite/g++.old-deja/g++.other/array3.C
gcc/testsuite/g++.old-deja/g++.other/crash25.C
gcc/testsuite/g++.old-deja/g++.other/dtor3.C
gcc/testsuite/g++.old-deja/g++.other/dtor4.C
gcc/testsuite/g++.old-deja/g++.other/main1.C
gcc/testsuite/g++.old-deja/g++.other/warn7.C
gcc/testsuite/g++.old-deja/g++.pt/crash11.C
gcc/testsuite/g++.old-deja/g++.pt/crash36.C
gcc/testsuite/g++.old-deja/g++.pt/spec22.C
gcc/testsuite/g++.old-deja/g++.pt/spec9.C
gcc/testsuite/g++.old-deja/g++.pt/ttp52.C
gcc/testsuite/g++.old-deja/g++.robertl/eb103.C
gcc/testsuite/g++.old-deja/g++.robertl/eb121.C
gcc/testsuite/g++.old-deja/g++.robertl/eb22.C
gcc/testsuite/g++.old-deja/g++.robertl/eb8.C
libstdc++-v3/ChangeLog
libstdc++-v3/testsuite/20_util/memory/auto_ptr/assign_neg.cc
libstdc++-v3/testsuite/23_containers/map/operators/1_neg.cc
libstdc++-v3/testsuite/23_containers/set/operators/1_neg.cc

index b9d2bff..9ea3fe3 100644 (file)
@@ -1,3 +1,58 @@
+2004-09-23  Zack Weinberg  <zack@codesourcery.com>
+
+       * decl.c (grokfndecl): If ::main is found not to return int,
+       correct it after issuing a diagnostic.
+       (grokdeclarator): If the incoming type was error_mark_node, do
+       not complain about declaring something with no type.
+       (start_function): Change check for ::main not returning int to
+       an assertion, as grokfndecl now catches this when the user did it.
+       * init.c (perform_member_init, sort_mem_initializers)
+       (emit_mem_initializers): Make most diagnostics be issued on
+       the line of current_function_decl, not whatever the current
+       input line is.
+       * parser.c (cp_lexer_peek_token_emit_debug_info): Surround
+       definition and declaration with #ifdef ENABLE_CHECKING.
+       Avoid unnecessary use of fprintf.
+       (cp_lexer_print_token, cp_lexer_debug_stream): Adjust stub
+       definitions to avoid warnings.
+       (cp_lexer_new_main): Add assertion that first token is not a
+       padding token.
+       (cp_lexer_new_from_token_array): Fold into ...
+       (cp_lexer_new_from_tokens): ... here.  Add assertion that
+       first token is not a padding token.
+       (cp_lexer_set_source_position_from_token): Move nearer to callers.
+       Remove unused lexer argument.
+       (cp_lexer_peek_token): Just print debugging report (if enabled)
+       and return lexer->next_token.
+       (cp_lexer_skip_purged_tokens): Delete.
+       (cp_lexer_next_token_is, cp_lexer_next_token_is_not): Make
+       inline, simplify bodies.
+       (cp_lexer_peek_nth_token): Add debugging report a la
+       cp_lexer_peek_token.
+       (cp_lexer_consume_token): Correct commentary.  Advance over
+       purged tokens here.  Set current source position here, from
+       token to be returned.  Avoid unnecessary use of fprintf.
+       (cp_lexer_purge_token): Advance next_token pointer over this and
+       subsequent purged tokens.
+       (cp_parser_error): Adjust source position to that of the
+       peeked token.
+       (cp_parser_push_lexer_for_tokens, cp_parser_pop_lexer): New functions.
+       (cp_parser_string_literal): Remove some excessive cleverness.
+       (cp_parser_enum_specifier): Call start_enum before consuming
+       the opening brace.
+       (cp_parser_member_declaration): Make the "extra semicolon"
+       diagnostic consistently-worded with the other place this is
+       diagnosed.  Explicitly set the diagnostic location to the
+       location of the offending semicolon.
+       (cp_parser_enclosed_template_argument_list): Use %</%> quoting
+       in diagnostics.  Do not use cp_parser_require.  Set location
+       of diagnostics about improper use of '>>' to location of
+       offending token.
+       (cp_parser_late_parsing_for_member):
+       Use cp_parser_push_lexer_for_tokens and cp_parser_pop_lexer.
+       (cp_parser_late_parsing_default_args): Likewise.  Manually
+       move some logic outside the loop.
+
 2004-09-23  Andrew Pinski  <pinskia@physics.uc.edu>
 
        PR c++/17618
        class_hint_flags): Remove.
        (get_pseudo_ti_init): Use CLASSTYPE_REPEATED_BASE_P and
        CLASSTYPE_DIAMOND_SHAPED_P.
-       
+
 2004-09-21  Ziemowit Laski  <zlaski@apple.com>
 
        * cp-lang.c (LANG_HOOKS_FOLD_OBJ_TYPE_REF): Moved here from
index b3cdd69..d3a0c8d 100644 (file)
@@ -5590,7 +5590,10 @@ grokfndecl (tree ctype,
        error ("cannot declare `::main' to be static");
       if (!same_type_p (TREE_TYPE (TREE_TYPE (decl)),
                        integer_type_node))
-       error ("`main' must return `int'");
+       {
+         error ("`::main' must return `int'");
+         TREE_TYPE (TREE_TYPE (decl)) = integer_type_node;
+       }
       inlinep = 0;
       publicp = 1;
     }
@@ -6465,6 +6468,7 @@ grokdeclarator (const cp_declarator *declarator,
   cp_decl_spec ds;
   cp_storage_class storage_class;
   bool unsigned_p, signed_p, short_p, long_p, thread_p;
+  bool type_was_error_mark_node = false;
 
   signed_p = declspecs->specs[(int)ds_signed];
   unsigned_p = declspecs->specs[(int)ds_unsigned];
@@ -6665,7 +6669,10 @@ grokdeclarator (const cp_declarator *declarator,
   /* Extract the basic type from the decl-specifier-seq.  */
   type = declspecs->type;
   if (type == error_mark_node)
-    type = NULL_TREE;
+    {
+      type = NULL_TREE;
+      type_was_error_mark_node = true;
+    }
   /* If the entire declaration is itself tagged as deprecated then
      suppress reports of deprecated items.  */
   if (type && TREE_DEPRECATED (type)
@@ -6756,7 +6763,9 @@ grokdeclarator (const cp_declarator *declarator,
                 && in_namespace == NULL_TREE
                 && current_namespace == global_namespace);
 
-      if (in_system_header || flag_ms_extensions)
+      if (type_was_error_mark_node)
+       /* We've already issued an error, don't complain more.  */;
+      else if (in_system_header || flag_ms_extensions)
        /* Allow it, sigh.  */;
       else if (pedantic || ! is_main)
        pedwarn ("ISO C++ forbids declaration of `%s' with no type",
@@ -10101,16 +10110,10 @@ start_function (cp_decl_specifier_seq *declspecs,
     maybe_apply_pragma_weak (decl1);
 
   if (DECL_MAIN_P (decl1))
-    {
-      /* If this doesn't return integer_type, or a typedef to
-        integer_type, complain.  */
-      if (!same_type_p (TREE_TYPE (TREE_TYPE (decl1)), integer_type_node))
-       {
-         if (pedantic || warn_return_type)
-           pedwarn ("return type for `main' changed to `int'");
-         TREE_TYPE (decl1) = default_function_type;
-       }
-    }
+    /* main must return int.  grokfndecl should have corrected it
+       (and issued a diagnostic) if the user got it wrong.  */
+    gcc_assert (same_type_p (TREE_TYPE (TREE_TYPE (decl1)),
+                            integer_type_node));
 
   start_preparsed_function (decl1, attrs, /*flags=*/SF_DEFAULT);
 
index 58dac96..b820e9e 100644 (file)
@@ -315,9 +315,8 @@ perform_member_init (tree member, tree init)
   /* Effective C++ rule 12 requires that all data members be
      initialized.  */
   if (warn_ecpp && !explicit && TREE_CODE (type) != ARRAY_TYPE)
-    warning ("`%D' should be initialized in the member initialization "
-            "list", 
-            member);
+    warning ("%J%qD should be initialized in the member initialization "
+            "list", current_function_decl, member);
 
   if (init == void_type_node)
     init = NULL_TREE;
@@ -363,16 +362,17 @@ perform_member_init (tree member, tree init)
            {
              init = build_default_init (type, /*nelts=*/NULL_TREE);
              if (TREE_CODE (type) == REFERENCE_TYPE)
-               warning
-                 ("default-initialization of `%#D', which has reference type",
-                  member);
+               warning ("%Jdefault-initialization of %q#D, "
+                        "which has reference type",
+                        current_function_decl, member);
            }
          /* member traversal: note it leaves init NULL */
          else if (TREE_CODE (type) == REFERENCE_TYPE)
-           pedwarn ("uninitialized reference member `%D'", member);
+           pedwarn ("%Juninitialized reference member %qD",
+                    current_function_decl, member);
          else if (CP_TYPE_CONST_P (type))
-           pedwarn ("uninitialized member `%D' with `const' type `%T'",
-                    member, type);
+           pedwarn ("%Juninitialized member %qD with %<const%> type %qT",
+                    current_function_decl, member, type);
        }
       else if (TREE_CODE (init) == TREE_LIST)
        /* There was an explicit member initialization.  Do some work
@@ -509,7 +509,8 @@ sort_mem_initializers (tree t, tree mem_inits)
          break;
 
       /* Issue a warning if the explicit initializer order does not
-        match that which will actually occur.  */
+        match that which will actually occur.
+         ??? Are all these on the correct lines?  */
       if (warn_reorder && !subobject_init)
        {
          if (TREE_CODE (TREE_PURPOSE (next_subobject)) == FIELD_DECL)
@@ -522,7 +523,7 @@ sort_mem_initializers (tree t, tree mem_inits)
            cp_warning_at ("  `%#D'", subobject);
          else
            warning ("  base `%T'", subobject);
-         warning ("  when initialized here");
+         warning ("%J  when initialized here", current_function_decl);
        }
 
       /* Look again, from the beginning of the list.  */
@@ -538,10 +539,11 @@ sort_mem_initializers (tree t, tree mem_inits)
       if (TREE_VALUE (subobject_init))
        {
          if (TREE_CODE (subobject) == FIELD_DECL)
-           error ("multiple initializations given for `%D'", subobject);
+           error ("%Jmultiple initializations given for %qD",
+                  current_function_decl, subobject);
          else
-           error ("multiple initializations given for base `%T'", 
-                  subobject);
+           error ("%Jmultiple initializations given for base %qT", 
+                  current_function_decl, subobject);
        }
 
       /* Record the initialization.  */
@@ -607,8 +609,8 @@ sort_mem_initializers (tree t, tree mem_inits)
                  if (same_type_p (last_field_type, field_type))
                    {
                      if (TREE_CODE (field_type) == UNION_TYPE)
-                       error ("initializations for multiple members of `%T'",
-                                 last_field_type);
+                       error ("%Jinitializations for multiple members of %qT",
+                              current_function_decl, last_field_type);
                      done = 1;
                      break;
                    }
@@ -664,9 +666,9 @@ emit_mem_initializers (tree mem_inits)
       if (extra_warnings && !arguments 
          && DECL_COPY_CONSTRUCTOR_P (current_function_decl)
          && TYPE_NEEDS_CONSTRUCTING (BINFO_TYPE (subobject)))
-       warning ("base class `%#T' should be explicitly initialized in the "
+       warning ("%Jbase class `%#T' should be explicitly initialized in the "
                 "copy constructor",
-                BINFO_TYPE (subobject));
+                current_function_decl, BINFO_TYPE (subobject));
 
       /* If an explicit -- but empty -- initializer list was present,
         treat it just like default initialization at this point.  */
index db779a2..49d0237 100644 (file)
@@ -113,8 +113,6 @@ typedef struct cp_token_cache GTY(())
 
 static cp_lexer *cp_lexer_new_main
   (void);
-static cp_lexer *cp_lexer_new_from_token_array
-  (cp_token *, cp_token *);
 static cp_lexer *cp_lexer_new_from_tokens
   (cp_token_cache *tokens);
 static void cp_lexer_destroy
@@ -133,10 +131,6 @@ static void cp_lexer_get_preprocessor_token
   (cp_lexer *, cp_token *);
 static inline cp_token *cp_lexer_peek_token
   (cp_lexer *);
-static void cp_lexer_peek_token_emit_debug_info
-  (cp_lexer *, cp_token *);
-static void cp_lexer_skip_purged_tokens
-  (cp_lexer *);
 static cp_token *cp_lexer_peek_nth_token
   (cp_lexer *, size_t);
 static inline bool cp_lexer_next_token_is
@@ -159,8 +153,6 @@ static void cp_lexer_commit_tokens
   (cp_lexer *);
 static void cp_lexer_rollback_tokens
   (cp_lexer *);
-static inline void cp_lexer_set_source_position_from_token
-  (cp_lexer *, const cp_token *);
 #ifdef ENABLE_CHECKING
 static void cp_lexer_print_token
   (FILE *, cp_token *);
@@ -170,10 +162,17 @@ static void cp_lexer_start_debugging
   (cp_lexer *) ATTRIBUTE_UNUSED;
 static void cp_lexer_stop_debugging
   (cp_lexer *) ATTRIBUTE_UNUSED;
+static void cp_lexer_peek_token_emit_debug_info
+  (cp_lexer *, cp_token *);
 #else
-#define cp_lexer_debug_stream NULL
-#define cp_lexer_print_token(str, tok)
+/* If we define cp_lexer_debug_stream to NULL it will provoke warnings
+   about passing NULL to functions that require non-NULL arguments
+   (fputs, fprintf).  It will never be used, so all we need is a value
+   of the right type that's guaranteed not to be NULL.  */
+#define cp_lexer_debug_stream stdout
+#define cp_lexer_print_token(str, tok) (void) 0
 #define cp_lexer_debugging_p(lexer) 0
+#define cp_lexer_peek_token_emit_debug_info(lexer, tok) (void) 0
 #endif /* ENABLE_CHECKING */
 
 static cp_token_cache *cp_token_cache_new
@@ -269,16 +268,18 @@ cp_lexer_new_main (void)
      string constant concatenation.  */
   c_lex_return_raw_strings = false;
 
+  gcc_assert (lexer->next_token->type != CPP_PURGED);
   return lexer;
 }
 
 /* Create a new lexer whose token stream is primed with the tokens in
-   the range [FIRST, LAST).  When these tokens are exhausted, no new
-   tokens will be read.  */
+   CACHE.  When these tokens are exhausted, no new tokens will be read.  */
 
 static cp_lexer *
-cp_lexer_new_from_token_array (cp_token *first, cp_token *last)
+cp_lexer_new_from_tokens (cp_token_cache *cache)
 {
+  cp_token *first = cache->first;
+  cp_token *last = cache->last;
   cp_lexer *lexer = GGC_CNEW (cp_lexer);
   cp_token *eof;
 
@@ -305,16 +306,9 @@ cp_lexer_new_from_token_array (cp_token *first, cp_token *last)
   /* Initially we are not debugging.  */
   lexer->debugging_p = false;
 #endif
-  return lexer;
-}
 
-/* Create a new lexer whose token stream is primed with the tokens in
-   CACHE.  When these tokens are exhausted, no new tokens will be read.  */
-
-static cp_lexer *
-cp_lexer_new_from_tokens (cp_token_cache *cache)
-{
-  return cp_lexer_new_from_token_array (cache->first, cache->last);
+  gcc_assert (lexer->next_token->type != CPP_PURGED);
+  return lexer;
 }
 
 /* Frees all resources associated with LEXER. */
@@ -338,24 +332,6 @@ cp_lexer_debugging_p (cp_lexer *lexer)
 
 #endif /* ENABLE_CHECKING */
 
-/* Set the current source position from the information stored in
-   TOKEN.  */
-
-static inline void
-cp_lexer_set_source_position_from_token (cp_lexer *lexer ATTRIBUTE_UNUSED ,
-                                         const cp_token *token)
-{
-  /* Ideally, the source position information would not be a global
-     variable, but it is.  */
-
-  /* Update the line number and system header flag. */
-  if (token->type != CPP_EOF)
-    {
-      input_location = token->location;
-      in_system_header = token->in_system_header;
-    }
-}
-
 /* TOKEN points into the circular token buffer.  Return a pointer to
    the next token in the buffer.  */
 
@@ -487,28 +463,29 @@ cp_lexer_get_preprocessor_token (cp_lexer *lexer ATTRIBUTE_UNUSED ,
     token->keyword = RID_MAX;
 }
 
+/* Update the globals input_location and in_system_header from TOKEN.   */
+static inline void
+cp_lexer_set_source_position_from_token (cp_token *token)
+{
+  if (token->type != CPP_EOF)
+    {
+      input_location = token->location;
+      in_system_header = token->in_system_header;
+    }
+}
+
 /* Return a pointer to the next token in the token stream, but do not
    consume it.  */
 
 static inline cp_token *
 cp_lexer_peek_token (cp_lexer *lexer)
 {
-  cp_token *token;
-
-  /* Skip over purged tokens if necessary. */
-  if (lexer->next_token->type == CPP_PURGED)
-    cp_lexer_skip_purged_tokens (lexer);
-
-  token = lexer->next_token;
-
-  /* Provide debugging output.  */
   if (cp_lexer_debugging_p (lexer))
-    cp_lexer_peek_token_emit_debug_info (lexer, token);
-
-  cp_lexer_set_source_position_from_token (lexer, token);
-  return token;
+    cp_lexer_peek_token_emit_debug_info (lexer, lexer->next_token);
+  return lexer->next_token;
 }
 
+#ifdef ENABLE_CHECKING
 /* Emit debug output for cp_lexer_peek_token.  Split out into a
    separate function so that cp_lexer_peek_token can be small and
    inlinable. */
@@ -517,35 +494,23 @@ static void
 cp_lexer_peek_token_emit_debug_info (cp_lexer *lexer ATTRIBUTE_UNUSED,
                                     cp_token *token ATTRIBUTE_UNUSED)
 {
-  fprintf (cp_lexer_debug_stream, "cp_lexer: peeking at token: ");
+  fputs ("cp_lexer: peeking at token: ", cp_lexer_debug_stream);
   cp_lexer_print_token (cp_lexer_debug_stream, token);
-  fprintf (cp_lexer_debug_stream, "\n");
-}
-
-/* Skip all tokens whose type is CPP_PURGED. */
-
-static void cp_lexer_skip_purged_tokens (cp_lexer *lexer)
-{
-  while (lexer->next_token->type == CPP_PURGED)
-    ++lexer->next_token;
+  putc ('\n', cp_lexer_debug_stream);
 }
+#endif
 
 /* Return true if the next token has the indicated TYPE.  */
 
-static bool
+static inline bool
 cp_lexer_next_token_is (cp_lexer* lexer, enum cpp_ttype type)
 {
-  cp_token *token;
-
-  /* Peek at the next token.  */
-  token = cp_lexer_peek_token (lexer);
-  /* Check to see if it has the indicated TYPE.  */
-  return token->type == type;
+  return cp_lexer_peek_token (lexer)->type == type;
 }
 
 /* Return true if the next token does not have the indicated TYPE.  */
 
-static bool
+static inline bool
 cp_lexer_next_token_is_not (cp_lexer* lexer, enum cpp_ttype type)
 {
   return !cp_lexer_next_token_is (lexer, type);
@@ -553,7 +518,7 @@ cp_lexer_next_token_is_not (cp_lexer* lexer, enum cpp_ttype type)
 
 /* Return true if the next token is the indicated KEYWORD.  */
 
-static bool
+static inline bool
 cp_lexer_next_token_is_keyword (cp_lexer* lexer, enum rid keyword)
 {
   cp_token *token;
@@ -565,7 +530,10 @@ cp_lexer_next_token_is_keyword (cp_lexer* lexer, enum rid keyword)
 }
 
 /* Return a pointer to the Nth token in the token stream.  If N is 1,
-   then this is precisely equivalent to cp_lexer_peek_token.  */
+   then this is precisely equivalent to cp_lexer_peek_token (except
+   that it is not inline).  One would like to disallow that case, but
+   there is one case (cp_parser_nth_token_starts_template_id) where
+   the caller passes a variable for N and it might be 1.  */
 
 static cp_token *
 cp_lexer_peek_nth_token (cp_lexer* lexer, size_t n)
@@ -575,6 +543,10 @@ cp_lexer_peek_nth_token (cp_lexer* lexer, size_t n)
   /* N is 1-based, not zero-based.  */
   gcc_assert (n > 0);
 
+  if (cp_lexer_debugging_p (lexer))
+    fprintf (cp_lexer_debug_stream,
+            "cp_lexer: peeking ahead %ld at token: ", (long)n);
+
   --n;
   token = lexer->next_token;
   while (n != 0)
@@ -584,39 +556,43 @@ cp_lexer_peek_nth_token (cp_lexer* lexer, size_t n)
        --n;
     }
 
+  if (cp_lexer_debugging_p (lexer))
+    {
+      cp_lexer_print_token (cp_lexer_debug_stream, token);
+      putc ('\n', cp_lexer_debug_stream);
+    }
+
   return token;
 }
 
-/* Consume the next token.  The pointer returned is valid only until
-   another token is read.  Callers should preserve copy the token
-   explicitly if they will need its value for a longer period of
-   time.  */
+/* Return the next token, and advance the lexer's next_token pointer
+   to point to the next non-purged token.  */
 
 static cp_token *
 cp_lexer_consume_token (cp_lexer* lexer)
 {
-  cp_token *token;
+  cp_token *token = lexer->next_token;
 
-  /* Skip over purged tokens if necessary. */
-  if (lexer->next_token->type == CPP_PURGED)
-    cp_lexer_skip_purged_tokens (lexer);
+  do
+    ++lexer->next_token;
+  while (lexer->next_token->type == CPP_PURGED);
 
-  token = lexer->next_token++;
+  cp_lexer_set_source_position_from_token (token);
 
   /* Provide debugging output.  */
   if (cp_lexer_debugging_p (lexer))
     {
-      fprintf (cp_lexer_debug_stream, "cp_lexer: consuming token: ");
+      fputs ("cp_lexer: consuming token: ", cp_lexer_debug_stream);
       cp_lexer_print_token (cp_lexer_debug_stream, token);
-      fprintf (cp_lexer_debug_stream, "\n");
+      putc ('\n', cp_lexer_debug_stream);
     }
 
   return token;
 }
 
-/* Permanently remove the next token from the token stream.  There
-   must be a valid next token already; this token never reads
-   additional tokens from the preprocessor.  */
+/* Permanently remove the next token from the token stream, and
+   advance the next_token pointer to refer to the next non-purged
+   token.  */
 
 static void
 cp_lexer_purge_token (cp_lexer *lexer)
@@ -626,6 +602,10 @@ cp_lexer_purge_token (cp_lexer *lexer)
   tok->location = UNKNOWN_LOCATION;
   tok->value = NULL_TREE;
   tok->keyword = RID_MAX;
+
+  do
+    ++lexer->next_token;
+  while (lexer->next_token->type == CPP_PURGED);
 }
 
 /* Permanently remove all tokens after TOK, up to, but not
@@ -661,7 +641,6 @@ cp_lexer_handle_pragma (cp_lexer *lexer)
   s.len = TREE_STRING_LENGTH (token->value);
   s.text = (const unsigned char *) TREE_STRING_POINTER (token->value);
 
-  cp_lexer_set_source_position_from_token (lexer, token);
   cpp_handle_deferred_pragma (parse_in, &s);
 
   /* Clearing token->value here means that we will get an ICE if we
@@ -1836,16 +1815,21 @@ cp_parser_is_keyword (cp_token* token, enum rid keyword)
   return token->keyword == keyword;
 }
 
-/* Issue the indicated error MESSAGE.  */
+/* If not parsing tentatively, issue a diagnostic of the form
+      FILE:LINE: MESSAGE before TOKEN
+   where TOKEN is the next token in the input stream.  MESSAGE
+   (specified by the caller) is usually of the form "expected
+   OTHER-TOKEN".  */
 
 static void
 cp_parser_error (cp_parser* parser, const char* message)
 {
-  /* Output the MESSAGE -- unless we're parsing tentatively.  */
   if (!cp_parser_simulate_error (parser))
     {
-      cp_token *token;
-      token = cp_lexer_peek_token (parser->lexer);
+      cp_token *token = cp_lexer_peek_token (parser->lexer);
+      /* This diagnostic makes more sense if it is tagged to the line
+        of the token we just peeked at.  */
+      cp_lexer_set_source_position_from_token (token);
       c_parse_error (message,
                     /* Because c_parser_error does not understand
                        CPP_KEYWORD, keywords are treated like
@@ -2453,6 +2437,36 @@ cp_parser_new (void)
   return parser;
 }
 
+/* Create a cp_lexer structure which will emit the tokens in CACHE
+   and push it onto the parser's lexer stack.  This is used for delayed
+   parsing of in-class method bodies and default arguments, and should
+   not be confused with tentative parsing.  */
+static void
+cp_parser_push_lexer_for_tokens (cp_parser *parser, cp_token_cache *cache)
+{
+  cp_lexer *lexer = cp_lexer_new_from_tokens (cache);
+  lexer->next = parser->lexer;
+  parser->lexer = lexer;
+
+  /* Move the current source position to that of the first token in the
+     new lexer.  */
+  cp_lexer_set_source_position_from_token (lexer->next_token);
+}
+
+/* Pop the top lexer off the parser stack.  This is never used for the
+   "main" lexer, only for those pushed by cp_parser_push_lexer_for_tokens.  */
+static void
+cp_parser_pop_lexer (cp_parser *parser)
+{
+  cp_lexer *lexer = parser->lexer;
+  parser->lexer = lexer->next;
+  cp_lexer_destroy (lexer);
+
+  /* Put the current source position back where it was before this
+     lexer was pushed.  */
+  cp_lexer_set_source_position_from_token (parser->lexer->next_token);
+}
+
 /* Lexical conventions [gram.lex]  */
 
 /* Parse an identifier.  Returns an IDENTIFIER_NODE representing the
@@ -2502,14 +2516,16 @@ cp_parser_string_literal (cp_parser *parser, bool translate, bool wide_ok)
 
   /* Try to avoid the overhead of creating and destroying an obstack
      for the common case of just one string.  */
-  if (!cp_parser_is_string_literal (cp_lexer_peek_nth_token (parser->lexer, 2)))
+  if (!cp_parser_is_string_literal
+      (cp_lexer_peek_nth_token (parser->lexer, 2)))
     {
+      cp_lexer_consume_token (parser->lexer);
+
       str.text = (const unsigned char *)TREE_STRING_POINTER (tok->value);
       str.len = TREE_STRING_LENGTH (tok->value);
       count = 1;
       if (tok->type == CPP_WSTRING)
        wide = true;
-      cp_lexer_consume_token (parser->lexer);
 
       strs = &str;
     }
@@ -2520,6 +2536,7 @@ cp_parser_string_literal (cp_parser *parser, bool translate, bool wide_ok)
 
       do
        {
+         cp_lexer_consume_token (parser->lexer);
          count++;
          str.text = (unsigned char *)TREE_STRING_POINTER (tok->value);
          str.len = TREE_STRING_LENGTH (tok->value);
@@ -2528,11 +2545,7 @@ cp_parser_string_literal (cp_parser *parser, bool translate, bool wide_ok)
 
          obstack_grow (&str_ob, &str, sizeof (cpp_string));
 
-         /* We do it this way so that, if we have to issue semantic
-            errors on this string literal, the source position will
-            be that of the first token of the string.  */
-         tok = cp_lexer_peek_nth_token (parser->lexer, 2);
-         cp_lexer_consume_token (parser->lexer);
+         tok = cp_lexer_peek_token (parser->lexer);
        }
       while (cp_parser_is_string_literal (tok));
 
@@ -6610,9 +6623,9 @@ cp_parser_declaration_seq_opt (cp_parser* parser)
        {
          /* A declaration consisting of a single semicolon is
             invalid.  Allow it unless we're being pedantic.  */
-         if (pedantic && !in_system_header)
-           pedwarn ("extra `;'");
          cp_lexer_consume_token (parser->lexer);
+         if (pedantic && !in_system_header)
+           pedwarn ("extra %<;%>");
          continue;
        }
 
@@ -8344,7 +8357,7 @@ cp_parser_template_id (cp_parser *parser,
   /* If we find the sequence `[:' after a template-name, it's probably
      a digraph-typo for `< ::'. Substitute the tokens and check if we can
      parse correctly the argument list.  */
-  next_token = cp_lexer_peek_nth_token (parser->lexer, 1);
+  next_token = cp_lexer_peek_token (parser->lexer);
   next_token_2 = cp_lexer_peek_nth_token (parser->lexer, 2);
   if (next_token->type == CPP_OPEN_SQUARE
       && next_token->flags & DIGRAPH
@@ -9808,14 +9821,17 @@ cp_parser_enum_specifier (cp_parser* parser)
   else
     identifier = make_anon_name ();
 
-  cp_lexer_consume_token (parser->lexer);
-
   /* Issue an error message if type-definitions are forbidden here.  */
   cp_parser_check_type_definition (parser);
 
-  /* Create the new type.  */
+  /* Create the new type.  We do this before consuming the opening brace
+     so the enum will be recorded as being on the line of its tag (or the
+     'enum' keyword, if there is no tag).  */
   type = start_enum (identifier);
 
+  /* Consume the opening brace.  */
+  cp_lexer_consume_token (parser->lexer);
+
   /* If the next token is not '}', then there are some enumerators.  */
   if (cp_lexer_next_token_is_not (parser->lexer, CPP_CLOSE_BRACE))
     cp_parser_enumerator_list (parser, type);
@@ -12880,8 +12896,9 @@ cp_parser_member_declaration (cp_parser* parser)
         name of the class.  */
       if (!decl_specifiers.any_specifiers_p)
        {
-         if (pedantic)
-           pedwarn ("extra semicolon");
+         cp_token *token = cp_lexer_peek_token (parser->lexer);
+         if (pedantic && !token->in_system_header)
+           pedwarn ("%Hextra %<;%>", &token->location);
        }
       else
        {
@@ -14979,25 +14996,37 @@ cp_parser_enclosed_template_argument_list (cp_parser* parser)
     {
       if (!saved_greater_than_is_operator_p)
        {
-         /* If we're in a nested template argument list, the '>>' has to be
-           a typo for '> >'. We emit the error message, but we continue
-           parsing and we push a '>' as next token, so that the argument
-           list will be parsed correctly..  */
-         cp_token* token;
-         error ("`>>' should be `> >' within a nested template argument list");
-         token = cp_lexer_peek_token (parser->lexer);
+         /* If we're in a nested template argument list, the '>>' has
+           to be a typo for '> >'. We emit the error message, but we
+           continue parsing and we push a '>' as next token, so that
+           the argument list will be parsed correctly.  Note that the
+           global source location is still on the token before the
+           '>>', so we need to say explicitly where we want it.  */
+         cp_token *token = cp_lexer_peek_token (parser->lexer);
+         error ("%H%<>>%> should be %<> >%> "
+                "within a nested template argument list",
+                &token->location);
+
+         /* ??? Proper recovery should terminate two levels of
+            template argument list here.  */
          token->type = CPP_GREATER;
        }
       else
        {
-         /* If this is not a nested template argument list, the '>>' is
-           a typo for '>'. Emit an error message and continue.  */
-         error ("spurious `>>', use `>' to terminate a template argument list");
+         /* If this is not a nested template argument list, the '>>'
+           is a typo for '>'. Emit an error message and continue.
+           Same deal about the token location, but here we can get it
+           right by consuming the '>>' before issuing the diagnostic.  */
          cp_lexer_consume_token (parser->lexer);
+         error ("spurious %<>>%>, use %<>%> to terminate "
+                "a template argument list");
        }
     }
-  else if (!cp_parser_require (parser, CPP_GREATER, "`>'"))
-    error ("missing `>' to terminate the template argument list");
+  else if (!cp_lexer_next_token_is (parser->lexer, CPP_GREATER))
+    error ("missing %<>%> to terminate the template argument list");
+  else
+    /* It's what we want, a '>'; consume it.  */
+    cp_lexer_consume_token (parser->lexer);
   /* The `>' token might be a greater-than operator again now.  */
   parser->greater_than_is_operator_p
     = saved_greater_than_is_operator_p;
@@ -15016,8 +15045,6 @@ cp_parser_enclosed_template_argument_list (cp_parser* parser)
 static void
 cp_parser_late_parsing_for_member (cp_parser* parser, tree member_function)
 {
-  cp_lexer *saved_lexer;
-
   /* If this member is a template, get the underlying
      FUNCTION_DECL.  */
   if (DECL_FUNCTION_TEMPLATE_P (member_function))
@@ -15054,15 +15081,8 @@ cp_parser_late_parsing_for_member (cp_parser* parser, tree member_function)
       if (function_scope)
        push_function_context_to (function_scope);
 
-      /* Save away the current lexer.  */
-      saved_lexer = parser->lexer;
-      /* Make a new lexer to feed us the tokens saved for this function.  */
-      parser->lexer = cp_lexer_new_from_tokens (tokens);
-      parser->lexer->next = saved_lexer;
-
-      /* Set the current source position to be the location of the first
-        token in the saved inline body.  */
-      cp_lexer_peek_token (parser->lexer);
+      /* Push the body of the function onto the lexer stack.  */
+      cp_parser_push_lexer_for_tokens (parser, tokens);
 
       /* Let the front end know that we going to be defining this
         function.  */
@@ -15076,8 +15096,7 @@ cp_parser_late_parsing_for_member (cp_parser* parser, tree member_function)
       /* Leave the scope of the containing function.  */
       if (function_scope)
        pop_function_context_from (function_scope);
-      /* Restore the lexer.  */
-      parser->lexer = saved_lexer;
+      cp_parser_pop_lexer (parser);
     }
 
   /* Remove any template parameters from the symbol table.  */
@@ -15117,10 +15136,8 @@ cp_parser_save_default_args (cp_parser* parser, tree decl)
 static void
 cp_parser_late_parsing_default_args (cp_parser *parser, tree fn)
 {
-  cp_lexer *saved_lexer;
-  cp_token_cache *tokens;
   bool saved_local_variables_forbidden_p;
-  tree parameters;
+  tree parm;
 
   /* While we're parsing the default args, we might (due to the
      statement expression extension) encounter more classes.  We want
@@ -15129,30 +15146,28 @@ cp_parser_late_parsing_default_args (cp_parser *parser, tree fn)
   parser->unparsed_functions_queues
     = tree_cons (NULL_TREE, NULL_TREE, parser->unparsed_functions_queues);
 
-  for (parameters = TYPE_ARG_TYPES (TREE_TYPE (fn));
-       parameters;
-       parameters = TREE_CHAIN (parameters))
+  /* Local variable names (and the `this' keyword) may not appear
+     in a default argument.  */
+  saved_local_variables_forbidden_p = parser->local_variables_forbidden_p;
+  parser->local_variables_forbidden_p = true;
+
+  for (parm = TYPE_ARG_TYPES (TREE_TYPE (fn));
+       parm;
+       parm = TREE_CHAIN (parm))
     {
-      if (!TREE_PURPOSE (parameters)
-         || TREE_CODE (TREE_PURPOSE (parameters)) != DEFAULT_ARG)
-       continue;
+      cp_token_cache *tokens;
 
-       /* Save away the current lexer.  */
-      saved_lexer = parser->lexer;
-       /* Create a new one, using the tokens we have saved.  */
-      tokens =  DEFARG_TOKENS (TREE_PURPOSE (parameters));
-      parser->lexer = cp_lexer_new_from_tokens (tokens);
+      if (!TREE_PURPOSE (parm)
+         || TREE_CODE (TREE_PURPOSE (parm)) != DEFAULT_ARG)
+       continue;
 
-       /* Set the current source position to be the location of the
-         first token in the default argument.  */
-      cp_lexer_peek_token (parser->lexer);
+       /* Push the saved tokens for the default argument onto the parser's
+         lexer stack.  */
+      tokens = DEFARG_TOKENS (TREE_PURPOSE (parm));
+      cp_parser_push_lexer_for_tokens (parser, tokens);
 
-       /* Local variable names (and the `this' keyword) may not appear
-         in a default argument.  */
-      saved_local_variables_forbidden_p = parser->local_variables_forbidden_p;
-      parser->local_variables_forbidden_p = true;
-       /* Parse the assignment-expression.  */
-      TREE_PURPOSE (parameters) = cp_parser_assignment_expression (parser);
+      /* Parse the assignment-expression.  */
+      TREE_PURPOSE (parm) = cp_parser_assignment_expression (parser);
 
       /* If the token stream has not been completely used up, then
         there was extra junk after the end of the default
@@ -15160,11 +15175,13 @@ cp_parser_late_parsing_default_args (cp_parser *parser, tree fn)
       if (!cp_lexer_next_token_is (parser->lexer, CPP_EOF))
        cp_parser_error (parser, "expected `,'");
 
-       /* Restore saved state.  */
-      parser->lexer = saved_lexer;
-      parser->local_variables_forbidden_p = saved_local_variables_forbidden_p;
+      /* Revert to the main lexer.  */
+      cp_parser_pop_lexer (parser);
     }
 
+  /* Restore the state of local_variables_forbidden_p.  */
+  parser->local_variables_forbidden_p = saved_local_variables_forbidden_p;
+
   /* Restore the queue.  */
   parser->unparsed_functions_queues
     = TREE_CHAIN (parser->unparsed_functions_queues);
index dd233c1..b6f1ca1 100644 (file)
@@ -1,3 +1,73 @@
+2004-09-23  Zack Weinberg  <zack@codesourcery.com>
+
+       * g++.dg/ext/complit1.C
+       * g++.dg/other/error2.C
+       * g++.dg/other/nontype-1.C
+       * g++.dg/parse/crash11.C
+       * g++.dg/parse/crash12.C
+       * g++.dg/parse/error15.C
+       * g++.dg/parse/error4.C
+       * g++.dg/parse/tmpl-outside1.C
+       * g++.dg/parse/too-many-tmpl-args1.C
+       * g++.dg/template/dependent-expr3.C
+       * g++.dg/template/error10.C
+       * g++.dg/template/instantiate1.C
+       * g++.dg/template/vtable2.C
+       * g++.dg/warn/Wshadow-1.C
+       * g++.dg/warn/weak1.C
+       * g++.old-deja/g++.brendan/crash16.C
+       * g++.old-deja/g++.brendan/crash18.C
+       * g++.old-deja/g++.brendan/crash48.C
+       * g++.old-deja/g++.brendan/crash49.C
+       * g++.old-deja/g++.brendan/crash55.C
+       * g++.old-deja/g++.brendan/crash56.C
+       * g++.old-deja/g++.brendan/crash8.C
+       * g++.old-deja/g++.brendan/enum11.C
+       * g++.old-deja/g++.brendan/enum8.C
+       * g++.old-deja/g++.brendan/enum9.C
+       * g++.old-deja/g++.brendan/friend3.C
+       * g++.old-deja/g++.brendan/misc14.C
+       * g++.old-deja/g++.bugs/900402_02.C
+       * g++.old-deja/g++.bugs/900404_03.C
+       * g++.old-deja/g++.bugs/900404_04.C
+       * g++.old-deja/g++.bugs/900428_03.C
+       * g++.old-deja/g++.jason/crash4.C
+       * g++.old-deja/g++.jason/overload21.C
+       * g++.old-deja/g++.jason/redecl1.C
+       * g++.old-deja/g++.jason/report.C
+       * g++.old-deja/g++.jason/rfg10.C
+       * g++.old-deja/g++.jason/template30.C
+       * g++.old-deja/g++.law/arm12.C
+       * g++.old-deja/g++.law/ctors5.C
+       * g++.old-deja/g++.law/cvt20.C
+       * g++.old-deja/g++.law/init10.C
+       * g++.old-deja/g++.law/init8.C
+       * g++.old-deja/g++.law/visibility17.C
+       * g++.old-deja/g++.law/visibility7.C
+       * g++.old-deja/g++.mike/net8.C
+       * g++.old-deja/g++.mike/p646.C
+       * g++.old-deja/g++.mike/p700.C
+       * g++.old-deja/g++.mike/p701.C
+       * g++.old-deja/g++.mike/p811.C
+       * g++.old-deja/g++.ns/template13.C
+       * g++.old-deja/g++.other/array3.C
+       * g++.old-deja/g++.other/crash25.C
+       * g++.old-deja/g++.other/dtor3.C
+       * g++.old-deja/g++.other/dtor4.C
+       * g++.old-deja/g++.other/main1.C
+       * g++.old-deja/g++.other/warn7.C
+       * g++.old-deja/g++.pt/crash11.C
+       * g++.old-deja/g++.pt/crash36.C
+       * g++.old-deja/g++.pt/spec22.C
+       * g++.old-deja/g++.pt/spec9.C
+       * g++.old-deja/g++.pt/ttp52.C
+       * g++.old-deja/g++.robertl/eb103.C
+       * g++.old-deja/g++.robertl/eb121.C
+       * g++.old-deja/g++.robertl/eb22.C
+       * g++.old-deja/g++.robertl/eb8.C:
+       Update locations and/or regexps of dg-error markers.
+       Remove markers for some bogus messages that are no longer issued.
+
 2004-09-23  Jakub Jelinek  <jakub@redhat.com>
 
        * gcc.c-torture/execute/builtins/strcpy-2.c: New test.
 
 2004-09-23  Dorit Naishlos <dorit@il.ibm.com>
 
-        * gcc.dg/vect/vect-27.c: Now vectorized on altivec.
-        * gcc.dg/vect/vect-29.c: Now vectorized on altivec.
-        * gcc.dg/vect/vect-48.c: Now vectorized on altivec.
-        * gcc.dg/vect/vect-56.c: Now vectorized on altivec.
-        * gcc.dg/vect/vect-72.c: New test for altivec and sse2.
-        * gcc.dg/vect/vect-77.c: Now vectorized on altivec.
-
-        * gcc.dg/vect/vect-27a.c: New test for altivec and mmx.
-        * gcc.dg/vect/vect-29a.c: New test for altivec and mmx.
-        * gcc.dg/vect/vect-48a.c: New test for altivec and mmx.
-        * gcc.dg/vect/vect-56a.c: New test for altivec and mmx.
-        * gcc.dg/vect/vect-72a.c: New test for altivec and mmx.
-        * gcc.dg/vect/vect-77a.c: New test for altivec and mmx.
-
-        * gcc.dg/vect/vect-13.c: Change to run test instead of compile.
-
-        * gcc.dg/vect/vect-44.c: Check additional cases.
-        * gcc.dg/vect/vect-48.c: Check additional cases.
-
-        * gcc.dg/vect/vect-26.c: Use sse2 instead of sse.
-        * gcc.dg/vect/vect-27.c: Use sse2 instead of sse.
-        * gcc.dg/vect/vect-28.c: Use sse2 instead of sse.
-        * gcc.dg/vect/vect-29.c: Use sse2 instead of sse.
-        * gcc.dg/vect/vect-4?.c: Use sse2 instead of sse.
-        * gcc.dg/vect/vect-75.c: Use sse2 instead of sse.
-        * gcc.dg/vect/vect-76.c: Use sse2 instead of sse.
-        * gcc.dg/vect/vect-77.c: Use sse2 instead of sse.
-        * gcc.dg/vect/vect-78.c: Use sse2 instead of sse.
-
-        * gcc.dg/vect/vect-5?.c: Use sse2 instead of sse. Add return 0.
-        * gcc.dg/vect/vect-60.c: Use sse2 instead of sse. Add return 0.
-        * gcc.dg/vect/vect-61.c: Use sse2 instead of sse. Add return 0.
+       * gcc.dg/vect/vect-27.c: Now vectorized on altivec.
+       * gcc.dg/vect/vect-29.c: Now vectorized on altivec.
+       * gcc.dg/vect/vect-48.c: Now vectorized on altivec.
+       * gcc.dg/vect/vect-56.c: Now vectorized on altivec.
+       * gcc.dg/vect/vect-72.c: New test for altivec and sse2.
+       * gcc.dg/vect/vect-77.c: Now vectorized on altivec.
+
+       * gcc.dg/vect/vect-27a.c: New test for altivec and mmx.
+       * gcc.dg/vect/vect-29a.c: New test for altivec and mmx.
+       * gcc.dg/vect/vect-48a.c: New test for altivec and mmx.
+       * gcc.dg/vect/vect-56a.c: New test for altivec and mmx.
+       * gcc.dg/vect/vect-72a.c: New test for altivec and mmx.
+       * gcc.dg/vect/vect-77a.c: New test for altivec and mmx.
+
+       * gcc.dg/vect/vect-13.c: Change to run test instead of compile.
+
+       * gcc.dg/vect/vect-44.c: Check additional cases.
+       * gcc.dg/vect/vect-48.c: Check additional cases.
+
+       * gcc.dg/vect/vect-26.c: Use sse2 instead of sse.
+       * gcc.dg/vect/vect-27.c: Use sse2 instead of sse.
+       * gcc.dg/vect/vect-28.c: Use sse2 instead of sse.
+       * gcc.dg/vect/vect-29.c: Use sse2 instead of sse.
+       * gcc.dg/vect/vect-4?.c: Use sse2 instead of sse.
+       * gcc.dg/vect/vect-75.c: Use sse2 instead of sse.
+       * gcc.dg/vect/vect-76.c: Use sse2 instead of sse.
+       * gcc.dg/vect/vect-77.c: Use sse2 instead of sse.
+       * gcc.dg/vect/vect-78.c: Use sse2 instead of sse.
+
+       * gcc.dg/vect/vect-5?.c: Use sse2 instead of sse. Add return 0.
+       * gcc.dg/vect/vect-60.c: Use sse2 instead of sse. Add return 0.
+       * gcc.dg/vect/vect-61.c: Use sse2 instead of sse. Add return 0.
 
 2004-09-23  Zdenek Dvorak  <rakdver@atrey.karlin.mff.cuni.cz>
 
 
        PR c++/15049
        * g++.dg/other/anon3.C: New.
-       
+
 2004-09-21  Roger Sayle  <roger@eyesopen.com>
 
        PR c++/7503
 
 2004-09-20  Andrew Pinski  <pinskia@physics.uc.edu>
 
-       PR tree-opt/17558 
+       PR tree-opt/17558
        * gcc.c-torture/compile/pr17558.c: New test.
 
 2004-09-20  Richard Sandiford  <rsandifo@redhat.com>
 2004-09-20  Tobias Schlueter  <tobias.schlueter@physik.uni-muenchen.de>
 
        PR fortran/15750
-       * gfortran.fortran-torture/execute/iolength_2.f90: New test.    
+       * gfortran.fortran-torture/execute/iolength_2.f90: New test.
 
 2004-09-20  Ira Rosen  <irar@il.ibm.com>
 
 2004-09-17  Devang Patel  <dpatel@apple.com>
 
        * gcc.dg/20040813-1.c: New test.
-       
+
 2004-09-17  Diego Novillo  <dnovillo@redhat.com>
 
        PR tree-optimization/17273
 
        PR c++/16002
        * g++.dg/template/error18.C: New test.
-       
+
        PR c++/16029
        * g++.dg/warn/Wunused-8.C: New test.
 
        * gcc.dg/declspec-12.c: New test.
 
 2004-09-14  Bud Davis  <bdavis9659@comcast.net>
-       
+
        * gfortran.dg/pr17090.f90: Add directives to test.
 
 2004-09-14  Zdenek Dvorak  <rakdver@atrey.karlin.mff.cuni.cz>
 
        PR c++/16162
        * g++.dg/template/decl2.C: New test.
-       
+
 2004-09-13  Bud Davis  <bdavis9659@comcast.net>
 
        PR fortran/17090
 
        PR c++/16716
        * g++.dg/parse/crash17.C: New test.
-       
+
        PR c++/17327
        * g++.dg/template/enum3.C: New test.
 
index bcca8ac..ab2b038 100644 (file)
@@ -11,6 +11,6 @@ public:
 };
 
 Foo::Foo(int v0, int v1)
-  : val_((int[]) {v0, v1})
-{                              // { dg-error "" "" }
+  : val_((int[]) {v0, v1})  // { dg-error "" "" }
+{
 }
index ea6c520..36089e4 100644 (file)
@@ -10,5 +10,5 @@ namespace N
   class B { friend void operator>>(int, class B); };
   class N { friend void operator>>(int,class N); };
 } 
-void N::operator>>(int, N::B)  // { dg-error "N::N::B" }
-{ } // { dg-error "" "" }
+void N::operator>>(int, N::B)  // { dg-error "N::N::B|N::operator>>" }
+{ }
index 5a1fcd9..11bbfb8 100644 (file)
@@ -2,6 +2,6 @@ template <class Op>
 bool asfun(Op f,
            Op::first_argument_type a, // { dg-error "not a type" }
            Op::second_argument_type b) // { dg-error "not a type" }
-{                               // { dg-error "no type" }
+{
    return Op(a, b);
 }
index e6db364..4fa7ff2 100644 (file)
@@ -19,8 +19,8 @@ struct B
   template <typename T>
   struct Template
   {
-    typedef typename A<A<TP>::Template>
-      ::template Template<T>::Type Type; // { dg-error "mismatch|class template|unqualified-id" }
+    typedef typename A<A<TP>::Template>  // { dg-error "mismatch|class template" }
+      ::template Template<T>::Type Type; // { dg-error "unqualified-id" }
   };
 };
 template <typename T>
index cf947b2..a936e8c 100644 (file)
@@ -14,8 +14,8 @@ public:
 };
 
 template <class _Tp>
-inline counted_ptr<_Tp>::counted_ptr(class auto_ptr& __a) // { dg-error "required" }
-{                                              // { dg-error "no type|not match|template" }
+inline counted_ptr<_Tp>::counted_ptr(class auto_ptr& __a) // { dg-error "required|not match|template" }
+{
 }
 
 template <class _Tp>
index fd70382..e49e211 100644 (file)
@@ -35,5 +35,3 @@ struct C
 };
 
 // { dg-bogus "" "bogus excess errors in declaration" { xfail *-*-* } 16 }
-// { dg-bogus "" "bogus excess errors in declaration" { xfail *-*-* } 24 }
-// { dg-bogus "" "bogus excess errors in declaration" { xfail *-*-* } 34 }
index 511209d..aa1bfad 100644 (file)
@@ -3,5 +3,5 @@
 struct X { 
   virtual void f(int, 
                 itn,        // { dg-error "declared" }
-                int);       // { dg-error "" }
+                int);
 }; 
index 07c89e2..4b8bb72 100644 (file)
@@ -8,3 +8,4 @@ struct X
 };
 
 typedef X::template Y<0> y; // { dg-error "template" }
+// { dg-bogus "with no type" "" { xfail *-*-* } 10 }
index 30c2952..4d98e75 100644 (file)
@@ -2,8 +2,8 @@
 // Origin: Wolfgang Bangerth <bangerth@ticam.utexas.edu>
 // { dg-do compile }
 
-template <typename T> class A
-{                                                             // { dg-error "" }
+template <typename T> class A                                 // { dg-error "" }
+{
     struct B;
     template <typename U> friend typename A<U,void>::B foo(); // { dg-error "" }
 };
index 2e8b805..97fddbd 100644 (file)
@@ -10,5 +10,5 @@ template <typename K> struct Y : K {
 
 template <class T> struct Z {
   S< (bool)(&static_cast<Y<T> *>(0)->x == 0) > // { dg-error "" }
-  s; // { dg-error "" }
+  s;
 };
index a25c4bb..ccb577d 100644 (file)
@@ -9,8 +9,8 @@
 template <class T>
 class A {};
 
-A<A<int>> blah;  // { dg-error "should be `> >' within" }
-A<int>> blah2; // { dg-error "spurious `>>'" }
+A<A<int>> blah;  // { dg-error "should be '> >' within" }
+A<int>> blah2; // { dg-error "spurious '>>'" }
 
 
 /*
@@ -66,5 +66,5 @@ struct K {};
 
 void KFunc(void);
 
-A<K<&KFunc>> k1;  // { dg-error "should be `> >' within" }
-K<&KFunc>> k2; // { dg-error "spurious `>>'" }
+A<K<&KFunc>> k1;  // { dg-error "should be '> >' within" }
+K<&KFunc>> k2; // { dg-error "spurious '>>'" }
index e4e7bc9..311344d 100644 (file)
@@ -16,6 +16,6 @@ template <class T> struct Z { // { dg-error "declaration" }
   Y<Z<T> > y;                  // { dg-error "instantiated" }
 };
 
-struct ZZ : Z<int>
-{                              // { dg-error "instantiated" }
+struct ZZ : Z<int>             // { dg-error "instantiated" }
+{
 };
index 9f2bf0b..3bcc1ac 100644 (file)
@@ -11,8 +11,8 @@
 template <class T> struct inner {};
 
 template <class T> struct parent {
-  virtual void f()
-    { parent<inner<T> > p; };          // { dg-error "instantiation depth" }
+  virtual void f()                     // { dg-error "instantiation depth" }
+    { parent<inner<T> > p; };
 };
 
 template struct parent<int>;
index 2ea076e..1647a01 100644 (file)
@@ -21,8 +21,8 @@ struct status                 // { dg-bogus "shadowed declaration" }
 int decl1;                     // { dg-warning "shadowed declaration" }
 int decl2;                     // { dg-warning "shadowed declaration" }
 void foo (struct status &status,// { dg-bogus "shadows a global decl" }
-         double decl1)
-{                              // { dg-warning "shadows a global decl" }
+         double decl1)         // { dg-warning "shadows a global decl" }
+{
 }
 
 void foo1 (int d)
index dbc0dff..84d08fb 100644 (file)
@@ -1,6 +1,5 @@
 // { dg-do run }
-// { dg-do compile { target *-*-coff i?86-pc-cygwin } }
-// { dg-warning "weak declaration" "COFF format does not support weak" { target *-*-coff i?86-pc-cygwin powerpc-ibm-aix4* rs6000-ibm-aix4* } 5 }
+// { dg-require-weak "" }
 
 extern void foo (void) __attribute__ ((weak));
 
index 1c81d19..8b91e6b 100644 (file)
@@ -1,12 +1,12 @@
-// { dg-do assemble { xfail *-*-* } }
+// { dg-do compile }
 // GROUPS passed old-abort
 class Graph {
 public:
       unsigned         char N;
-      Graph(void) {}; // { dg-error "" } previously defined here
+      Graph(void) {}; // { dg-error "previously defined here" }
 }
 
-Graph::Graph(void)
-{    N = 10;// { dg-error "" }  return type.*
+Graph::Graph(void)    // { dg-error "return type|redefinition" }
+{    N = 10;
 }
 
index 6691081..119ba46 100644 (file)
@@ -1,4 +1,4 @@
-// { dg-do assemble  }
+// { dg-do compile }
 // GROUPS passed old-abort
 typedef int element;
 class Pix {
@@ -7,11 +7,12 @@ public:
     Pix(const Pix&);
 
     // Friend functions so that v == x works as does x == v works
-    friend int operator==(void *v, const Pix& x)
-        { return v == index; }// { dg-error "" } .*
-    friend int operator==(void *v, const Pix& x)
-        { return v != index; }// { dg-error "" } .*
+    friend int operator==(void *v, const Pix& x) // { dg-error "previously" }
+    { return v == index; }  // { dg-error "from this location" }
+    // ??? should be operator!=
+    friend int operator==(void *v, const Pix& x) // { dg-error "redefinition" }
+    { return v != index; }
 private:
 //    friend class List<T>;
-    element *index; // { dg-error "" } invalid use of member
+    element *index; // { dg-error "invalid use of non-static data member" }
 };
index b3972bd..bdb522a 100644 (file)
@@ -1,22 +1,22 @@
-// { dg-do assemble  }
+// { dg-do compile }
 // GROUPS passed old-abort
-class internal { // { dg-error "" } candidates are
+class internal { // { dg-error "internal::internal" }
        int field;
        int anotherfield;
 };
 
-class bug { // { dg-error "" } several errors
+class bug { // { dg-error "bug::bug" }
        internal* numbers;
        bug(int size);
 };
 
-bug::bug(int size)
-{ // { dg-error "" } candidates
-       numbers = new internal(size * size);// { dg-error "" }  no match.*
+bug::bug(int size) // { dg-error "bug::bug" }
+{
+  numbers = new internal(size * size);// { dg-error "no match" }
 }
 
 int
 main()
 {
-       bug test;// { dg-error "" }  no match
+  bug test; // { dg-error "no match" }
 }
index 95b57dc..e0664da 100644 (file)
@@ -5,8 +5,8 @@
 const int keys = 10;
 const int key[keys] = {6, key[1], 2, keys, 1, 7, 6, key[2], key[8]};
 
-void main()
-{ // { dg-error "" } return type for main
+void main()  // { dg-error "must return .int" }
+{
         for(int i = 0; i < keys;) std::cout << key[i++] << " ";
         std::endl(std::cout);
 }
index 29533bc..cd952af 100644 (file)
@@ -1,10 +1,10 @@
-// { dg-do assemble  }
+// { dg-do compile }
 // GROUPS passed old-abort
-      extern f(int);// { dg-error "" }  ambiguates.*
+      extern int f(int); // { dg-error "ambiguates" }
 
-      int& f(int x)
-      {// { dg-error "" }  new declaration.*
-          int local;// { dg-error "" }  warning
+      int& f(int x)  // { dg-error "new declaration" }
+      {
+          int local; // { dg-error "reference to local" }
 
           local = x+2;
       
index 243a2b6..57c7c11 100644 (file)
@@ -20,16 +20,16 @@ public:
     class Vix {
     public:
        Vix();
-       friend int operator==(void *v, const Vix& x)
-           { return v == x.item; }// { dg-error "" } list of candidates
-       friend int operator==(const Vix& x, void *v)
-           { return v == x.item; }// { dg-error "" } candidate for call
+       friend int operator==(void *v, const Vix& x) // { dg-error "operator==" }
+           { return v == x.item; }
+       friend int operator==(const Vix& x, void *v) // { dg-error "operator==" }
+           { return v == x.item; }
        friend int operator!=(void *v, const Vix& x)
            { return v != x.item; }
        friend int operator!=(const Vix& x, void *v)
            { return v != x.item; }
-       friend int operator==(const Vix& x1, const Vix& x2)
-           { return x1.owner == x2.owner && x1.item == x2.item; }// { dg-error "" } candidate for call
+       friend int operator==(const Vix& x1, const Vix& x2) // { dg-error "operator==" }
+           { return x1.owner == x2.owner && x1.item == x2.item; }
        friend int operator!=(const Vix& x1, const Vix& x2)
            { return x1.owner != x2.owner || x1.item != x2.item; }
        bool first;              
@@ -343,8 +343,8 @@ operator>=(const SetLD<T>& a, const SetLD<T>& b)
 class String { };
 class IcaseString: public String { };
 template <> class SetLD< IcaseString >: public SetLD<    String  > {   public:  SetLD (): SetLD<    String  >() { };    SetLD (const ListD<   IcaseString  >& other): SetLD<    String  >()    { ListD<   IcaseString  >::Vix x;       for (other.first(x); 0 != x; other.next(x))     add(other(x)); };        SetLD (const  SetLD & other): SetLD<    String  >(other) { };  const    IcaseString  & operator()(const Vix& x) const  { return (   IcaseString  &) SetLD<    String  >::operator()(x); }      };      typedef SetLD<  String > SetLD_String_IcaseString_old_tmp99;    typedef SetLD< IcaseString > SetLD_String_IcaseString_new_tmp99;        
-inline int      operator== (const SetLD_String_IcaseString_new_tmp99& a,       const SetLD_String_IcaseString_new_tmp99& b)
-{// { dg-error "" } candidate for call
+inline int      operator== (const SetLD_String_IcaseString_new_tmp99& a,       const SetLD_String_IcaseString_new_tmp99& b) // { dg-error "operator==" }
+{
 const SetLD_String_IcaseString_old_tmp99& oa = a;
 const SetLD_String_IcaseString_old_tmp99& ob = b;
 return  operator== (oa, ob);   }       
index 06bde56..4872083 100644 (file)
@@ -1,12 +1,12 @@
-// { dg-do assemble  }
+// { dg-do compile }
 // GROUPS passed old-abort
 template<int a, int b>
-class Elvis
-{ // { dg-error "" } in template.*
+class Elvis // { dg-error "class Elvis" }
+{
 } ;
 
 template<int a>
-class Elvis<0>
-{ // { dg-error "" } incorrect number of parameters
+class Elvis<0> // { dg-error "wrong number of template arguments" }
+{
   int geta() { return a ; }
 } ;
index 233c387..009333a 100644 (file)
@@ -6,8 +6,8 @@ class X
     {
        oneMask = 0x0000FFFF,
        twoMask  = 0x000F0000,
-       thiMask = 0xFFF00000,
-    }; // { dg-error "" } comma
+       thiMask = 0xFFF00000, // { dg-error "comma at end" }
+    };
     unsigned int foo;
 
 public:
index e9e6907..ecf6fbf 100644 (file)
@@ -6,8 +6,8 @@ class foo1
    enum foo1_enum
    {
       ENUM1,
-      ENUM2,
-   }; // { dg-error "" } comma
+      ENUM2, // { dg-error "comma at end" }
+   };
 };
 
    
index 43420cf..88ecc73 100644 (file)
@@ -2,8 +2,8 @@
 // GROUPS passed enums
 enum fig {
     figgy,
-    pudding,
-}; // { dg-error "" } comma
+    pudding,  // { dg-error "comma at end" }
+};
 
 class X {
 public:
index 0df4498..ecd85b4 100644 (file)
@@ -5,8 +5,8 @@ class B {
    friend class A;
 
    enum {
-      bEnum = 1,
-   }; // { dg-error "" } comma
+      bEnum = 1, // { dg-error "comma at end" }
+   };
 
    int bArray[ bEnum ];
 
index d14d32b..09242a4 100644 (file)
@@ -3,10 +3,11 @@
 class X {
 public:
     enum e {
-       New,// { dg-error "" }  conflicts with other.*
-    }; // { dg-error "" } comma
+       New // { dg-error "conflicts with previous" }
+       ,   // { dg-error "comma at end" }
+    };
 
-    static int New(int);// { dg-error "" }  declaration.*
+    static int New(int); // { dg-error "declaration of" }
 };
 
 int main() {}
index e1740b1..d3cf5ad 100644 (file)
@@ -6,17 +6,17 @@
 
 // keywords: arrays, array bound, zero length
 
-typedef int array_type[0];             // { dg-error "" } gets warning only
+typedef int array_type[0];             // { dg-error "zero-size array" }
 
-int array_object_1[0];                 // { dg-error "" } gets warning only
+int array_object_1[0];                 // { dg-error "zero-size array" }
 
-void function_0 (int formal_array[0])
-{                                      // { dg-error "" } gets warning only
+void function_0 (int formal_array[0])  // { dg-error "zero-size array" }
+{
 }
 
 void function_2 ()
 {
-  int local_object_array_0[0];         // { dg-error "" } gets warning only
+  int local_object_array_0[0];         // { dg-error "zero-size array" }
 }
 
 int main () { return 0; }
index be258fc..726f9ef 100644 (file)
@@ -8,13 +8,13 @@
 
 // keywords: overloading, ambiguity, resolution
 
-void function0 (int i, char c)
-{                              // { dg-error "" } 
+void function0 (int i, char c) // { dg-error "function0" }
+{
   i = c;
 }
 
-void function0 (char c, int i)
-{                              // { dg-error "" } 
+void function0 (char c, int i)  // { dg-error "function0" }
+{
   i = c;
 }
 
@@ -22,7 +22,7 @@ char c;
 
 void test ()
 {
-  function0 (c,c);             // { dg-error "" } missed
+  function0 (c,c);             // { dg-error "ambiguous" }
 }
 
 int main () { return 0; }
index 09f5b2a..04ff669 100644 (file)
@@ -13,6 +13,6 @@
 
 int i;
 
-;                      // { dg-error "" } 
+;                      // { dg-error "extra ';'" } 
 
 int main () { return 0; }
index 722de9b..d0625c4 100644 (file)
@@ -18,15 +18,15 @@ public:
 };
 
 struct_0::struct_0 (int i) { }
-struct_0::struct_0 (int, int) { } // { dg-error "" } xref from below
+struct_0::struct_0 (int, int) { } // { dg-error "is private" }
 
 struct struct_1 : public struct_0 {
 
   struct_1 ();
 };
 
-struct_1::struct_1 () : struct_0 (8,9)
-{                              // { dg-error "" } 
+struct_1::struct_1 () : struct_0 (8,9) // { dg-error "within this context" }
+{
 }
 
 struct struct_2 {
@@ -35,11 +35,8 @@ struct struct_2 {
   struct_2 ();
 };
 
-// g++ catches the following error (but does so only at the line with the 
-// closing curly brace).
-
-struct_2::struct_2 () : struct_2_data_member (8,9)
-{                              // { dg-error "" } should be up one line
+struct_2::struct_2 () : struct_2_data_member (8,9) // { dg-error "within this context" }
+{
 }
 
 int main () { return 0; }
index 70f054b..00ba0cc 100644 (file)
@@ -16,8 +16,8 @@ public:
 };
 
 template <class T>
-const ccObjectInfo& cc_Array<T>::repInvariant(int) const
-{  return *this /* *this is required here */; } // { dg-error "" } redefined
+const ccObjectInfo& cc_Array<T>::repInvariant(int) const  // { dg-error "previously declared" }
+{  return *this /* *this is required here */; }
 
 template <class T>
 class ccArray :public ccObjectInfo
@@ -32,7 +32,7 @@ class ccObjArray : public ccArray<T>
 }; 
 
 template <class T>
-const ccObjectInfo& cc_Array<T>::repInvariant(int) const
-{  return 0; }                 // { dg-error "" } causes compiler segfault
+const ccObjectInfo& cc_Array<T>::repInvariant(int) const // { dg-error "redefinition" }
+{  return 0; }
 
 typedef ccObjArray< double>    ccROIRuns;       
index 52c3589..229be93 100644 (file)
@@ -1,13 +1,13 @@
 // { dg-do assemble  }
 struct X {
-  void f (int = 4, char = 'r');        // { dg-error "" } 
-  void g (int = 4, char = 'r');        // { dg-error "" } 
+  void f (int = 4, char = 'r');        // { dg-error "previous specification" } 
+  void g (int = 4, char = 'r');        // { dg-error "previous specification" } 
 };
 
 void
-X::f (int i = 4, char x = 'r')
-{ }                            // { dg-error "" } duplicate default args
+X::f (int i = 4, char x = 'r') // { dg-error "default argument" }
+{ }
 
 void
-X::g (int i = 9, char x = 's')
-{ }                            // { dg-error "" } duplicate default args
+X::g (int i = 9, char x = 's') // { dg-error "default argument" }
+{ }
index 0cc528a..6fda9d2 100644 (file)
@@ -3,11 +3,11 @@ class A
 {
 public:
     A (const A& ccref);
-    friend A const re (const A& v1); // { dg-error "" } 
+    friend A const re (const A& v1); // { dg-error "ambiguates" } 
 };
 
 A // const
-re (const A& ref)
-{                              // { dg-error "" } mismatched decls
+re (const A& ref) // { dg-error "new declaration" }
+{
     return A (ref);
 }
index 0149129..c1b9a57 100644 (file)
@@ -50,8 +50,8 @@ typedef int const * bart ();
 typedef bart const * const * bar2;
 typedef bart volatile * const * bar2v;
 
-bar2 baz (X::Y y)
-{                              // { dg-error "" } in this context
+bar2 baz (X::Y y)              // { dg-error "" } in this context
+{
   X::Y f;                      // { dg-error "" } in this context
   bar2 wa [5];
   wa[0] = baz(f);
index e53baf6..f6d5af3 100644 (file)
@@ -6,5 +6,6 @@
 enum COLOR
 {
     red,
-    green = ULONG_MAX, blue
-};                             // { dg-error "" } enum overflow
+    green = ULONG_MAX,
+    blue // { dg-error "overflow in enumeration" }
+};
index 4eca03d..370bb18 100644 (file)
@@ -3,8 +3,8 @@ template <class T, class U>
 int func(U, T);                        // { dg-error "" } ref below
 
 template <class T, class U>    
-int func(T, U)
-{                              // { dg-error "" } ref below
+int func(T, U)                 // { dg-error "" } ref below
+{
         return 2;
 }
 
index b098c22..c0332d3 100644 (file)
@@ -22,8 +22,8 @@ public:
   Y();
 };
 
-X::X()
-{// { dg-error "" } .*
+X::X() // { dg-error "is private" }
+{
   std::cout << "X::X()" << std::endl;
 }
 
@@ -32,8 +32,8 @@ void X::f()
   std::cout << "X::f()" << std::endl;
 }
 
-Y::Y()
-{// { dg-error "" }  within this
+Y::Y() // { dg-error "within this context" }
+{
   std::cout << "Y::Y()" << std::endl;
 }
 
index 7078013..d08805a 100644 (file)
@@ -5,7 +5,7 @@
 // Date: Tue, 1 Sep 92 10:38:44 EDT
 
 class X
-{ // { dg-error "" } candidate
+{ // { dg-error "X::X" } implicit constructor
   private:
     int x;
   public:
@@ -20,14 +20,14 @@ class Y
   public:
     Y();
 }
-X::X( int xi )
-{// { dg-error "" }  return.*
+X::X( int xi ) // { dg-error "return type|X::X" }
+{
     x = xi;
 }
 
 const X X::x0( 0 );
 
-Y::Y()
-{// { dg-error "" }  no mat
+Y::Y() // { dg-error "no match" }
+{
     xx = X::x0;
 }
index 9235fb5..5d699d7 100644 (file)
@@ -9,12 +9,12 @@
 
 // Compiles fine with Sun CC 2.1
 
-void f(char *& x)
-{// { dg-error "" } location of error
+void f(char *& x) // { dg-error "passing argument" }
+{
   x++;
 }
 
 int main()
 {
-  f ("foo");// { dg-error "" } init of non-const ref from char*
+  f ("foo"); // { dg-error "invalid initialization" }
 }
index 4298bb9..4d567fe 100644 (file)
@@ -20,7 +20,7 @@ public:
         b();
 };
 
-b::b() : three(this)
-{ // { dg-error "" } bad array initializer
+b::b() : three(this)  // { dg-error "bad array initializer" }
+{
 }
 
index 0ccf451..ba8dde2 100644 (file)
@@ -8,15 +8,15 @@
 
 
 const int ic = 1;
-void f(int& arg)
-{ // { dg-error "" } argument 1
+void f(int& arg)  // { dg-error "passing argument 1" }
+{
         if (arg) ;
 }
 const int& icr = ic;
 
 int main(void)
 {
-  f(icr);   // g++ does not give error here// { dg-error "" } .*
+  f(icr);   // { dg-error "invalid initialization" }
 
   return 0;
 }
index 0afb04b..67ef892 100644 (file)
@@ -31,24 +31,24 @@ private:
   int num_;
 };
 
-Base::Base()
-{ // { dg-error "" } private
+Base::Base() // { dg-error "is private" }
+{
   name_ = std::strcpy(new char[std::strlen(" ") + 1], " ");
 }
 
-Base::Base(char* str)
-{ // { dg-error "" } private
+Base::Base(char* str) // { dg-error "is private" }
+{
   if(str != NULL)
     name_ = std::strcpy(new char[std::strlen(str) + 1], str);
 }
 
-Derived::Derived(int n, char* str) : Base(str)
-{// { dg-error "" } .*
+Derived::Derived(int n, char* str) : Base(str) // { dg-error "within this context" }
+{
   num_ = n;
 }
 
-Derived::Derived(int n) : Base()
-{// { dg-error "" } .*
+Derived::Derived(int n) : Base() // { dg-error "within this context" }
+{
   num_ = n;
 }
 
index f271fbc..ed37f5f 100644 (file)
@@ -15,10 +15,10 @@ class A {
     {}
   virtual ~A()
     {}
-  virtual void Number(int c)
-    { number = c; } // { dg-error "" } private
-  virtual int Number()
-    { return number; } // { dg-error "" } private
+  virtual void Number(int c) // { dg-error "inaccessible" }
+    { number = c; }
+  virtual int Number() // { dg-error "inaccessible" }
+    { return number; }
 };
 
 class B : private A {
@@ -53,9 +53,9 @@ class C {
   // and they should not be able to do so
   //
   virtual void setBValue(int i) 
-    { if (bobject) bobject->Number(i); }// { dg-error "" } .*
+    { if (bobject) bobject->Number(i); } // { dg-error "this context|accessible base" }
   virtual int getBValue()
-    { if (bobject) { return bobject->Number(); } return 0; }// { dg-error "" } .*
+    { if (bobject) { return bobject->Number(); } return 0; } // { dg-error "this context|accessible base" }
 };
 
 
index 09dfe1a..09f9c30 100644 (file)
@@ -11,22 +11,22 @@ public:
   int bar;
 };
 
-void func(Base&);              // { dg-error "" } 
+void func(Base&);                      // { dg-error "passing argument 1" } 
 
 void func2(const Derived& d) {
-  func(d);                     // { dg-error "" } this is bad
+  func(d);                             // { dg-error "invalid initialization" }
 }
 
 void
-foo (int& a)
-{                              // { dg-error "" } 
+foo (int& a)                           // { dg-error "in passing argument 1" } 
+{
 }
 
 int main ()
 {
   int b;
   const int*const a = &b;
-  *a = 10;                             // { dg-error "" } it's const
-  foo (*a);                            // { dg-error "" } it's const
+  *a = 10;                             // { dg-error "read-only location" }
+  foo (*a);                            // { dg-error "invalid initialization" }
   return 0;
 }
index 6d5abcd..3fdcd41 100644 (file)
@@ -132,8 +132,8 @@ warn_foo_parm_returns_foo (foo f)
   f;
 }                              // { dg-warning "" } control reaches end
 
-main ()
-{                              // { dg-warning "" } no type
+main ()                               // { dg-warning "" } no type
+{
   int ii = return_1 ();
   if (ii != 1)
     abort_because ("wrong value returned");
index 5f52751..106a497 100644 (file)
@@ -223,8 +223,8 @@ inline  void  Int::operator >>=(const int b)
 { rep >>= b;  ; }
 
 
-inline  int& operator  = (int& a,  const Int &   b)
-{ a = b.Int::val(); return a;} // { dg-warning "" } 
+inline  int& operator  = (int& a,  const Int &   b)    // { dg-warning "" } 
+{ a = b.Int::val(); return a;}
 inline  int& operator += (int& a,  const Int &   b)
 { a += b.Int::val(); return a; }
 inline  int& operator -= (int& a,  const Int &   b)
@@ -562,8 +562,8 @@ inline  void  Char::operator >>=(const char b)
 { rep >>= b;  ; }
 
 
-inline  char& operator  = (char& a,  const Char &   b)
-{ a = b.Char::val(); return a;}        // { dg-warning "" } 
+inline  char& operator  = (char& a,  const Char &   b) // { dg-warning "" } 
+{ a = b.Char::val(); return a;}
 inline  char& operator += (char& a,  const Char &   b)
 { a += b.Char::val(); return a; }
 inline  char& operator -= (char& a,  const Char &   b)
index 2c23ddc..6a52591 100644 (file)
@@ -7,8 +7,8 @@ extern "C"
 }
 
 
-void Munge(int& x) 
-{                              // { dg-error "" } referenced below
+void Munge(int& x)     // { dg-error "passing argument 1" }
+{
    x = 2;
 }
 
@@ -24,7 +24,7 @@ class A
 void
 A::Safe() const 
 {
-   Munge(i);   // { dg-error "" } should not be able to modify a const object
+   Munge(i);           // { dg-error "invalid initialization" }
 }
 
 int main()
index ba6c629..7d15e9e 100644 (file)
@@ -512,25 +512,25 @@ class Y {
 public:
     Y() {}
     virtual const char *stringify() = 0;
-    virtual char *stringify2() const = 0; // { dg-error "" } 
+    virtual char *stringify2() const = 0; // { dg-error "overriding" } 
 };
 
 class X: public Y {
 public:
     X(): Y() {}
-    char *stringify();         // { dg-error "" } ok
-    const char *stringify2() const;  // { dg-error "" } ok
+    char *stringify();         // { dg-error "candidate" }
+    const char *stringify2() const;  // { dg-error "candidate|conflicting return type" }
 };
 
 char *
-X::stringify() const
-{ // { dg-error "" } ok
+X::stringify() const  // { dg-error "does not match" }
+{
     return "stringify";
 }
 
 const char *
-X::stringify2()
-{ // { dg-error "" } ok
+X::stringify2()   // { dg-error "does not match" }
+{
     return "stringify2";
 }
 
index 058d7b9..4655538 100644 (file)
@@ -1,23 +1,23 @@
-// { dg-do assemble { xfail *-*-* } }
+// { dg-do compile }
 // Templates defined outside must be declared inside
 namespace bar
 {
   // trick it to provide some prior declaration
   template<class T>
   void foo(); // { dg-error "definition" }
-  template<class T>class X; // { dg-error "" } previous declaration
+  template<class T>class X; // { dg-error "previous declaration" }
 }
 
 template <typename T>
 T const
-bar::foo(T const &a)    
-{                        // { dg-error "" "" { xfail *-*-* } } not declared in bar - 
+bar::foo(T const &a)     // { dg-error "" "" { xfail *-*-* } } not declared in bar - 
+{
   return a;
 }
 
-template<> void bar::foo<int>()
-{                        // { dg-error "" }
+template<> void bar::foo<int>()     // { dg-error "different namespace" }
+{
 }
 
 template<class T,class U>
-class bar::X{};         // { dg-error "" } does not match declaration
+class bar::X{};         // { dg-error "1 template parameter" }
index 7d930b5..fc37c9b 100644 (file)
@@ -20,6 +20,6 @@ class B
 };
 
 B::B (const A a[])
-  : ary(a)
-{        // { dg-error "" } bad array initializer
+  : ary(a)        // { dg-error "bad array initializer" }
+{
 }
index f3c7c25..b18d99b 100644 (file)
@@ -7,10 +7,10 @@ public:
   virtual ~X();
 }
 
-X::x()
-{                              // { dg-error "" } 
+X::x() // { dg-error "return type|member function" }
+{
 }
 
-X::~x()                         // { dg-error "" } 
+X::~x()        // { dg-error "expected class-name" }
 {                              
 }
index 3fc4dc9..f5a00ed 100644 (file)
@@ -31,8 +31,8 @@ struct S5
   ~S5(); 
 };
 
-S5::~S5(float) 
-{ // { dg-error "" } destructors may not have parameters
+S5::~S5(float)  // { dg-error "" } destructors may not have parameters
+{
 }
 
 
@@ -43,8 +43,8 @@ struct S6
 };
 
 template <class T>
-S6<T>::~S6(float)
-{ // { dg-error "" } destructors may not have parameters
+S6<T>::~S6(float)   // { dg-error "" } destructors may not have parameters
+{
 }
 
 
index be04965..a4db38b 100644 (file)
@@ -4,8 +4,8 @@ struct S1 {
   ~S1(); // { dg-error "" } candidate
 };
 
-S1::~S1() const
-{ // { dg-error "" } prototype does not match 
+S1::~S1() const // { dg-error "" } prototype does not match 
+{
 }
 
 
@@ -20,8 +20,8 @@ struct S3 {
 };
 
 template <class T>
-S3<T>::~S3() volatile
-{ // { dg-error "" } prototype does not match 
+S3<T>::~S3() volatile  // { dg-error "" } prototype does not match 
+{
 }
 
 
index 0501a74..c5cfe8b 100644 (file)
@@ -1,13 +1,12 @@
-// { dg-do assemble  }
-// Build don't linK:
+// { dg-do compile }
 
-int main()
-{ // { dg-error "" } invalid redeclaration of
+int main()  // { dg-error "previous declaration" }
+{
   return 0;
 }
 
 
-int main(int, const char**)
-{ // { dg-error "" } as
+int main(int, const char**) // { dg-error "conflicts" }
+{
   return 0;
 }
index 4e76450..c7684d1 100644 (file)
@@ -34,12 +34,12 @@ struct Y
 };
 void bar (int);
 
-Y::Y(int i)
-{ // { dg-warning "" } unused parameter
+Y::Y(int i)  // { dg-warning "unused parameter" }
+{
 }
-void Y::bar (int i) 
-{ // { dg-warning "" } unused parameter
+void Y::bar (int i)  // { dg-warning "unused parameter" }
+{
 }
-void bar (int i)
-{ // { dg-warning "" } unused parameter
+void bar (int i) // { dg-warning "unused parameter" }
+{
 }
index bbf08bb..be83f5a 100644 (file)
@@ -8,6 +8,6 @@ class A
 };
 
 
-template <class j> class A::A_impl 
-{ // { dg-error "" } does not declare a template
+template <class j> class A::A_impl // { dg-error "does not declare a template" }
+{
 };
index 146c0b1..13695f9 100644 (file)
@@ -28,7 +28,7 @@ struct list {
   };
   
   reverse_iterator<list_iterator<T> > rbegin()
-    { return reverse_iterator<list_iterator<T> > // { dg-error "" } no type|instantiated here
+    { return reverse_iterator<list_iterator<T> >
        (list_iterator<T>(Head->next())); } // { dg-error "" } not declared
 };
 
index 3046455..41aab39 100644 (file)
@@ -9,7 +9,7 @@ struct S
 
 
 template <class T> 
-template <> // { dg-error "" } enclosing classes not specialized
-void S<T>::f<int> () 
-{ // { dg-error "" } template does not match any declaration
+template <> // { dg-error "enclosing class templates|invalid explicit specialization" }
+void S<T>::f<int> ()  // { dg-error "does not match|invalid function declaration" }
+{
 }
index acb9e70..e2c5b4e 100644 (file)
@@ -14,8 +14,8 @@ int main()
 }
 
 template <>
-int f(int i) 
-{             // { dg-error "" } specialization of f<int>(int) after instantiation
+int f(int i)   // { dg-error "specialization\[^\n\]*after instantiation" }
+{
   return 1;
 }
 
index 5d883fd..4a9b7ee 100644 (file)
@@ -7,12 +7,10 @@ template<class Key,
          template<class, class > class MapT> 
 class base 
 {
-  
 };
 
 // specialization
 template<class Key, class Value>
-class base<Key, Value, mymap<int, int > >      
-{                                              // { dg-error "" } type/value mismatch
-  
+class base<Key, Value, mymap<int, int > > // { dg-error "type/value|class template" }
+{
 };
index 58abd0c..c272d94 100644 (file)
@@ -4,8 +4,8 @@
 template <int nlimb, int i>
 inline unsigned f (unsigned* ptr);
 template <int nlimb>
-inline unsigned f<nlimb,nlimb> (unsigned* ptr)
-{                        //{ dg-error "" } partial specialization of function?
+inline unsigned f<nlimb,nlimb> (unsigned* ptr) // { dg-error "function template partial specialization" }
+{
   return 1;
 }
 
index 85dc43d..e01d747 100644 (file)
@@ -3,12 +3,12 @@ class A {
 private:
   int i1_;
 public:
-  void f(int const i1 = 1); // { dg-error "" } previous specification
+  void f(int const i1 = 1); // { dg-error "previous specification" }
 };
 
 void
-A::f(int const i1 = 1)
-{                          // { dg-error "" } duplicate default argument
+A::f(int const i1 = 1) // { dg-error "default argument given" }
+{
   i1_ = i1;
 }
 
index 3d4cc03..b969d68 100644 (file)
@@ -11,13 +11,13 @@ public:
         operator int() const {return 2;}
 };
 
-bool operator==(const MyInt& a, const int& b)
-{                                               // { dg-error "" } candidate
+bool operator==(const MyInt& a, const int& b)   // { dg-error "" } candidate
+{
         return (int)a == b;
 }
 
-bool operator==(const MyInt& a, const MyInt& b)
-{                                               // { dg-error "" } candidate
+bool operator==(const MyInt& a, const MyInt& b) // { dg-error "" } candidate
+{
         return (int)a == (int)b;
 }
 
index d80414c..c660050 100644 (file)
@@ -6,8 +6,8 @@ public:
   operator <<(char *);        //{ dg-error "" } no return type
 };
 
-void main()
-{                             //{ dg-error "" } wrong return type for main
+void main()                  // { dg-error "must return .int" }
+{
   foo f;
   f << (void*)0;
 }
index 7111578..78c379b 100644 (file)
@@ -1,3 +1,10 @@
+2004-09-23  Zack Weinberg  <zack@codesourcery.com>
+
+       * testsuite/20_util/memory/auto_ptr/assign_neg.cc
+       * testsuite/23_containers/map/operators/1_neg.cc
+       * testsuite/23_containers/set/operators/1_neg.cc:
+       Update locations and/or regexps of dg-error markers.
+
 2004-09-23  P.J. Darcy  <darcypj@us.ibm.com>
 
        * include/Makefile.am (thread_host_headers): Add gthr-tpf.h.
@@ -6,7 +13,7 @@
 
 2004-09-23  Paolo Carlini  <pcarlini@suse.de>
            Magnus Fromreide  <magfr@lysator.liu.se>
-           
+
        * include/bits/boost_concept_check.h (struct _SequenceConcept):
        Remove wrong requirement, i.e., not present in Table 67.
 
 2004-09-02  Mark Mitchell  <mark@codesourcery.com>
 
        * libsupc++/typeinfo: Honor __GXX_MERGED_TYPEINFO_NAMES if already
-       defined. 
+       defined.
 
 2004-09-02  Benjamin Kosnik  <bkoz@redhat.com>
-            Simon Richter  <Simon.Richter@hogyros.de>
-       
+           Simon Richter  <Simon.Richter@hogyros.de>
+
        PR libstdc++/16715
        * include/bits/istream.tcc: Add extern template for iostream
        char and wchar_t instantiations.
 
 2004-09-02  Benjamin Kosnik  <bkoz@redhat.com>
-            Leland Wang  <llwang@infor.org>
-       
+           Leland Wang  <llwang@infor.org>
+
        PR libstdc++/17259
        * include/ext/ropeimpl.h (rope::_S_compare): Use
        _Rope_constants::_S_leaf.
        * testsuite/ext/mt_allocator/tune-1.cc: New.
        * testsuite/ext/mt_allocator/tune-2.cc: New.
        * testsuite/ext/mt_allocator/tune-3.cc: New.
-       * testsuite/ext/mt_allocator/tune-4.cc: New.    
+       * testsuite/ext/mt_allocator/tune-4.cc: New.
 
        * testsuite/testsuite_allocator.h (__gnu_test::check_new): New.
        * testsuite/ext/allocators.cc: Use check_new, split into...
        * testsuite/ext/mt_allocator/check_new.cc: this.
        * testsuite/ext/pool_allocator/check_new.cc: this.
-       * testsuite/ext/malloc_allocator/check_new.cc: this.    
-       * testsuite/ext/debug_allocator/check_new.cc: this.     
+       * testsuite/ext/malloc_allocator/check_new.cc: this.
+       * testsuite/ext/debug_allocator/check_new.cc: this.
        * testsuite/ext/mt_allocator/instantiate.cc: this.
        * testsuite/ext/pool_allocator/instantiate.cc: this.
-       * testsuite/ext/malloc_allocator/instantiate.cc: this.  
+       * testsuite/ext/malloc_allocator/instantiate.cc: this.
        * testsuite/ext/debug_allocator/instantiate.cc: this.
-       
+
 2004-08-30  Phil Edwards  <phil@codesourcery.com>
 
        * docs/html/install.html:  Update locales list (from Paolo).
        * testsuite/27_io/manipulators/basefield/wchar_t/1.cc: Likewise.
        * testsuite/27_io/manipulators/standard/wchar_t/1.cc: Likewise.
        * testsuite/27_io/manipulators/standard/wchar_t/2.cc: Likewise.
-       
+
        * testsuite/27_io/manipulators/adjustfield/char/1.cc: Minor
        formatting fixes.
        * testsuite/27_io/manipulators/adjustfield/char/2.cc: Likewise.
 
        * cpu/hppa/atomicity.h (__exchange_and_add, __atomic_add): Add memory
        barrier to locking asm.
-       
+
 2004-08-20  Paolo Carlini  <pcarlini@suse.de>
 
        * include/c_std/cmath.tcc (__cmath_power): Revert previous commit:
        * testsuite/22_locale/time_put/put/wchar_t/2.cc: Likewise.
        * testsuite/22_locale/time_put/put/wchar_t/3.cc: Likewise.
        * testsuite/22_locale/time_put/put/wchar_t/4.cc: Likewise.
+
 2004-08-19  Paolo Carlini  <pcarlini@suse.de>
 
        * config/abi/x86_64-linux-gnu/baseline_symbols.txt: Update to 3.4.0.
        * testsuite/22_locale/time_put/put/wchar_t/8.cc: Likewise.
 
 2004-08-13  Paolo Carlini  <pcarlini@suse.de>
-       
+
        * src/debug.cc (_Error_formatter::_M_print_string): Fix thinko,
        memmove is not needed, memcpy suffices.
 
        * testsuite/27_io/basic_stringbuf/sbumpc/wchar_t/1.cc: Fix typo.
 
 2004-08-11  Paolo Carlini  <pcarlini@suse.de>
-       
+
        * testsuite/27_io/basic_stringbuf/imbue/char/1.cc: Declare test
        variable.
        * testsuite/27_io/basic_stringbuf/imbue/wchar_t/1.cc: Ditto.
 
 2004-08-07  Jonathan Wakely  <redi@gcc.gnu.org>
            Paolo Carlini  <pcarlini@suse.de>
-       
+
        * src/debug.cc (_Error_formatter::_M_print_string): In order
        to print individual words from __string, _M_format_word can't
        be called since may be just sprintf, thus ignoring completely
        * include/c_std/std/std_cstdlib.h (stdlib.h): Do not include it
        when freestanding.  Do not bring names into std:: namespace with
        "using" when freestanding.  Declare required functions and macros
-       when freestanding. 
+       when freestanding.
        * libsupc++/Makefile.am (c_sources): Do not include cp-demangle.c
        when freestanding.
        * libsupc++/del_op.cc: Declare "free" only when freestanding.
        * po/Makefile.in: Likewise.
        * src/Makefile.in: Likewise.
        * testsuite/Makefile.in: Likewise.
-       
+
 2004-08-01  Matt Austern  <austern@apple.com>
 
        PR libstdc++/16844
-       * include/bits/stl_list.h (_M_create_node): Remove unused 
+       * include/bits/stl_list.h (_M_create_node): Remove unused
        zero-argument version.
        * include/ext/slist (_M_create_node): Pass two arguments to
        allocator's construct() member function.
        * testsuite/23_containers/multiset/explicit_instantiation.cc: New.
        * testsuite/ext/hash_set_explicit_instantiation.cc: New.
        * testsuite/ext/slist_explicit_instantiation.cc: New.
-       
+
 2004-07-30  Paolo Carlini  <pcarlini@suse.de>
 
        * include/bits/locale_facets.tcc (num_get<>::_M_extract_float,
        * docs/html/ext/lwg-active.html, lwg-defects.html: Import Revision 31.
 
 2004-07-29  Paolo Carlini  <pcarlini@suse.de>
-            Petur Runolfsson  <peturr02@ru.is>
+           Petur Runolfsson  <peturr02@ru.is>
 
        PR libstdc++/12658 (continued)
        * src/locale_init.cc (locale::locale, locale::global): Use
        * include/bits/stl_vector.h: Likewise.
        * include/bits/vector.tcc: Likewise.
        * include/ext/hashtable.h: Use rebind so that allocator_type
-       has correct type for a container's allocator.  Replace use of 
-       single-argument _Construct and _Destroy with use of allocator's 
+       has correct type for a container's allocator.  Replace use of
+       single-argument _Construct and _Destroy with use of allocator's
        construct and destroy methods.
        * include/ext/memory (__uninitialized_copy_n_a): New function.
        Like uninitialized_copy_n except that it takes an extra parameter,
        an allocator, and uses it for construct and destroy operations.
        * include/ext/rope: Use new forms defined in stl_construct.h,
-       stl_uninitialized.h, and ext/memory.  Replace use of single-argument 
+       stl_uninitialized.h, and ext/memory.  Replace use of single-argument
        _Construct and _Destroy with allocator construct and destroy methods.
        * include/ext/ropeimpl.h: Likewise.
        * include/ext/slist.h: Likewise.
        * testsuite/testsuite_allocator.cc (check_construct_destroy): New.
        * testsuite/23_containers/deque/check_construct_destroy.cc: New.
        * testsuite/23_containers/list/check_construct_destroy.cc: New.
-       * testsuite/23_containers/set/check_construct_destroy.cc: New.  
-       * testsuite/23_containers/vector/check_construct_destroy.cc: New. 
+       * testsuite/23_containers/set/check_construct_destroy.cc: New.
+       * testsuite/23_containers/vector/check_construct_destroy.cc: New.
        * testsuite/ext/hash_check_construct_destroy.cc: New.
        * testsuite/ext/slist_check_construct_destroy.cc: New.
-       
+
 2004-07-28  Alexandre Oliva  <aoliva@redhat.com>
 
        2003-10-01  Eric Christopher  <echristo@redhat.com>
        * configure: Regenerated.
 
        * testsuite/testsuite_abi.cc (check_version): Add 3.4.2.
-       
+
 2004-07-07  Aaron W. LaFramboise  <aaronraolete36@aaronwl.com>
 
        PR libstdc++/16411
        PR libstdc++/15928
        * crossconfig.m4: Add in bits for djgpp.
        * configure: Regenerate.
-       
+
 2004-07-05  Jonathan Wakely  <redi@gcc.gnu.org>
 
        * testsuite/23_containers/{set,multiset}/14340.cc: Fix typos in
        __is_trivially_copyable, __are_same and __copy::copy.
        (__copy): Rewrite as a class template and two specializations.
        (__copy_ni2): Simplify, just call __copy_aux.
-       
+
        * include/bits/stl_algobase.h (__copy_backward_aux): Add __are_same
        check.
        * testsuite/25_algorithms/copy/1.cc, 2.cc, 3.cc, 4.cc: Test also
        for destination value type != source value type.
 
 2004-07-01  Benjamin Kosnik  <bkoz@redhat.com>
-            Per Bothner  <per@bothner.com>
+           Per Bothner  <per@bothner.com>
            Mohan Embar  <gnustuff@thisiscool.com>
 
        PR libstdc++/16248
        * include/ext/pool_allocator.h (__pool_base::_M_get_mutex): Change
        to mutex_type.
        * src/allocator.cc: Same.
-       
+
 2004-06-30  Brad Spencer  <spencer@infointeractive.com>
 
        * include/ext/mt_allocator.h: Handle allocations at static
        initialization that happen before _S_options is (automatically)
        constructed; set _S_init even if _M_force_new is true.
-       
+
 2004-06-30  Benjamin Kosnik  <bkoz@redhat.com>
 
        * config/linker-map.gnu: Revert new exports.
 
 2004-06-30  Benjamin Kosnik  <bkoz@redhat.com>
-            Stuart Anderson  <anderson@netsweng.com>
-       
+           Stuart Anderson  <anderson@netsweng.com>
+
        * config/linker-map.gnu: Add destructor exports for abstract base
        classes to conform to LSB.
 
 2004-06-30  Gabriel Dos Reis  <gdr@integrable-solutions.net>
-            Paolo Carlini  <pcarlini@suse.de>
+           Paolo Carlini  <pcarlini@suse.de>
 
        * include/bits/cpp_type_traits.h: Add __is_pointer and
        __is_trivially_copyable.
        Revert -Weffc++ changes that defined copy ctory and or assignment
        operator.
        * libsupc++/tinfo.cc (__upcast_result): Same.
-       
+
 2004-06-28  Paolo Carlini  <pcarlini@suse.de>
 
        * src/localename.cc (locale::_Impl::_Impl): Slightly improve
 
 2004-06-25  Benjamin Kosnik  <bkoz@redhat.com>
 
-       PR libstdc++/16182      
+       PR libstdc++/16182
        * linkage.m4 (GLIBCXX_CHECK_BUILTIN_MATH_DEC): Revert to
        AC_DEFINE_UNQUOTED.
        * configure: Regenerate.
 
        * src/allocator.cc: Move all instantiations...
        * src/allocator-inst.cc: ...here.
-       
+
 2004-06-23  Andrew Pinski  <apinski@apple.com>
 
-       * linkage.m4: Remove check for libmx.   
+       * linkage.m4: Remove check for libmx.
        * configure: Regenerate.
 
 2004-06-23  Paolo Carlini  <pcarlini@suse.de>
        (__pool_alloc): Move _S_force new here.
        * src/allocator.cc: Move out of line __pool_base definitions here.
        * config/linker-map.gnu: Export bits from __pool_base.
-       
+
 2004-06-18  Paolo Carlini  <pcarlini@suse.de>
 
        * config/locale/gnu/numeric_members.cc
        (rope<>::_S_dump): Likewise.
        (rope<>::_S_fetch_ptr): Likewise.
        (rope<>::_S_compare): Likewise.
-       (rope<>::replace_with_c_str()): Likewise.               
+       (rope<>::replace_with_c_str()): Likewise.
 
        * testsuite/ext/rope.cc: Rename to testsuite/ext/rope/1.cc.
        * testsuite/ext/rope/2.cc: New.
 
 2004-06-09  Benjamin Kosnik  <bkoz@redhat.com>
 
-       * crossconfig.m4: Remove signbit, signbitf, signbitl.   
+       * crossconfig.m4: Remove signbit, signbitf, signbitl.
        * linkage.m4: Comment LIBMATHOBJS, tweak others.  AC_DEFINES for
        builtin math functions instead of AC_DEFINE_UNQUOTED.
        * configure: Regenerate.
-       
+
 2004-06-08  Benjamin Kosnik  <bkoz@redhat.com>
 
        * docs/doxygen/filter.sed: Rename _GLIBCXX_STD to std.
        * configure.ac (libtool_VERSION): Bump to 6:1:0.
        * configure: Regenerate.
        * aclocal.m4: Regenerate.
-       
+
 2004-05-30  Gabriel Dos Reis  <gdr@integrable-solutions.net>
 
        * include/std/std_complex.h (complex<_Tp>): Properly indent
-       to follow C++STYLE. 
+       to follow C++STYLE.
        (complex<>::__rep): New.
        (__complex_abs): New.  Dispatch to built-ins.
        (abs): Use them.
        (pow): Use it.
 
 2004-05-29  Richard B. Kreckel  <Richard.Kreckel@Framatome-ANP.com>
-            Benjamin Kosnik  <bkoz@redhat.com>
-       
+           Benjamin Kosnik  <bkoz@redhat.com>
+
        PR libstdc++/14600
        * include/ext/stdio_sync_filebuf.h (stdio_sync_filebuf::file): New.
        * include/ext/stdio_filebuf.h (stdio_filebuf::file): New.
 2004-05-22  Benjamin Kosnik  <bkoz@redhat.com>
 
        PR libstdc++/12854
-       Fixups for -Weffc++.    
+       Fixups for -Weffc++.
        * include/bits/basic_string.h (basic_string::operator=): Return
        pointer to this instead of result of assign. Although redundant,
        this doesn't impact resultant codegen.
-       
+
        * include/bits/locale_facets.h (__numpunct_cache): Declare
        assignment opxserator and copy constructor private.
        (__timepunct_cache): Same.
        (__moneypunct_cache): Same.
        (collate): Use member initialization list for _M_c_locale_collate.
        * config/locale/gnu/messages_members.h: Same.
-       * config/locale/gnu/time_members.h (__timepunct): Same. 
+       * config/locale/gnu/time_members.h (__timepunct): Same.
        * src/codecvt.cc: Use member initialization list to initialize
-       _M_c_locale_codecvt.    
+       _M_c_locale_codecvt.
        * src/ctype.cc: Same, with _M_c_locale_ctype and _M_narrow_ok.
        * config/os/gnu-linux/ctype_noninline.h: Same.
        * src/locale.cc (_Impl): Same.
        * src/locale_init.cc: Same.
-       * src/localename.cc: Same.      
+       * src/localename.cc: Same.
 
        * include/bits/basic_ios.h (basic_ios): Complete member
        initialization list.
        * include/std/std_streambuf.h: Same.
        * include/std/std_sstream.h: Same, for _M_mode.
        * src/ios.cc (ios_base): Same.
-       
+
        * include/ext/rope: Make derived classes match exception
 
         specifications. Add copy constructors and assignment operators.
 2004-05-22  Benjamin Kosnik  <bkoz@redhat.com>
 
        * testsuite/testsuite_hooks.h (func_callback): Declare copy
-       constructor and assignment operator private.    
+       constructor and assignment operator private.
        * testsuite/23_containers/deque/cons/clear_allocator.cc: Match
        exception specifications of base class.
        * testsuite/23_containers/list/cons/clear_allocator.cc: Same.
        * testsuite/23_containers/vector/cons/clear_allocator.cc: Same.
        * testsuite/23_containers/vector/bool/clear_allocator.cc: New.
-               
+
 2004-05-22  Benjamin Kosnik  <bkoz@redhat.com>
 
        * libsupc++/cxxabi.h: Remove duplicated and useless public and
-        private keywords in class declarations. Format. Use
-        stddef.h. Expose declarations to "C" compilation.
-        * libsupc++/tinfo.cc (__upcast_result): Add copy constructor and
-        assignment operator.
-        (__dyncast_result): Same.
-        * libsupc++/vec.cc (uncatch_exception): Same, use member
-        initialization list.
-                 
+       private keywords in class declarations. Format. Use
+       stddef.h. Expose declarations to "C" compilation.
+       * libsupc++/tinfo.cc (__upcast_result): Add copy constructor and
+       assignment operator.
+       (__dyncast_result): Same.
+       * libsupc++/vec.cc (uncatch_exception): Same, use member
+       initialization list.
+
 2004-05-22  Benjamin Kosnik  <bkoz@redhat.com>
 
        * testsuite/abi_check.cc: Add unistd.h.
        * testsuite/22_locale/num_put/put/wchar_t/8.cc: Likewise.
 
 2004-05-21  Matthias Klose  <doko@debian.org>
+
        * docs/doxygen/run_doxygen:  Bump required version.
 
 2004-05-21  Benjamin Kosnik  <bkoz@redhat.com>
        * docs/doxygen/guide.html: Add dot note.
        * docs/doxygen/stdheader.cc: Edit, add files.
        * docs/doxygen/user.cfg.in: Regenerate with Doxygen 1.3.7.
-       
+
 2004-05-18  Jonathan Wakely  <redi@gcc.gnu.org>
 
        * include/ext/stdio_filebuf.h: Update comments to reflect PR 11691.
 
 2004-05-18  Jan Beulich  <jbeulich@novell.com>
-        PR libstdc++/15489
+
+       PR libstdc++/15489
        * scripts/create_testsuite_files: Also find source files through
        symbolic links.
 
 
 2004-05-17  Douglas Gregor   <gregod@cs.rpi.edu>
 
-       PR libstdc++/14340 
-       * include/debug/safe_iterator.h (_Safe_iterator converting 
-       constructor): Only allow declaration to instantiate when the 
+       PR libstdc++/14340
+       * include/debug/safe_iterator.h (_Safe_iterator converting
+       constructor): Only allow declaration to instantiate when the
        incoming _Safe_iterator has exactly the right iterator type.
 
 2004-05-17  Jonathan Wakely  <redi@gcc.gnu.org>
        PR libstdc++/15046
        * crossconfig.m4: Add C99 math bits for linux crosses.
        * configure: Regenerate.
-       
+
 2004-05-13  Simon Marshall <simon.marshall@misys.com>
            Benjamin Kosnik  <bkoz@redhat.com>
 
        * config/locale/gnu/numeric_members.cc: Same.
        * testsuite/testsuite_abi.cc: Same.
        * testsuite/testsuite_hooks.cc: Same.
-       
+
 2004-05-13  Jonathan Wakely  <redi@gcc.gnu.org>
-       
+
        * docs/html/abi.html: Document effect of -fabi-version on value
        of __GXX_ABI_VERSION, and that it's defined in c-cppbuiltin.c.
        Fix markup.
 
 2004-05-13  Benjamin Kosnik  <bkoz@redhat.com>
 
-       PR libstdc++/15074      
+       PR libstdc++/15074
        * docs/html/faq/index.html: Update docs for libsupc++ usage.
 
 2004-05-13  Benjamin Kosnik  <bkoz@redhat.com>
        * include/bits/stl_threads.h (_GLIBCXX_mutex): Move to namespace
        __gnu_internal.
        (_GLIBCXX_mutex_address): Same.
-       (_GLIBCXX_once): Same.  
+       (_GLIBCXX_once): Same.
        (_GLIBCXX_mutex_init): Same.
        (_GLIBCXX_mutex_address_init): Same.
-       
+
 2004-05-13  Benjamin Kosnik  <bkoz@redhat.com>
-       
+
        * docs/html/abi.html: New.
        * docs/html/abi.txt: Remove.
        * docs/html/documentation.html: Add link.
 
        * docs/html/17_intro/TODO: Update.
        * include/bits/stl_pair.h: Format.
-       
+
 2004-05-06  Matthias Klose  <doko@debian.org>
 
        * include/backward/iterator.h:  Add GPL copyright info,
        * include
        * libsupc++/tinfo.h: Likewise.
        * po/string_literals.cc: Likewise.
-       
+
 2004-05-03  Andreas Tobler  <a.tobler@schweiz.ch>
 
        * acinclude.m4: Replace -W with more speaking -Wextra.
 
 2004-04-24  Paolo Carlini  <pcarlini@suse.de>
 
-       * testsuite/27_io/basic_istream/getline/char/4.cc: New. 
+       * testsuite/27_io/basic_istream/getline/char/4.cc: New.
 
        * include/bits/istream.tcc (getline(basic_istream<>&,
        basic_string<>&, _CharT)): Change to use sgetc()/snextc() instead
 
 2004-04-19  Benjamin Kosnik  <bkoz@redhat.com>
 
-       * testsuite/27_io/basic_istream/extractors_character/char/9555-ic.cc: 
+       * testsuite/27_io/basic_istream/extractors_character/char/9555-ic.cc:
        Clarify assertion, set test variable to false before assert.
        * testsuite/27_io/basic_istringstream/str/char/1.cc: Same.
        * testsuite/27_io/basic_stringstream/str/char/1.cc: Same.
        * testsuite/27_io/ios_base/storage/2.cc: Same.
-       
+
        * testsuite/27_io/basic_filebuf/imbue/char/13171-4.cc: Fix
        function returns.
        * testsuite/27_io/basic_filebuf/imbue/wchar_t/13582-3.cc: Same.
        * testsuite/27_io/fpos/14320-3.cc: Same.
-       
+
        * testsuite/27_io/basic_filebuf/2.cc: Instantiate in namespace std.
        * testsuite/27_io/fpos/1.cc: Same.
        * testsuite/27_io/basic_stringstream/2.cc: Same.
        * testsuite/21_strings/char_traits/requirements/wchar_t/1.cc: Same.
        * testsuite/21_strings/char_traits/requirements/char/1.cc: Same.
        * testsuite/21_strings/char_traits/requirements/short/1.cc: Same.
-       * testsuite/27_io/basic_istream/seekg/char/exceptions_badbit_throw.cc: 
+       * testsuite/27_io/basic_istream/seekg/char/exceptions_badbit_throw.cc:
        Same.
        * testsuite/27_io/basic_ostream/inserters_arithmetic/char/exceptions_badbit_throw.cc: Same.
-       * testsuite/27_io/basic_ostream/seekp/char/exceptions_badbit_throw.cc: 
+       * testsuite/27_io/basic_ostream/seekp/char/exceptions_badbit_throw.cc:
        Same.
        * testsuite/27_io/basic_ostream/inserters_arithmetic/char/exceptions_failbit_throw.cc: Same.
        * testsuite/27_io/types/2.cc: Same.
 
        * testsuite/ext/stdio_sync_filebuf/wchar_t/12077.cc: Fix temporary
-       file name.      
+       file name.
        * testsuite/27_io/fpos/14775.cc: Same.
-       
+
 2004-04-19  Paolo Carlini  <pcarlini@suse.de>
 
        PR libstdc++/15002 (partial)
        * include/bits/basic_string.h (_M_replace_aux, _M_replace_safe):
-       Special case __n2 == 1, not calling traits_type::assign/copy. 
+       Special case __n2 == 1, not calling traits_type::assign/copy.
 
 2004-04-17  Benjamin Kosnik  <bkoz@redhat.com>
 
        * include/bits/stl_bvector.h: Use _M_impl._M_start.
-       
+
 2004-04-16  Benjamin Kosnik  <bkoz@redhat.com>
-       
+
        * include/bits/c++config (_GLIBCXX_STD): New.
        * src/list.cc: Use it.
        * include/std/std_bitset.h: Same.
        * include/debug/map.h: Same.
        * include/debug/list: Same.
        * include/debug/deque: Same.
-       * include/debug/bitset: Same.   
+       * include/debug/bitset: Same.
        * include/debug/formatter.h (__gnu_debug): Remove using directive.
        Add using declaration for std::type_info.
        * include/debug/safe_iterator.h: Add using declaration for
        * include/bits/stl_bvector.h (_Bvector_base): Use _Bvector_impl
        idiom that other containers use.
        * testsuite/23_containers/vector/bool/clear_allocator.cc: New.
-                       
+
 2004-04-16  Paolo Carlini  <pcarlini@suse.de>
 
        PR libstdc++/14975
index 5529167..8899c98 100644 (file)
@@ -46,5 +46,5 @@ main()
   test01();
   return 0;
 }
-// { dg-error "candidates" "" { target *-*-* } 223 } 
-// { dg-error "std::auto_ptr" "" { target *-*-* } 353 } 
+// { dg-error "candidates" "" { target *-*-* } 222 } 
+// { dg-error "std::auto_ptr" "" { target *-*-* } 352 } 
index 64a1d7d..15b182d 100644 (file)
@@ -41,5 +41,5 @@ void test01()
   test &= itr == mapByName.end(); // { dg-error "no" } 
 }
  
-// { dg-error "candidates are" "" { target *-*-* } 209 } 
-// { dg-error "candidates are" "" { target *-*-* } 213 }
+// { dg-error "candidates are" "" { target *-*-* } 208 } 
+// { dg-error "candidates are" "" { target *-*-* } 212 }
index 8af78f3..4a5b45b 100644 (file)
@@ -39,6 +39,5 @@ void test01()
   test &= itr == setByName.end(); // { dg-error "no" } 
 }
 
-// { dg-error "candidates are" "" { target *-*-* } 282 } 
-// { dg-error "candidates are" "" { target *-*-* } 286 }
-
+// { dg-error "candidates are" "" { target *-*-* } 281 } 
+// { dg-error "candidates are" "" { target *-*-* } 285 }