diff options
author | Nathan Sidwell <nathan@codesourcery.com> | 2000-03-08 17:09:15 +0000 |
---|---|---|
committer | Nathan Sidwell <nathan@gcc.gnu.org> | 2000-03-08 17:09:15 +0000 |
commit | 17708e90e1e97c80e54202c80b0f6da9231d876c (patch) | |
tree | bf4d874215daed6fadcf495e080f5f36478160c6 /gcc | |
parent | 5cb1bea4ae18475ac4f21dc21cb1cafa8f3fc565 (diff) | |
download | gcc-17708e90e1e97c80e54202c80b0f6da9231d876c.zip gcc-17708e90e1e97c80e54202c80b0f6da9231d876c.tar.gz gcc-17708e90e1e97c80e54202c80b0f6da9231d876c.tar.bz2 |
decl.c (grok_op_properties): Merge conversion to void warning with other silly op warnings.
* decl.c (grok_op_properties): Merge conversion to void warning
with other silly op warnings.
From-SVN: r32424
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 5 | ||||
-rw-r--r-- | gcc/cp/decl.c | 9 |
2 files changed, 10 insertions, 4 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 1fe2948..fcf4875 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2000-03-08 Nathan Sidwell <nathan@codesourcery.com> + + * decl.c (grok_op_properties): Merge conversion to void warning + with other silly op warnings. + 2000-03-08 Jason Merrill <jason@casey.cygnus.com> * typeck2.c (process_init_constructor): Set TREE_PURPOSE of diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c index 63fc93a..38cf55b 100644 --- a/gcc/cp/decl.c +++ b/gcc/cp/decl.c @@ -11980,16 +11980,17 @@ grok_op_properties (decl, virtualp, friendp) if (IDENTIFIER_TYPENAME_P (name) && ! DECL_TEMPLATE_INFO (decl)) { tree t = TREE_TYPE (name); - if (TREE_CODE (t) == VOID_TYPE) - pedwarn ("void is not a valid type conversion operator"); - else if (! friendp) + if (! friendp) { int ref = (TREE_CODE (t) == REFERENCE_TYPE); const char *what = 0; + if (ref) t = TYPE_MAIN_VARIANT (TREE_TYPE (t)); - if (t == current_class_type) + if (TREE_CODE (t) == VOID_TYPE) + what = "void"; + else if (t == current_class_type) what = "the same type"; /* Don't force t to be complete here. */ else if (IS_AGGR_TYPE (t) |