Commit 86910c53 by Jason Merrill Committed by Jason Merrill

typeck2.c (check_for_new_type): Only depend on pedantic for C-style casts.

	* typeck2.c (check_for_new_type): Only depend on pedantic for
	C-style casts.

From-SVN: r23342
parent a28e148a
...@@ -10,7 +10,8 @@ ...@@ -10,7 +10,8 @@
* init.c (build_member_call): Don't try to convert to the base type * init.c (build_member_call): Don't try to convert to the base type
if it's ambiguous. if it's ambiguous.
* typeck2.c (check_for_new_type): Don't depend on pedantic. * typeck2.c (check_for_new_type): Only depend on pedantic for
C-style casts.
1998-10-25 Mark Mitchell <mark@markmitchell.com> 1998-10-25 Mark Mitchell <mark@markmitchell.com>
......
...@@ -1654,11 +1654,15 @@ report_case_error (code, type, new_value, old_value) ...@@ -1654,11 +1654,15 @@ report_case_error (code, type, new_value, old_value)
} }
#endif #endif
/* Complain about defining new types in inappropriate places. We give an
exception for C-style casts, to accommodate GNU C stylings. */
void void
check_for_new_type (string, inptree) check_for_new_type (string, inptree)
char *string; char *string;
flagged_type_tree inptree; flagged_type_tree inptree;
{ {
if (inptree.new_type_flag) if (inptree.new_type_flag
&& (pedantic || strcmp (string, "cast") != 0))
pedwarn ("ANSI C++ forbids defining types within %s",string); pedwarn ("ANSI C++ forbids defining types within %s",string);
} }
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