better-enums icon indicating copy to clipboard operation
better-enums copied to clipboard

Compilation broken with icc (Intel C++ Compiler)

Open danfruehauf opened this issue 5 years ago • 1 comments

Could not get this to compile with Intel C++ Compiler. It results in the following error:

better_enums.cpp(3): error: expression must have a constant value
  BETTER_ENUM(Word, int, Hello, World)

For a workaround, I used:

#if defined(__INTEL_COMPILER)
#define BETTER_ENUMS_NO_CONSTEXPR
#endif

#include <enum.h>

Compiler information:

$ /opt/intel/bin/icc --version
icc (ICC) 19.1.0.166 20191121
Copyright (C) 1985-2019 Intel Corporation.  All rights reserved.

Command line:

/opt/intel/bin/icc -I. -fPIC -g -debug all -x c++ -std=c++14 -c better_enums.cpp -o better_enums.o

Source file:

#include <enum.h>

BETTER_ENUM(Word, int, Hello, World)

int main(int argc, char** argv)
{
}

danfruehauf avatar Jun 03 '20 02:06 danfruehauf

Thanks. If you'd like to upstream this, we can add the detection macro to enum.h.

aantron avatar Jun 08 '20 14:06 aantron