[filesystem][spirit] problems with scoped enums with GCC 4.4 in C++0x mode

(forwarding from the Spirit list) As discussed in the thread @ http://www.nabble.com/-Spirit2--Regression-test-failures-on-GCC-4.4-in-C%2B%..., the regression tests for Filesystem and Spirit 2 are pretty much all failing in GCC 4.4 in C++0x mode, due to problems with scoped enums and operator ==. Does anyone have any other ideas about the problem? Thanks, Richard Webb -- View this message in context: http://www.nabble.com/-filesystem--spirit--problems-with-scoped-enums-with-G... Sent from the Boost - Dev mailing list archive at Nabble.com.

On Tue, May 19, 2009 at 6:03 AM, Richard Webb <richard.webb@boldonjames.com> wrote:
(forwarding from the Spirit list)
As discussed in the thread @ http://www.nabble.com/-Spirit2--Regression-test-failures-on-GCC-4.4-in-C%2B%..., the regression tests for Filesystem and Spirit 2 are pretty much all failing in GCC 4.4 in C++0x mode, due to problems with scoped enums and operator ==.
Does anyone have any other ideas about the problem?
It's a bug in GCC 4.4.0. See GCC Bugzilla Bug 38064. http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38064 This little test: enum class color { red, green }; int foo(color c ) { return c == color::red ? 5 : 10; } Compiles fine with Borland 6.10 (which also supports scoped enums) but fails with GCC 4.4.0. I've let one of the GCC developers know privately that this bug is causing us problems. I think the fix is to simply define BOOST_NO_SCOPED_ENUMS for GCC 4.4. I'll change the config file in trunk accordingly. Thanks for the heads up, --Beman

Beman Dawes wrote:
It's a bug in GCC 4.4.0. See GCC Bugzilla Bug 38064. http://gcc.gnu.org/bugzilla/show_bug.cgi?id=38064
This little test:
enum class color { red, green };
int foo(color c ) { return c == color::red ? 5 : 10; }
Compiles fine with Borland 6.10 (which also supports scoped enums) but fails with GCC 4.4.0.
I've let one of the GCC developers know privately that this bug is causing us problems.
I think the fix is to simply define BOOST_NO_SCOPED_ENUMS for GCC 4.4. I'll change the config file in trunk accordingly.
GCC 4.4.1 has been released, and includes the fix for this bug. I think BOOST_NO_SCOPED_ENUMS no longer needs to be defined for 4.4.1 and later? The attached patch to the config file does that. Regards, François

On Thu, Jul 23, 2009 at 6:50 PM, Francois Barel<frabar666@gmail.com> wrote:
I think the fix is to simply define BOOST_NO_SCOPED_ENUMS for GCC 4.4. I'll change the config file in trunk accordingly.
GCC 4.4.1 has been released, and includes the fix for this bug.
I think BOOST_NO_SCOPED_ENUMS no longer needs to be defined for 4.4.1 and later? The attached patch to the config file does that.
Applied. Thanks! I couldn't test it since I don't have 4.4.1 installed, but figured it was low-risk so better to do it now than wait until later. --Beman
participants (3)
-
Beman Dawes
-
Francois Barel
-
Richard Webb