[pushed] c++: Add assert to tsubst.

Marek Polacek polacek@redhat.com
Thu Mar 18 18:34:50 GMT 2021


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.

Tested x86_64-pc-linux-gnu, applying to trunk.

gcc/cp/ChangeLog:

	* pt.c (tsubst_copy_and_build): Add assert.
---
 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:

base-commit: 55308fc26318427c1438cecc60ddd7ba24d5cd33
-- 
2.30.2



More information about the Gcc-patches mailing list