Intel compiler: icpc (ICC) 17.0.2 20170213
g++: g++ (GCC) 5.4.0
clang++: clang version 3.5.2
The following code compiles with g++ and clang++ but not with the intel compiler (using -std=c++14):
using tuple_type = decltype(std::make_tuple(3)); constexpr tuple_type const_tuple0(std::make_tuple(3)); constexpr tuple_type const_tuple1 {std::make_tuple(3)}; constexpr tuple_type const_tuple2 = std::make_tuple(3);
With c++14 we have the possibility to generate and modify compile-time tuples. Unfortunately the intel compiler doesn't seem to like this and complains with
error: expression must have a constant value
for all three statements. Further investigation showed that any constexpr function returning a tuple won't compile. Returning user-defined constexpr classes from constexpr functions works. So there seems to be a problem in returning constexpr tuples.
Link Copied
I can reproduce the errors with 17.0 but it compiles cleanly with 18.0 (currently in beta). Would you be able to use that instead?
For more complete information about compiler optimizations, see our Optimization Notice.