From patchwork Tue Sep 20 14:19:26 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Carlini X-Patchwork-Id: 115551 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]) by ozlabs.org (Postfix) with SMTP id 8CC811007D1 for ; Wed, 21 Sep 2011 00:20:47 +1000 (EST) Received: (qmail 11051 invoked by alias); 20 Sep 2011 14:20:39 -0000 Received: (qmail 11038 invoked by uid 22791); 20 Sep 2011 14:20:37 -0000 X-SWARE-Spam-Status: No, hits=-1.8 required=5.0 tests=AWL, BAYES_00, RCVD_IN_DNSWL_NONE X-Spam-Check-By: sourceware.org Received: from smtp208.alice.it (HELO smtp208.alice.it) (82.57.200.104) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 20 Sep 2011 14:20:19 +0000 Received: from [192.168.1.4] (79.53.82.102) by smtp208.alice.it (8.5.124.08) id 4DE64DF109BF051D; Tue, 20 Sep 2011 16:20:11 +0200 Message-ID: <4E78A0EE.7050707@oracle.com> Date: Tue, 20 Sep 2011 16:19:26 +0200 From: Paolo Carlini User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:6.0.2) Gecko/20110907 Thunderbird/6.0.2 MIME-Version: 1.0 To: Jason Merrill CC: "gcc-patches@gcc.gnu.org" Subject: Re: [C++ Patch] PR 50454 References: <4E788271.7030009@oracle.com> <4E78912A.9080603@redhat.com> <4E7898F3.70400@oracle.com> In-Reply-To: <4E7898F3.70400@oracle.com> X-IsSubscribed: yes 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 On 09/20/2011 03:45 PM, Paolo Carlini wrote: > On 09/20/2011 03:12 PM, Jason Merrill wrote: >> No, I think we want to complain about __int128 when -pedantic unless >> we're in a system header, as C does. The right fix is to move the >> __int128 code out of the if (unsigned_p || ...) block, and to >> suppress the pedwarn when in_system_header. > Ok, I'll do it... As a preview, something as simple as the below appears to do what we want. I'll test it later with testcases (I think we want two: one testing sane error messages for a normal run of the testsuite; one testing the in_system_header suppression with the snippet included as a *.h), repost... Thanks, Paolo. Index: decl.c =================================================================== --- decl.c (revision 179007) +++ decl.c (working copy) @@ -8640,6 +8640,10 @@ grokdeclarator (const cp_declarator *declarator, ctype = NULL_TREE; + if (explicit_int128 && pedantic && ! in_system_header) + pedwarn (input_location, OPT_pedantic, + "ISO C++ does not support %<__int128%> for %qs", name); + /* Now process the modifiers that were specified and check for invalid combinations. */ @@ -8695,22 +8699,6 @@ grokdeclarator (const cp_declarator *declarator, if (flag_pedantic_errors) ok = 0; } - if (explicit_int128) - { - if (int128_integer_type_node == NULL_TREE) - { - error ("%<__int128%> is not supported by this target"); - ok = 0; - } - else if (pedantic) - { - pedwarn (input_location, OPT_pedantic, - "ISO C++ does not support %<__int128%> for %qs", - name); - if (flag_pedantic_errors) - ok = 0; - } - } } /* Discard the type modifiers if they are invalid. */