Bug 41030 - [C++0x] "invalid operands" error doing == on strong enums
Summary: [C++0x] "invalid operands" error doing == on strong enums
Status: RESOLVED DUPLICATE of bug 38064
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 4.4.0
: P3 major
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2009-08-10 21:32 UTC by Reece H. Dunn
Modified: 2009-08-10 21:37 UTC (History)
6 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Reece H. Dunn 2009-08-10 21:32:38 UTC
#!/bin/bash

cat << EOF > test.cpp
enum class foo : char
{
	A,
	B
};

int main()
{
	foo a = foo::A;

	return (a == foo::A) ? 1 : 0;
}
EOF

$ g++-4.4 -std=c++0x test.cpp
test.cpp: In function ‘int main()’:
test.cpp:11: error: invalid operands of types ‘foo’ and ‘foo’ to binary ‘operator==’

$ gcc-4.4 -v
Using built-in specs.
Target: i486-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Ubuntu 4.4-20090418-1ubuntu3' --with-bugurl=file:///usr/share/doc/gcc-4.4/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --enable-shared --enable-multiarch --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.4 --program-suffix=-4.4 --enable-nls --enable-clocale=gnu --enable-libstdcxx-debug --enable-mpfr --enable-objc-gc --enable-targets=all --disable-werror --with-arch-32=i586 --with-tune=generic --enable-checking=release --build=i486-linux-gnu --host=i486-linux-gnu --target=i486-linux-gnu
Thread model: posix
gcc version 4.4.0 20090419 (prerelease) [gcc-4_4-branch revision 146360] (Ubuntu 4.4-20090418-1ubuntu3)
Comment 1 Andrew Pinski 2009-08-10 21:37:56 UTC

*** This bug has been marked as a duplicate of 38064 ***