From patchwork Tue Jun 25 12:24:55 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ed Smith-Rowland <3dw4rd@verizon.net> X-Patchwork-Id: 254134 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "localhost", Issuer "www.qmailtoaster.com" (not verified)) by ozlabs.org (Postfix) with ESMTPS id 152B02C0085 for ; Tue, 25 Jun 2013 22:25:23 +1000 (EST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:subject:content-type; q= dns; s=default; b=PNbAoQ5JfPQlZNsVqwbP63VIPVodm6YN57cAe8GzvOpGrL iJ7EgNBo8dtZ5IXzE37A/s7XZ/+3lvvRVFCizQpEazV4Pj7ukEhI42m3/7FS1Z42 cUKfarIWO8arZD9ofJz48RPInQPKJm9VWQCMsotwKubRMDDzGhY3eBM8C8orw= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:subject:content-type; s= default; bh=YhgftMc4lGJYIuiRsEZVF8Qe4r8=; b=R+IFwpO/L03THGMcUGfk x9gBNT9bb+Zv7d2u58yiZBh/VgpsKraU7t4sl4V1i/d+Ubfb0cRONoB+N4H0QZu5 05MARgE7ZQ7LsbJwpdRTpfaS5giaw9SeKLoyM+Vow89n0UpAusZvnzeSeI6O52xF 9N8RwY/vFOVMV7+xrgpiT3U= Received: (qmail 23458 invoked by alias); 25 Jun 2013 12:25:16 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 23446 invoked by uid 89); 25 Jun 2013 12:25:16 -0000 X-Spam-SWARE-Status: No, score=2.6 required=5.0 tests=AWL, BAYES_00, BOTNET, RCVD_IN_DNSWL_NONE, RCVD_IN_HOSTKARMA_NO, RCVD_IN_HOSTKARMA_YE, RP_MATCHES_RCVD, SPF_PASS autolearn=no version=3.3.1 Received: from vms173015pub.verizon.net (HELO vms173015pub.verizon.net) (206.46.173.15) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Tue, 25 Jun 2013 12:25:15 +0000 Received: from [192.168.1.13] ([unknown] [96.244.82.207]) by vms173015.mailsrvcs.net (Sun Java(tm) System Messaging Server 7u2-7.02 32bit (built Apr 16 2009)) with ESMTPA id <0MOY006VD7TM4750@vms173015.mailsrvcs.net> for gcc-patches@gcc.gnu.org; Tue, 25 Jun 2013 07:24:59 -0500 (CDT) Message-id: <51C98C17.5050009@verizon.net> Date: Tue, 25 Jun 2013 08:24:55 -0400 From: Ed Smith-Rowland <3dw4rd@verizon.net> User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130510 Thunderbird/17.0.6 MIME-version: 1.0 To: gcc-patches , Jason Merrill Subject: [C++ PR57640] Explicit call of system literal operator complains about leading underscore Content-type: multipart/mixed; boundary=------------010607090706080502060308 X-Virus-Found: No This little nit was certainly latent all along but was only exposed once we got literal ops into the std library. A user who calls a operator explicitly get yelled at for not having anunderscore. OK after testing completes on x86_64-linux? Ed gcc/cp: 2013-06-25 Ed Smith-Rowland <3dw4rd@verizon.net> PR c++/57640 * parser.c (cp_parser_unqualified_id): Add declarator_p to checks to trigger warning, (cp_literal_operator_id): Remove bogus TODO comment. gcc/testsuite: 2013-06-25 Ed Smith-Rowland <3dw4rd@verizon.net> PR c++/57640 * g++.dg/cpp1y/pr57640.C: New. Index: gcc/cp/parser.c =================================================================== --- gcc/cp/parser.c (revision 200342) +++ gcc/cp/parser.c (working copy) @@ -5000,7 +4999,7 @@ { /* 17.6.3.3.5 */ const char *name = UDLIT_OP_SUFFIX (id); - if (name[0] != '_' && !in_system_header) + if (name[0] != '_' && !in_system_header && declarator_p) warning (0, "literal operator suffixes not preceded by %<_%>" " are reserved for future standardization"); } @@ -12346,7 +12345,6 @@ + strlen (name) + 10); sprintf (buffer, UDLIT_OP_ANSI_FORMAT, name); identifier = get_identifier (buffer); - /*IDENTIFIER_UDLIT_OPNAME_P (identifier) = 1; If we get a flag someday. */ return identifier; } Index: gcc/testsuite/g++.dg/cpp1y/pr57640.C =================================================================== --- gcc/testsuite/g++.dg/cpp1y/pr57640.C (revision 0) +++ gcc/testsuite/g++.dg/cpp1y/pr57640.C (working copy) @@ -0,0 +1,8 @@ +// { dg-options -std=c++1y } +// { dg-do compile } + +#include + +using namespace std::literals::chrono_literals; + +auto blooper = operator"" min(45.0L);