Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Rendaw_R_
Beginner
67 Views

Constexpr constructor in constexpr function in template instantiation

The following compiles with g++ 4.8 and clang++ 3.3 but not with the intel compiler: i

[cpp]

struct A { };
template <int> struct B { };

constexpr int Z(A) { return 0; }
B<Z(A())> b;

int main(int, char**) { return 0; }

[/cpp]

Error:

[plain]

fsandrew@localhost 23$/opt/intel/bin/icc -std=c++11 constexprtest.cxx
constexprtest.cxx(5): error: expression must have a constant value
  B<Z(A())> b;
      ^

constexprtest.cxx(5): error: expression must have a constant value
  B<Z(A())> b;
    ^

compilation aborted for constexprtest.cxx (code 2)
[/plain]

I'm running icc version 13.1.3 (gcc version 4.7.0 compatibility), downloaded today.


0 Kudos
1 Reply
Amanda_S_Intel
Employee
67 Views

I tested this against our beta update 1 build and it compiles without errror. This is fixed in the next release.

Reply