diff mbox

Fix partial template specialization syntax in wide-int.h

Message ID CAMe9rOoiGRUfF6eQDjXdDXvXX5nxrtgrSYrg665_aOkKQbTsGQ@mail.gmail.com
State New
Headers show

Commit Message

H.J. Lu Oct. 19, 2015, 7:46 p.m. UTC
On Mon, Oct 19, 2015 at 12:39 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
> On Mon, Jul 20, 2015 at 12:15 AM, Mikhail Maltsev <maltsevm@gmail.com> wrote:
>> On 07/17/2015 07:46 PM, Mike Stump wrote:
>>> On Jul 17, 2015, at 2:28 AM, Mikhail Maltsev <maltsevm@gmail.com> wrote:
>>>> The following code (reduced from wide-int.h) is rejected by Intel C++
>>>> Compiler (EDG-based):
>>>
>>> So, could you test this with the top of the tree compiler and file a bug
>>> report against g++ for it, if it seems to not work right.  If that bug report
>>> is rejected, then I’d say file a bug report against clang and EDG.
>>
>> In addition to usual bootstrap+regtest, I also checked that build succeeds with
>> GCC 4.3.6 (IIRC, this is now the minimal required version) as well as with
>> recent GCC snapshot used as stage 0. Committed as r225993.
>> I also filed this bugreport: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66941
>>
>>>> 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?
>>>
>>> Ok.  Does this need to go into the gcc-5 release branch as well?  If so, ok
>>> there too.  Thanks.
>> I think there is no need for it.
>
> It is also need for gcc-5. I am backporting it now.
>

This is what I checked into gcc-5-branch.

Comments

Mike Stump Oct. 21, 2015, 4:48 p.m. UTC | #1
On Oct 19, 2015, at 12:46 PM, H.J. Lu <hjl.tools@gmail.com> wrote:
>>>> Ok.  Does this need to go into the gcc-5 release branch as well?  If so, ok
>>>> there too.  Thanks.
>>> I think there is no need for it.
>> 
>> It is also need for gcc-5. I am backporting it now.
> 
> This is what I checked into gcc-5-branch.

Thanks.
diff mbox

Patch

From 4ae06c3dbe5fb2c4d345060b1ba9cd34b2dc7d37 Mon Sep 17 00:00:00 2001
From: miyuki <miyuki@138bc75d-0d04-0410-961f-82ee72b054a4>
Date: Mon, 20 Jul 2015 05:30:12 +0000
Subject: [PATCH] Fix partial specialization syntax of wide int traits.

gcc/
	* wide-int.h (struct binary_traits): Fix partial specialization syntax.
	(struct int_traits): Likewise.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@225993 138bc75d-0d04-0410-961f-82ee72b054a4
---
 gcc/ChangeLog  |  8 ++++++++
 gcc/wide-int.h | 10 ----------
 2 files changed, 8 insertions(+), 10 deletions(-)

diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 7fb0538..45ae071 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,11 @@ 
+2015-10-19  H.J. Lu  <hongjiu.lu@intel.com>
+
+	Backport from mainline
+	2015-07-20  Mikhail Maltsev  <maltsevm@gmail.com>
+
+	* wide-int.h (struct binary_traits): Fix partial specialization syntax.
+	(struct int_traits): Likewise.
+
 2015-10-16  Richard Sandiford  <richard.sandiford@arm.com>
 
 	PR middle-end/66311
diff --git a/gcc/wide-int.h b/gcc/wide-int.h
index 46f4545..9a71c4f 100644
--- a/gcc/wide-int.h
+++ b/gcc/wide-int.h
@@ -365,21 +365,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 <typename T1, typename T2>
   struct binary_traits <T1, T2, FLEXIBLE_PRECISION, FLEXIBLE_PRECISION>
   {
     typedef widest_int result_type;
   };
 
-  template <>
   template <typename T1, typename T2>
   struct binary_traits <T1, T2, FLEXIBLE_PRECISION, VAR_PRECISION>
   {
     typedef wide_int result_type;
   };
 
-  template <>
   template <typename T1, typename T2>
   struct binary_traits <T1, T2, FLEXIBLE_PRECISION, CONST_PRECISION>
   {
@@ -389,14 +386,12 @@  namespace wi
 			       <int_traits <T2>::precision> > result_type;
   };
 
-  template <>
   template <typename T1, typename T2>
   struct binary_traits <T1, T2, VAR_PRECISION, FLEXIBLE_PRECISION>
   {
     typedef wide_int result_type;
   };
 
-  template <>
   template <typename T1, typename T2>
   struct binary_traits <T1, T2, CONST_PRECISION, FLEXIBLE_PRECISION>
   {
@@ -406,7 +401,6 @@  namespace wi
 			       <int_traits <T1>::precision> > result_type;
   };
 
-  template <>
   template <typename T1, typename T2>
   struct binary_traits <T1, T2, CONST_PRECISION, CONST_PRECISION>
   {
@@ -417,7 +411,6 @@  namespace wi
 			       <int_traits <T1>::precision> > result_type;
   };
 
-  template <>
   template <typename T1, typename T2>
   struct binary_traits <T1, T2, VAR_PRECISION, VAR_PRECISION>
   {
@@ -881,7 +874,6 @@  generic_wide_int <storage>::dump () const
 
 namespace wi
 {
-  template <>
   template <typename storage>
   struct int_traits < generic_wide_int <storage> >
     : public wi::int_traits <storage>
@@ -960,7 +952,6 @@  inline wide_int_ref_storage <SE>::wide_int_ref_storage (const T &x,
 
 namespace wi
 {
-  template <>
   template <bool SE>
   struct int_traits <wide_int_ref_storage <SE> >
   {
@@ -1147,7 +1138,6 @@  public:
 
 namespace wi
 {
-  template <>
   template <int N>
   struct int_traits < fixed_wide_int_storage <N> >
   {
-- 
2.4.3