Given the program:
enum E : int
{
A, B, C
};
g++ -c test.cpp
works just fine. However, clang++ -c test.cpp
gives the following errors:
test.cpp:1:6: error: ISO C++ forbids forward references to 'enum' types
enum E : int
^
test.cpp:1:8: error: expected unqualified-id
enum E : int
^
2 errors generated.
These error messages don't make any sense to me. I don't see any forward references here.
‑std=c++14
as the default, while Clang still uses‑std=c++98
AFAIK.-std=c++11
is the first thing to try when you use a C++11 feature and get strange error messages