- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
We're hoping to use icpc in place of gcc 4.5.x. We use a fairly small subset of C++0x, but we're unable to build any code at all, getting error messages upon trying to use enum classes, for example:
int main(int argc, const char* argv[]) {Foo f = Foo::Bar;return 1;}
enum class Foo { Bar, Baz };
int main(int argc, const char* argv[]) {
Foo f = Foo::Bar;
return 1;
}
enum class Foo { Bar, Baz };int main(int argc, const char* argv[]) {Foo f = Foo::Bar;return 1;}
$ icpc -std=c++0x /tmp/foo.cc
/tmp/foo.cc(4): error: name followed by "::" must be a class or namespace name
Foo f = Foo::Bar;
-- are enum classes not implemented? The syntax seems partially supported (if I don't specify the -std=c++0x I get different errors)
More worryingly if I "fix" this I then get a problem where ICC isn't defining GCC's __GXX_EXPERIMENTAL_CXX0X__ macro:
/usr/include/c++/4.5.1/bits/c++0x_warning.h(31): catastrophic error: #error directive: This file requires compiler and library support for the upcoming ISO C++ standard, C++0x. This support is currently experimental, and must be enabled with the -std=c++0x or -std=gnu++0x compiler options.
#error This file requires compiler and library support for the upcoming \\
^
... If I then manually define this constant I get an absolute ton of errors throughout the GCC headers.
I tried with gcc4.4 headers too and get a different set of errors.
What am I doing wrong, or does icpc not support GCC 4.4+ and/or C++0x at all?
Link Copied
2 Replies
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The full support of C++0x enum feature will be in the next release.
Thanks,
Jennifer
Thanks,
Jennifer
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thanks for your response.
I'm glad to hear that you're working on the enum class issue.
As we can work around enum class quite easily (with some code modifications), can you also perhaps elaborate on the other issues I saw too? Specifically the errors in the GCC headers, requiring the special GCC macro to be defined etc?
Thanks, Matt


Reply
Topic Options
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page