From patchwork Tue Sep 20 12:09:21 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Paolo Carlini X-Patchwork-Id: 115513 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 AEA7FB71D7 for ; Tue, 20 Sep 2011 22:10:32 +1000 (EST) Received: (qmail 7890 invoked by alias); 20 Sep 2011 12:10:28 -0000 Received: (qmail 7878 invoked by uid 22791); 20 Sep 2011 12:10:26 -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 smtp204.alice.it (HELO smtp204.alice.it) (82.57.200.100) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 20 Sep 2011 12:10:07 +0000 Received: from [192.168.1.4] (79.53.82.102) by smtp204.alice.it (8.5.124.08) id 4E259C1B050E0F7F; Tue, 20 Sep 2011 14:10:05 +0200 Message-ID: <4E788271.7030009@oracle.com> Date: Tue, 20 Sep 2011 14:09:21 +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: "gcc-patches@gcc.gnu.org" CC: Jason Merrill Subject: [C++ Patch] PR 50454 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 Hi, as I tried to analyze/explain in the audit trail, apparently we are doing something bogus in grokdeclarator wrt unsigned __int128, which leads to the latter being wrongly rejected with -pedantic-errors, at variance with plain __int128 or __int128_t / __uint128_t for that matter. Thus I prepared the below. Tested x86_64-linux. Ok for mainline? Thanks, Paolo. ///////////////////// /cp 2011-09-20 Paolo Carlini PR c++/50454 * decl.c (grokdeclarator): Don't reject unsigned __int128 with -pedantic-errors. /testsuite 2011-09-20 Paolo Carlini PR c++/50454 * g++.dg/ext/int128-1.C: New. Index: testsuite/g++.dg/ext/int128-1.C =================================================================== --- testsuite/g++.dg/ext/int128-1.C (revision 0) +++ testsuite/g++.dg/ext/int128-1.C (revision 0) @@ -0,0 +1,11 @@ +// PR c++/50454 +// { dg-do compile { target int128 } } + +template + struct limits; + +template<> + struct limits<__int128> { }; + +template<> + struct limits { }; Index: cp/decl.c =================================================================== --- cp/decl.c (revision 179004) +++ cp/decl.c (working copy) @@ -8695,22 +8695,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. */