From 823a7d17d5118dd49ed7b7ad4d088ba812a694c0 Mon Sep 17 00:00:00 2001 From: Oliver Tappe Date: Thu, 28 Oct 2004 18:26:46 +0000 Subject: [PATCH] [taken from gcc-2.96] 2001-01-11 Nathan Sidwell * typeck.c (build_c_cast): Do template processing earlier. 2001-08-09 Jakub Jelinek * g++.old-deja/g++.other/array3.C: New test. git-svn-id: file:///srv/svn/repos/haiku/trunk/buildtools@9602 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- gcc/gcc/cp/typeck.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/gcc/gcc/cp/typeck.c b/gcc/gcc/cp/typeck.c index 3f49946ee4..6ac54fdf91 100644 --- a/gcc/gcc/cp/typeck.c +++ b/gcc/gcc/cp/typeck.c @@ -5710,6 +5710,13 @@ build_c_cast (type, expr) if (type == error_mark_node || expr == error_mark_node) return error_mark_node; + if (processing_template_decl) + { + tree t = build_min (CAST_EXPR, type, + min_tree_cons (NULL_TREE, value, NULL_TREE)); + return t; + } + /* build_c_cast puts on a NOP_EXPR to make the result not an lvalue. Strip such NOP_EXPRs if VALUE is being used in non-lvalue context. */ if (TREE_CODE (type) != REFERENCE_TYPE @@ -5751,13 +5758,6 @@ build_c_cast (type, expr) return error_mark_node; } - if (processing_template_decl) - { - tree t = build_min (CAST_EXPR, type, - min_tree_cons (NULL_TREE, value, NULL_TREE)); - return t; - } - /* Convert functions and arrays to pointers and convert references to their expanded types, but don't convert any other types. If, however, we are