From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19389 invoked by alias); 21 Oct 2011 21:20:49 -0000 Received: (qmail 19380 invoked by uid 22791); 21 Oct 2011 21:20:48 -0000 X-SWARE-Spam-Status: No, hits=-6.8 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,SPF_HELO_PASS 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, 21 Oct 2011 21:20:27 +0000 Received: from int-mx02.intmail.prod.int.phx2.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id p9LLKQP9026424 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Fri, 21 Oct 2011 17:20:27 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx02.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id p9LLKQqX020754; Fri, 21 Oct 2011 17:20:26 -0400 Received: from [0.0.0.0] (ovpn-113-169.phx2.redhat.com [10.3.113.169]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id p9LLKOcX023656; Fri, 21 Oct 2011 17:20:25 -0400 Message-ID: <4EA1E218.6060404@redhat.com> Date: Fri, 21 Oct 2011 23:38:00 -0000 From: Jason Merrill User-Agent: Mozilla/5.0 (X11; Linux i686; rv:7.0.1) Gecko/20111001 Thunderbird/7.0.1 MIME-Version: 1.0 To: Tom Tromey CC: Ed Smith-Rowland <3dw4rd@verizon.net>, gcc-patches@gcc.gnu.org Subject: Re: [C++-11] User defined literals References: <1632385954.7660675.1318453113423.JavaMail.root@vznit170070> <4E99F042.3020709@redhat.com> <4EA18271.6060705@verizon.net> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; 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-10/txt/msg02039.txt.bz2 I think we're down to minor cosmetic issues: On 10/21/2011 03:55 PM, Tom Tromey wrote: > There are a few spots like this that are missing a space before an open > paren. > + if (DECL_LANGUAGE(decl) == lang_c) Another one. > - if (warn_cxx0x_compat > - && C_RID_CODE (token->u.value) >= RID_FIRST_CXX0X > - && C_RID_CODE (token->u.value) <= RID_LAST_CXX0X) .... This code doesn't seem to have actually changed, so let's not adjust its whitespace. > + /* Fill in PARMVEC with all of the parameters. */ > + parmvec = make_tree_vec (len); Let's call it 'charvec'; the characters are template arguments, not parameters. > +/* Parse a user-defined numeric constant. returns a call to a user-defined > + literal operator. */ > +static tree > +cp_parser_userdef_numeric_literal (cp_parser *parser) Add a blank line between comment and function. > While looking at the embedded string issue I found that if you apply the suffix of a raw literal to a string it errors as it should but the error complained that there were too many arguments for the function. This was not helpful so I made a nicer error message. > + if (result == error_mark_node) > + error ("invalid string literal prefix %<\"%s\"%> for user-defined" > + " raw literal operator %qD", TREE_STRING_POINTER (value), name); I think that we want a combination of the two errors; the new error doesn't help the user to fix their code as much. It should remind them that for a string literal the function is called with a length argument as well. > + error ("literal operator template %qD has invalid parameter list", > + decl); Similarly, this message should say that the parameter list needs to be > > + > +/* Return true if a user-defined literal operator is a raw operator. */ > + We don't need the extra newline before the comment. Should be ready to go with these tweaks. Jason