call.c (build_user_type_conversion_1): Use my_friendly_assert rather than if ...
authorNathan Sidwell <nathan@codesourcery.com>
Sat, 29 Dec 2001 17:24:59 +0000 (17:24 +0000)
committerNathan Sidwell <nathan@gcc.gnu.org>
Sat, 29 Dec 2001 17:24:59 +0000 (17:24 +0000)
cp:
* call.c (build_user_type_conversion_1): Use my_friendly_assert
rather than if ... abort.
* cvt.c (convert_to_reference): Likewise.
* semantics.c (setup_vtbl_ptr): Likewise.
* pt.c (lookup_template_class): Comment typo.

From-SVN: r48371

gcc/cp/ChangeLog
gcc/cp/call.c
gcc/cp/cvt.c
gcc/cp/pt.c
gcc/cp/semantics.c

index b9101957bfc82c84d70349463614211dfe991a57..b392e959a9463ae4cfc233117fe2a9b168ac771d 100644 (file)
@@ -1,3 +1,11 @@
+2001-12-29  Nathan Sidwell  <nathan@codesourcery.com>
+
+       * call.c (build_user_type_conversion_1): Use my_friendly_assert
+       rather than if ... abort.
+       * cvt.c (convert_to_reference): Likewise.
+       * semantics.c (setup_vtbl_ptr): Likewise.
+       * pt.c (lookup_template_class): Comment typo.
+       
 2001-12-29  Nathan Sidwell  <nathan@codesourcery.com>
 
        PR c++/5125
index d8129a754d8ac9b0417f1570fb6313d9bd61ef22..865d1eff9fad3c1848153205cb756a17213d8f6a 100644 (file)
@@ -2376,9 +2376,8 @@ build_user_type_conversion_1 (totype, expr, flags)
   /* We represent conversion within a hierarchy using RVALUE_CONV and
      BASE_CONV, as specified by [over.best.ics]; these become plain
      constructor calls, as specified in [dcl.init].  */
-  if (IS_AGGR_TYPE (fromtype) && IS_AGGR_TYPE (totype)
-      && DERIVED_FROM_P (totype, fromtype))
-    abort ();
+  my_friendly_assert (!IS_AGGR_TYPE (fromtype) || !IS_AGGR_TYPE (totype)
+                     || !DERIVED_FROM_P (totype, fromtype), 20011226);
 
   if (IS_AGGR_TYPE (totype))
     ctors = lookup_fnfields (TYPE_BINFO (totype),
@@ -2400,11 +2399,11 @@ build_user_type_conversion_1 (totype, expr, flags)
       t = build_int_2 (0, 0);
       TREE_TYPE (t) = build_pointer_type (totype);
       args = build_tree_list (NULL_TREE, expr);
-      if (DECL_HAS_IN_CHARGE_PARM_P (OVL_CURRENT (ctors))
-         || DECL_HAS_VTT_PARM_P (OVL_CURRENT (ctors)))
-       /* We should never try to call the abstract or base constructor
-          from here.  */
-       abort ();
+      /* We should never try to call the abstract or base constructor
+        from here.  */
+      my_friendly_assert (!DECL_HAS_IN_CHARGE_PARM_P (OVL_CURRENT (ctors))
+                         && !DECL_HAS_VTT_PARM_P (OVL_CURRENT (ctors)),
+                         20011226);
       args = tree_cons (NULL_TREE, t, args);
     }
   for (; ctors; ctors = OVL_NEXT (ctors))
index 3d02456f32c3a00bbfbe94a6991ba9b204389149..6029e8427169120259505a99a2745225c7510a5a 100644 (file)
@@ -485,8 +485,7 @@ convert_to_reference (reftype, expr, convtype, flags, decl)
       intype = TREE_TYPE (expr);
     }
 
-  if (TREE_CODE (intype) == REFERENCE_TYPE)
-    my_friendly_abort (364);
+  my_friendly_assert (TREE_CODE (intype) != REFERENCE_TYPE, 364);
 
   intype = TYPE_MAIN_VARIANT (intype);
 
index de24a05f6198fe6204ec3371c65eb0ceaee5fd88..139076ecfec0760e8c4098c93cd8e07832e564e2 100644 (file)
@@ -3982,7 +3982,7 @@ lookup_template_class (d1, arglist, in_decl, context, entering_scope, complain)
          arg_depth = TMPL_ARGS_DEPTH (arglist);
        }
 
-      /* Now we should enough arguments.  */
+      /* Now we should have enough arguments.  */
       my_friendly_assert (parm_depth == arg_depth, 0);
       
       /* From here on, we're only interested in the most general
index 90120ce0fa61dbd76056c915e1de905db27bcf28..b04a13aee76fb843fd3f9d7e3dab70b3ec82f4dd 100644 (file)
@@ -1157,10 +1157,7 @@ setup_vtbl_ptr (member_init_list, base_init_list)
      tree base_init_list;
 {
   my_friendly_assert (doing_semantic_analysis_p (), 19990919);
-
-  /* If we've already done this, break.  */
-  if (vtbls_set_up_p)
-    abort ();
+  my_friendly_assert (!vtbls_set_up_p, 20011220);
 
   if (processing_template_decl)
     add_stmt (build_min_nt (CTOR_INITIALIZER,