From patchwork Wed Jun 1 21:56:59 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: C++ PATCH for c++/44870 (wrong overload resolution error in template) Date: Wed, 01 Jun 2011 11:56:59 -0000 From: Jason Merrill X-Patchwork-Id: 98277 Message-Id: <4DE6B5AB.5080404@redhat.com> To: gcc-patches List On 05/31/2011 02:05 PM, Jason Merrill wrote: > So this patch makes us look through NON_DEPENDENT_EXPR at the actual > underlying tree structure. It occurred to me that if we're going to do this, we don't need to keep reference INDIRECT_REFs outside NON_DEPENDENT_EXPR. Tested x86_64-pc-linux-gnu, applied to trunk. commit 338548764b17eeb838383331990cdc0c98dc7b60 Author: Jason Merrill Date: Wed Jun 1 14:08:37 2011 -0400 * pt.c (build_non_dependent_expr): Remove special handling of REFERENCE_REF_P. diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index f62d893..03398f4 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -19198,12 +19198,6 @@ build_non_dependent_expr (tree expr) TREE_OPERAND (expr, 0), build_non_dependent_expr (TREE_OPERAND (expr, 1))); - /* Keep dereferences outside the NON_DEPENDENT_EXPR so lvalue_kind - doesn't need to look inside. */ - if (REFERENCE_REF_P (expr)) - return convert_from_reference (build_non_dependent_expr - (TREE_OPERAND (expr, 0))); - /* If the type is unknown, it can't really be non-dependent */ gcc_assert (TREE_TYPE (expr) != unknown_type_node);