From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16038 invoked by alias); 18 Oct 2004 17:50:54 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 16028 invoked from network); 18 Oct 2004 17:50:53 -0000 Received: from unknown (HELO mail.codesourcery.com) (65.74.133.9) by sourceware.org with SMTP; 18 Oct 2004 17:50:53 -0000 Received: (qmail 3552 invoked from network); 18 Oct 2004 17:50:53 -0000 Received: from 82-32-50-9.cable.ubr07.azte.blueyonder.co.uk (HELO codesourcery.com) (nathan@82.32.50.9) by mail.codesourcery.com with RC4-MD5 encrypted SMTP; 18 Oct 2004 17:50:53 -0000 Message-ID: <41740275.7060903@codesourcery.com> Date: Mon, 18 Oct 2004 17:51:00 -0000 From: Nathan Sidwell Organization: Codesourcery LLC User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.4) Gecko/20030624 MIME-Version: 1.0 To: lerdsuwa@users.sourceforge.net CC: gcc-patches@gcc.gnu.org Subject: Re: [C++] My unreviewed patch References: In-Reply-To: Content-Type: text/plain; charset=us-ascii; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2004-10/txt/msg01509.txt.bz2 Kriang Lerdsuwanakij wrote: > Hi > > The following patch of mine is still not reviewed: > > http://gcc.gnu.org/ml/gcc-patches/2004-09/msg00557.html > > It implements a missing friend feature (mentioned in section > 14.5.3/6) I intended to have in GCC 4.0. Looks ok apart from some issues with the diagnostic text. Can you use the new %qD and related quoted printing formatters? + if (parm_list + && !comp_template_parms (DECL_TEMPLATE_PARMS (tmpl), parm_list)) + { + if (complain & tf_error) + error ("template parameter not match"); + return error_mark_node; + } Something with more context would be better cp_error "template parameters do not match template" cp_error_at "declared here", tmpl It's a pity we can't actuall print out the mismatching template parameters. ! decl = lookup_member (ctype, TYPE_IDENTIFIER (friend_type), ! 0, true); ! if (!decl) ! { ! error ("cannot find `%T'", friend_type); ! return; ! } ! if (template_member_p && !DECL_CLASS_TEMPLATE_P (decl)) ! { ! error ("cannot find template `%T'", friend_type); ! return; ! } ! if (!template_member_p && (TREE_CODE (decl) != TYPE_DECL ! || !CLASS_TYPE_P (TREE_TYPE (decl)))) ! { ! error ("cannot find type `%T'", friend_type); ! return; ! } These would be better as something like "%qT is not a member of %qT", friend_type, ctype that way the user gets a clue as to where the compiler was looking. ok with those changes. If you want to run the diagnostics by me, feel free to do so. nathan -- Nathan Sidwell :: http://www.codesourcery.com :: CodeSourcery LLC nathan@codesourcery.com :: http://www.planetfall.pwp.blueyonder.co.uk