parser.c (cp_parser_type_parameter): Reformat.
authorNathan Sidwell <nathan@codesourcery.com>
Sun, 27 Jul 2003 16:51:14 +0000 (16:51 +0000)
committerNathan Sidwell <nathan@gcc.gnu.org>
Sun, 27 Jul 2003 16:51:14 +0000 (16:51 +0000)
* parser.c (cp_parser_type_parameter): Reformat.
(cp_parser_parameter_declaration): Deprecate default args where
not allowed.

From-SVN: r69852

gcc/cp/ChangeLog
gcc/cp/parser.c

index 4ac3accc00b3462571078690f7eb1c3b7473843d..ad86f1aa5e02f7ba0fc61977917362c15b062e05 100644 (file)
@@ -1,3 +1,9 @@
+2003-07-27  Nathan Sidwell  <nathan@codesourcery.com>
+
+       * parser.c (cp_parser_type_parameter): Reformat.
+       (cp_parser_parameter_declaration): Deprecate default args where
+       not allowed.
+
 2003-07-26  Nathan Sidwell  <nathan@codesourcery.com>
 
        * cfns.h: Rebuilt.
index 5a7dc875bb9e55b045bd86bc8363380a8be50373..003b4fe87397d62814a46bae4104d6ef6575bf00 100644 (file)
@@ -7305,8 +7305,7 @@ cp_parser_type_parameter (cp_parser* parser)
 
        /* Create the combined representation of the parameter and the
           default argument.  */
-       parameter = build_tree_list (default_argument, 
-                                    parameter);
+       parameter = build_tree_list (default_argument, parameter);
       }
       break;
 
@@ -7365,8 +7364,7 @@ cp_parser_type_parameter (cp_parser* parser)
 
        /* Create the combined representation of the parameter and the
           default argument.  */
-       parameter =  build_tree_list (default_argument, 
-                                     parameter);
+       parameter =  build_tree_list (default_argument, parameter);
       }
       break;
 
@@ -10498,9 +10496,13 @@ cp_parser_parameter_declaration (cp_parser *parser,
        }
       if (!parser->default_arg_ok_p)
        {
-         pedwarn ("default arguments are only permitted on functions");
-         if (flag_pedantic_errors)
-           default_argument = NULL_TREE;
+         if (!flag_pedantic_errors)
+           warning ("deprecated use of default argument for parameter of non-function");
+         else
+           {
+             error ("default arguments are only permitted for function parameters");
+             default_argument = NULL_TREE;
+           }
        }
     }
   else