This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Minor C++ PATCH to tsubst of DECLTYPE_TYPE


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 <jason@redhat.com>
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)
 	++cp_unevaluated_operand;
 	++c_inhibit_evaluation_warnings;
 
-	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);
 
 	--cp_unevaluated_operand;
 	--c_inhibit_evaluation_warnings;

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]