From 8adaafcf039d470993d1969069231b20fe67b460 Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Thu, 21 Apr 2011 00:28:06 -0400 Subject: [PATCH] re PR c++/48594 (Rejects valid with pointer-to-member in template) PR c++/48594 * decl2.c (build_offset_ref_call_from_tree): Move non-dependency of object outside condition. From-SVN: r172807 --- gcc/cp/ChangeLog | 4 ++++ gcc/cp/decl2.c | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index ed9871973bc..eae80e3ae11 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,9 @@ 2011-04-20 Jason Merrill + PR c++/48594 + * decl2.c (build_offset_ref_call_from_tree): Move + non-dependency of object outside condition. + PR c++/48657 * decl.c (cp_finish_decl): Simplify template handling. diff --git a/gcc/cp/decl2.c b/gcc/cp/decl2.c index 882bbf9f88e..a9c24556167 100644 --- a/gcc/cp/decl2.c +++ b/gcc/cp/decl2.c @@ -4081,9 +4081,9 @@ build_offset_ref_call_from_tree (tree fn, VEC(tree,gc) **args) parameter. That must be done before the FN is transformed because we depend on the form of FN. */ make_args_non_dependent (*args); + object = build_non_dependent_expr (object); if (TREE_CODE (TREE_TYPE (fn)) == METHOD_TYPE) { - object = build_non_dependent_expr (object); if (TREE_CODE (fn) == DOTSTAR_EXPR) object = cp_build_addr_expr (object, tf_warning_or_error); VEC_safe_insert (tree, gc, *args, 0, object); -- 2.30.2