icc give an error when using a constexpr function in the context of a method function template, though the same function is correctly recognized as a constexpr in other contexts.
I appended an example below. The code compiles fine with g++ and clang++ and this looks distinct from the other constexpr bug I submitted yesterday.
#include
template
struct MySequence {};
template
constexpr int getconst(const MySequence& arg) {
return 1;
}
struct A {
template
void f() {
}
};
using MySeq = MySequence;
int main() {
std::array an_array; //this works fine
A a;
a.f(); //fails
return 0;
}
The error given is:
icc -std=c++11 -I ~/proj/echo/k_array/include/ main.cpp
main.cpp(23): error: expression must have a constant value
a.f(); //fails
^
main.cpp(23): error: no instance of function template "getconst" matches the argument list
argument types are: ()
a.f(); //fails
^
main.cpp(23): error: no instance of function template "A::f" matches the argument list
object type is: A
a.f(); //fails
^
compilation aborted for main.cpp (code 2)