c++: Add assert to tsubst.
authorMarek Polacek <polacek@redhat.com>
Wed, 17 Mar 2021 23:39:10 +0000 (19:39 -0400)
committerMarek Polacek <polacek@redhat.com>
Thu, 18 Mar 2021 18:20:00 +0000 (14:20 -0400)
As discussed in the r11-7709 patch, we can now make sure that tsubst
never sees a FLOAT_EXPR, much like its counterpart FIX_TRUNC_EXPR.

gcc/cp/ChangeLog:

* pt.c (tsubst_copy_and_build): Add assert.

gcc/cp/pt.c

index 5e485f1..ea530ef 100644 (file)
@@ -19770,6 +19770,8 @@ tsubst_copy_and_build (tree t,
                                complain|decltype_flag));
 
     case FIX_TRUNC_EXPR:
+    case FLOAT_EXPR:
+      /* convert_like should have created an IMPLICIT_CONV_EXPR.  */
       gcc_unreachable ();
 
     case ADDR_EXPR: