- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The following code compiles fine with clang and gcc but gives this error with icc:
icc -std=c++11 problem.cpp
problem.cpp(12): error: expression must have a constant value
, typename std::enable_if<MyCheck<T>{}>::type
^
compilation aborted for problem.cpp (code 2)
#include <type_traits>
template<class T>
struct MyCheck {
constexpr operator bool() const {
return sizeof(T) > sizeof(int);
}
};
template<
class T
, typename std::enable_if<MyCheck<T>{}, int>::type
>
void f() {
}
int main() {
return 0;
}
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi rnickb,
Thank you for your test case. I've produced the error on my machine. I'm entering it to our problem-tracking database. Engineering team will look into it soon.
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi rnickb,
This issue has been resolved in 16.0 compiler. FYI.
Thanks.

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