[gcc r11-7723] c++: Add assert to tsubst.

Marek Polacek mpolacek@gcc.gnu.org
Thu Mar 18 18:34:38 GMT 2021


https://gcc.gnu.org/g:c5e55673b486533c4d6d19ac903460f70b48f11a

commit r11-7723-gc5e55673b486533c4d6d19ac903460f70b48f11a
Author: Marek Polacek <polacek@redhat.com>
Date:   Wed Mar 17 19:39:10 2021 -0400

    c++: Add assert to tsubst.
    
    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.

Diff:
---
 gcc/cp/pt.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index 5e485f10d19..ea530ef36f4 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -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:


More information about the Gcc-cvs mailing list