From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 24759 invoked by alias); 8 Apr 2011 15:45:30 -0000 Received: (qmail 24731 invoked by uid 22791); 8 Apr 2011 15:45:29 -0000 X-SWARE-Spam-Status: No, hits=-6.3 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,SPF_HELO_PASS,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 08 Apr 2011 15:45:16 +0000 Received: from int-mx01.intmail.prod.int.phx2.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p38FjGgF017476 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 8 Apr 2011 11:45:16 -0400 Received: from [127.0.0.1] ([10.3.113.14]) by int-mx01.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p38FjF7m016070; Fri, 8 Apr 2011 11:45:15 -0400 Message-ID: <4D9F2D8B.1010507@redhat.com> Date: Fri, 08 Apr 2011 15:45:00 -0000 From: Jason Merrill User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.15) Gecko/20110307 Fedora/3.1.9-0.39.b3pre.fc14 Lightning/1.0b2 Thunderbird/3.1.9 MIME-Version: 1.0 To: Rodrigo Rivas CC: Jonathan Wakely , gcc-patches List Subject: Re: [C++0x] Range-based for statements and ADL References: <4D8A2403.5050708@redhat.com> <4D90A209.2020508@redhat.com> <4D94B85F.1030603@redhat.com> In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2011-04/txt/msg00645.txt.bz2 Looks good, just a couple of tweaks: On 04/06/2011 07:22 PM, Rodrigo Rivas wrote: > + error ("range-based % expression must have complete type"); > + error ("range-based % expression has an % member " > + "but not a %"); Let's give the type of the range initializer in these error messages. > +static tree > +cp_parser_range_for_member_function (tree range, tree identifier) > +{ > + tree member, instance, fn; > + > + member = finish_class_member_access_expr (range, identifier, > + false, tf_warning_or_error); > + if (member == error_mark_node) > + return error_mark_node; > + > + if (TREE_CODE (member) == COMPONENT_REF) > + { > + instance = TREE_OPERAND (member, 0); > + fn = TREE_OPERAND (member, 1); > + } > + else > + fn = NULL_TREE; > + > + if (fn && BASELINK_P (fn)) > + return build_new_method_call (instance, fn, > + NULL, NULL, LOOKUP_NORMAL, > + NULL, tf_warning_or_error); > + else > + { > + tree res; > + VEC(tree,gc) *vec; > + > + vec = make_tree_vector (); > + res = finish_call_expr (member, &vec, > + /*disallow_virtual=*/false, > + /*koenig_p=*/false, > + tf_warning_or_error); > + release_tree_vector (vec); > + return res; > + } > +} Instead of handling this difference here, let's teach finish_call_expr to handle a COMPONENT_REF around a BASELINK. Jason