Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compilation broken with icc (Intel C++ Compiler) #85

Open
danfruehauf opened this issue Jun 3, 2020 · 1 comment
Open

Compilation broken with icc (Intel C++ Compiler) #85

danfruehauf opened this issue Jun 3, 2020 · 1 comment

Comments

@danfruehauf
Copy link

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)
{
}
@aantron
Copy link
Owner

aantron commented Jun 8, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants