- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Tags:
- CC++
- Development Tools
- Intel® C++ Compiler
- Intel® Parallel Studio XE
- Intel® System Studio
- Optimization
- Parallel Computing
- Vectorization
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This is fixed in 17.0 and 18.0.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
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
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks Judy.


- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page