I am trying to compile the following code with icpc 16.0.3. And I am getting an internal assertion failure error:
Internal error: assertion failed at: "shared/cfe/edgcpfe/decl_spec.c", line 9392
Here is a minimal sample code to re-produce it (and also a workaround that I am currently using)
static constexpr char wizard = "Gandalf";
constexpr char MiddleEarth::wizard;
template <typename T> struct Numenor
static constexpr char king = "pharazon";
/* static const char king; */ // workaround
template <typename T>
constexpr char Numenor<T>::king;
/* template <typename T> */
/* const char Numenor<T>::king = "pharazon"; */
int main(int argc, char *argv)
std::cout << "The greatest wizard is " << MiddleEarth::wizard << std::endl; // works
std::cout << "The greatest king is " << Numenor<int>::king << std::endl; // fails return 0;
I cannot reproduce this assertion failure with our latest 16.0 compiler.
I'm pretty sure this was fixed on 5/10 by the fix for DPD20038225 which allows a flexible array member type as a constexpr variable.
16.0 update 4 should available soon so please confirm that it is fixed.
Sorry for the inconvenience.