]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
decl.c (grok_op_properties): Merge conversion to void warning with other silly op...
authorNathan Sidwell <nathan@codesourcery.com>
Wed, 8 Mar 2000 17:09:15 +0000 (17:09 +0000)
committerNathan Sidwell <nathan@gcc.gnu.org>
Wed, 8 Mar 2000 17:09:15 +0000 (17:09 +0000)
* decl.c (grok_op_properties): Merge conversion to void warning
with other silly op warnings.

From-SVN: r32424

gcc/cp/ChangeLog
gcc/cp/decl.c

index 1fe2948e8854f64e8fa2bdbc8114ecd74907e48d..fcf487593ef48f7b799fd70bdedea9a07d4c0aae 100644 (file)
@@ -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
index 63fc93aa0a802aad9e41cde4173755fff58d25a0..38cf55beedd2f233d9004d58597583205da82961 100644 (file)
@@ -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)