From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 104654 invoked by alias); 17 Jul 2015 09:28:48 -0000 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 Received: (qmail 104634 invoked by uid 89); 17 Jul 2015 09:28:47 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.2 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 X-HELO: fencepost.gnu.org Received: from fencepost.gnu.org (HELO fencepost.gnu.org) (208.118.235.10) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Fri, 17 Jul 2015 09:28:45 +0000 Received: from eggs.gnu.org ([2001:4830:134:3::10]:60777) by fencepost.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1ZG1wh-0007TD-58 for gcc-patches@gnu.org; Fri, 17 Jul 2015 05:28:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZG1wc-0002i0-TS for gcc-patches@gnu.org; Fri, 17 Jul 2015 05:28:42 -0400 Received: from mail-la0-x231.google.com ([2a00:1450:4010:c03::231]:36850) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZG1wc-0002hk-Fr for gcc-patches@gnu.org; Fri, 17 Jul 2015 05:28:38 -0400 Received: by lagw2 with SMTP id w2so57874603lag.3 for ; Fri, 17 Jul 2015 02:28:37 -0700 (PDT) X-Received: by 10.152.22.4 with SMTP id z4mr13713418lae.81.1437125317088; Fri, 17 Jul 2015 02:28:37 -0700 (PDT) Received: from [192.168.123.20] ([77.41.78.126]) by smtp.googlemail.com with ESMTPSA id cy1sm2666201lac.22.2015.07.17.02.28.35 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 17 Jul 2015 02:28:36 -0700 (PDT) Message-ID: <55A8CAC3.60200@gmail.com> Date: Fri, 17 Jul 2015 09:30:00 -0000 From: Mikhail Maltsev User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Icedove/31.7.0 MIME-Version: 1.0 To: gcc-patches Subject: [PATCH] Fix partial template specialization syntax in wide-int.h Content-Type: multipart/mixed; boundary="------------060509080606010100040906" X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2a00:1450:4010:c03::231 X-IsSubscribed: yes X-SW-Source: 2015-07/txt/msg01500.txt.bz2 This is a multi-part message in MIME format. --------------060509080606010100040906 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Content-length: 1017 Hi, all! The following code (reduced from wide-int.h) is rejected by Intel C++ Compiler (EDG-based): $ cat genpreds1_min.cc template class A; template struct B; template struct C; template <> template struct C > { template A > m_fn(T); }; template template A > C >::m_fn (T) { } $ /opt/intel/bin/icpc -c genpreds1_min.cc genpreds1_min.cc(22): error: incomplete type is not allowed C >::m_fn (T) ^ genpreds1_min.cc(22): error: template argument list must match the parameter list C >::m_fn (T) Clang gives the following warning: $ clang++ -c genpreds1_min.cc genpreds1_min.cc:10:1: warning: extraneous template parameter list in template specialization template <> I think that the warning is correct, and "template <>" should not be used here. The attached patch should fix this issue. Bootstrapped and regtested on x86_64-linux. OK for trunk? -- Regards, Mikhail Maltsev --------------060509080606010100040906 Content-Type: text/x-patch; name="part_spec_wi.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="part_spec_wi.patch" Content-length: 2230 diff --git a/gcc/wide-int.h b/gcc/wide-int.h index d8f7b46..6e0275f 100644 --- a/gcc/wide-int.h +++ b/gcc/wide-int.h @@ -360,21 +360,18 @@ namespace wi inputs. Note that CONST_PRECISION and VAR_PRECISION cannot be mixed, in order to give stronger type checking. When both inputs are CONST_PRECISION, they must have the same precision. */ - template <> template struct binary_traits { typedef widest_int result_type; }; - template <> template struct binary_traits { typedef wide_int result_type; }; - template <> template struct binary_traits { @@ -384,14 +381,12 @@ namespace wi ::precision> > result_type; }; - template <> template struct binary_traits { typedef wide_int result_type; }; - template <> template struct binary_traits { @@ -401,7 +396,6 @@ namespace wi ::precision> > result_type; }; - template <> template struct binary_traits { @@ -412,7 +406,6 @@ namespace wi ::precision> > result_type; }; - template <> template struct binary_traits { @@ -876,7 +869,6 @@ generic_wide_int ::dump () const namespace wi { - template <> template struct int_traits < generic_wide_int > : public wi::int_traits @@ -955,7 +947,6 @@ inline wide_int_ref_storage ::wide_int_ref_storage (const T &x, namespace wi { - template <> template struct int_traits > { @@ -1142,7 +1133,6 @@ public: namespace wi { - template <> template struct int_traits < fixed_wide_int_storage > { --------------060509080606010100040906 Content-Type: text/plain; charset=UTF-8; name="part_spec_wi.clog" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="part_spec_wi.clog" Content-length: 236 Z2NjL0NoYW5nZUxvZzoKCjIwMTUtMDctMTcgIE1pa2hhaWwgTWFsdHNldiAg PG1hbHRzZXZtQGdtYWlsLmNvbT4KCgkqIHdpZGUtaW50LmggKHN0cnVjdCBi aW5hcnlfdHJhaXRzKTogRml4IHBhcnRpYWwgc3BlY2lhbGl6YXRpb24gc3lu dGF4LgoJKHN0cnVjdCBpbnRfdHJhaXRzKTogTGlrZXdpc2UuCgo= --------------060509080606010100040906--