Commit 343fdf03 by Jason Merrill

decl.c (grokdeclarator): Tweak conditions for pedwarn in previous change.

	* decl.c (grokdeclarator): Tweak conditions for pedwarn in
 	previous change.

Mon Nov 10 20:08:29 1997  Bruno Haible  <bruno@linuix.mathematik.uni-karlsruhe.de>

	* pt.c (coerce_template_parms): Tweak error message.

	* decl.c (grokdeclarator): If -Wreturn-type, warn everytime a
	return type defaults to `int', even if there are storage-class
	specifiers.

From-SVN: r16425
parent 6d1350cd
...@@ -4,6 +4,19 @@ Sun Nov 9 01:29:55 1997 Jim Wilson (wilson@cygnus.com) ...@@ -4,6 +4,19 @@ Sun Nov 9 01:29:55 1997 Jim Wilson (wilson@cygnus.com)
* init.c (build_vec_delete_1): Delete build_block and * init.c (build_vec_delete_1): Delete build_block and
add_block_current_level calls. add_block_current_level calls.
Mon Nov 10 20:08:38 1997 Jason Merrill <jason@yorick.cygnus.com>
* decl.c (grokdeclarator): Tweak conditions for pedwarn in
previous change.
Mon Nov 10 20:08:29 1997 Bruno Haible <bruno@linuix.mathematik.uni-karlsruhe.de>
* pt.c (coerce_template_parms): Tweak error message.
* decl.c (grokdeclarator): If -Wreturn-type, warn everytime a
return type defaults to `int', even if there are storage-class
specifiers.
Mon Nov 10 03:04:20 1997 Jason Merrill <jason@yorick.cygnus.com> Mon Nov 10 03:04:20 1997 Jason Merrill <jason@yorick.cygnus.com>
Complete nested exception support. Complete nested exception support.
......
...@@ -8104,10 +8104,15 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist) ...@@ -8104,10 +8104,15 @@ grokdeclarator (declarator, declspecs, decl_context, initialized, attrlist)
} }
else if (RIDBIT_SETP (RID_TYPEDEF, specbits)) else if (RIDBIT_SETP (RID_TYPEDEF, specbits))
pedwarn ("ANSI C++ forbids typedef which does not specify a type"); pedwarn ("ANSI C++ forbids typedef which does not specify a type");
else if (declspecs == NULL_TREE else if (innermost_code != CALL_EXPR || pedantic
&& (innermost_code != CALL_EXPR || pedantic)) || (warn_return_type && return_type == return_normal))
cp_pedwarn ("ANSI C++ forbids declaration `%D' with no type or storage class", {
dname); if (innermost_code == CALL_EXPR)
cp_pedwarn ("return-type of `%D' defaults to `int'", dname);
else
cp_pedwarn ("ANSI C++ forbids declaration `%D' with no type",
dname);
}
type = integer_type_node; type = integer_type_node;
} }
} }
......
...@@ -1085,7 +1085,7 @@ coerce_template_parms (parms, arglist, in_decl) ...@@ -1085,7 +1085,7 @@ coerce_template_parms (parms, arglist, in_decl)
} }
else if (!TREE_CONSTANT (val)) else if (!TREE_CONSTANT (val))
{ {
cp_error ("non-const `%E' cannot be used as template argument", cp_error ("non-constant `%E' cannot be used as template argument",
arg); arg);
val = error_mark_node; val = error_mark_node;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment