- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
icpc version 13.1.3 cannot compile this simple code
[cpp]
enum which { none=0, some=1, all=2 };
template<bool X, bool Y>
struct foo
{
static const which R = X? which::all : which::some;
static const which L = Y? R : which::none;
};
template struct foo<1,0>;
[/cpp]
but complains with the error message
[plain]
test.cc(8): error: a value of type "int" cannot be used to initialize an entity of type "const which"
static const which L = Y? R : which::none;
^
detected during instantiation of class "foo<X, Y> [with X=true, Y=false]" at line 8
[/plain]
Note that both gcc (4.8.1) and clang++ have no issues with this code.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Please update to the latest version of our compiler (14.0) where this problem is fixed. 13.1 is no longer being updated.
thanks
Judy
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
thanks. Yes, I noted that myself (after posting this and after my admin installed 14.0.1). However there are other (minor so far) issues with 14.0.1 ... I will open another thread for that.

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