On 11/07/2011 10:45 PM, Jason Merrill wrote:
On 10/26/2011 04:35 PM, Paolo Carlini wrote:
We have that parser->scope is a RECORD_TYPE and postfix_expression is an
INDIRECT_REF.
Ah, OK. I guess we swallow up the namespace while parsing the full nested-name-specifier and it isn't a problem. So I think handling this here should be OK. But why check for ARROW_EXPR? Can't you construct a similar testcase using .?
Ah, very good. I'll investigate that. In the meanwhile I'm applying the below when testing finishes, which indeed, cannot hurt, the code ends-up being a bit cleaner.
I'll deal with 50870.
Excellent.

Paolo.

///////////////////////
2011-11-07  Paolo Carlini  <paolo.carl...@oracle.com>

        * pt.c (tsubst_copy_and_build): Fix qualified_name_lookup_error
        call in case COMPONENT_REF.
Index: cp/pt.c
===================================================================
--- cp/pt.c     (revision 180619)
+++ cp/pt.c     (working copy)
@@ -13741,14 +13741,12 @@ tsubst_copy_and_build (tree t,
        else if (TREE_CODE (member) == SCOPE_REF
                 && TREE_CODE (TREE_OPERAND (member, 1)) == TEMPLATE_ID_EXPR)
          {
-           tree tmpl;
-           tree args;
-
            /* Lookup the template functions now that we know what the
               scope is.  */
-           tmpl = TREE_OPERAND (TREE_OPERAND (member, 1), 0);
-           args = TREE_OPERAND (TREE_OPERAND (member, 1), 1);
-           member = lookup_qualified_name (TREE_OPERAND (member, 0), tmpl,
+           tree scope = TREE_OPERAND (member, 0);
+           tree tmpl = TREE_OPERAND (TREE_OPERAND (member, 1), 0);
+           tree args = TREE_OPERAND (TREE_OPERAND (member, 1), 1);
+           member = lookup_qualified_name (scope, tmpl,
                                            /*is_type_p=*/false,
                                            /*complain=*/false);
            if (BASELINK_P (member))
@@ -13762,7 +13760,7 @@ tsubst_copy_and_build (tree t,
              }
            else
              {
-               qualified_name_lookup_error (object_type, tmpl, member,
+               qualified_name_lookup_error (scope, tmpl, member,
                                             input_location);
                return error_mark_node;
              }

Reply via email to