- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
I just came across a rather weird behaviour of the Intel C++ Composer XE2013, SP1 on Windows. I managed to reduce it to the following simple test program:
[cpp]
template<int A>
constexpr int foo(int b) { return A==b ? A : 0; }
template<int A> std::array<int,foo<1>(A)> bar() {
std::cout << "hello" << std::endl;
}
int main() {
bar<1>();
}
[/cpp]
When I want to compile this on windows I get the following error message: "error : function call must have a constant value in a constant expression". However I believe that the code is correct, at least I was able to compile it on linux with clang 3.3 and g++ 4.8.1 without any problems.
Is my code actually c++11 conform or is it a bug in the Intel compiler?
For completeness I have attached the above source code to this message...
Thanks in advance,
Raffael
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes indeed this does appear to be a bug in our compiler in non GNU compatibility modes.
I have entered this into our internal bug tracking database as DPD200248495. Thanks for bringing it to our attention.
Judy

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