- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The following code is accepted under gcc 8, gcc 10, clang 10 with `-std=c++17`, and msvc 19.27 with `/std:c++17`:
#include <type_traits>
template <typename ...Ts>
using all_of = std::bool_constant<(Ts::value && ...)>;
template <typename T>
struct bar : std::true_type{};
template <typename ...Ts,
typename = std::enable_if_t<all_of<bar<Ts>...>::value>>
void foo(Ts &&...){}
int main(){
foo(0, 0, 0, 0);
return 0;
}
And possibly any other release of those compilers would accept it too.
Linux64 icc 19.0.1, 21.1.8 and 21.1.9 with flags `-std=c++17` on the other hand rejects this code:
test1.cpp(14): error: no instance of function template "foo" matches the argument list
argument types are: (int, int, int, int)
foo(0, 0, 0, 0);
^
test1.cpp(11): note: this candidate was rejected because at least one template argument could not be deduced
void foo(Ts &&...){}
^
compilation aborted for test1.cpp (code 2)
(And I think other versions of icc would probably have the same bug too)
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Thanks for reaching out to us.
We tried your code and we are able to reproduce this issue. So we are forwarding this issue to the concerned team as it seems like a bug with the ICPC compiler.
Warm Regards,
Abhishek
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I've reported this issue to our FE team.
Thanks,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
This issue is fixed in oneAPI2021.2.
$ icpc -V
Intel(R) C++ Intel(R) 64 Compiler Classic for applications running on Intel(R) 64, Version 2021.2.0 Build 20210228_000000
I am going to close this thread.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page