Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Tarun_A_
Beginner
116 Views

Intel 16.0.4 compiler error for std::enable_if

Hi,

   template <typename T, decltype(T::a)* = nullptr>
   bool DoCheck1(T t) { return false; }

   template <typename T, decltype(T::b)* = nullptr>
   bool DoCheck1(T t) { return false; }

   template <typename T, typename std::enable_if<true, decltype(T::a)>* = nullptr>
   bool DoCheck2(T t) { return false; }

   template <typename T, typename std::enable_if<true, decltype(T::b)>* = nullptr>
   bool DoCheck2(T t) { return false; }

Both above versions should have same behaviour, but icc 16.0.4 on Linux gives the following compilation error for DoCheck2 -

error: redefinition of default argument
     template <typename T, typename std::enable_if<true, decltype(T::b)>* = nullptr>

Is this expected behaviour or a bug?

Regards,

Tarun

0 Kudos
4 Replies
Judith_W_Intel
Employee
116 Views

 

This is fixed in 17.0 and 18.0.

 

Tarun_A_
Beginner
116 Views

Hi Judith, thanks for the reply.

I don't have >= 16.0.4 at the moment, but i tried it in Compiler Explorer (https://godbolt.org/) with icc 17.0, gives me the same error.

 

 

Judith_W_Intel
Employee
116 Views

 

The 17.0 compiler that is being used by this tool  is the initial release of 17.0 (date of 20160721).

This bug was fixed in Feb 2017 so it should be fixed in the most recent 17.0 update.

Judy

Tarun_A_
Beginner
116 Views

Thanks Judy.
 

Reply