Patchwork Minor C++ PATCH to tsubst of DECLTYPE_TYPE

mail settings
Submitter Jason Merrill
Date April 15, 2013, 3:21 p.m.
Message ID <>
Download mbox | patch
Permalink /patch/236639/
State New
Headers show


Jason Merrill - April 15, 2013, 3:21 p.m.
While working on the latest 52748 patch, it occurred to me that using 
tsubst_expr for DECLTYPE_TYPE is wrong, since that function deals with 
statements; since we only have to deal with expressions there, 
tsubst_copy_and_build is a better choice.

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


commit b48d4d61ceffc2989f0ea1e32ca6e9cc41923b9c
Author: Jason Merrill <>
Date:   Sun Apr 14 16:41:27 2013 +0200

    	* pt.c (tsubst) [DECLTYPE_TYPE]: Use tsubst_copy_and_build.

diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index ba386a2..411ca55 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -11770,9 +11770,10 @@  tsubst (tree t, tree args, tsubst_flags_t complain, tree in_decl)
-	type = tsubst_expr (DECLTYPE_TYPE_EXPR (t), args,
-			    complain|tf_decltype, in_decl,
-			    /*integral_constant_expression_p=*/false);
+	type = tsubst_copy_and_build (DECLTYPE_TYPE_EXPR (t), args,
+				      complain|tf_decltype, in_decl,
+				      /*function_p*/false,
+				      /*integral_constant_expression*/false);