This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/31157] New: Bitfield is not promoted
- From: "ismail at pardus dot org dot tr" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 12 Mar 2007 23:02:09 -0000
- Subject: [Bug c++/31157] New: Bitfield is not promoted
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
Following testcase compiles fine with gcc 3.4.6 but not with gcc 4.2.0 20070307
:
----- cut here -----
#include <iostream>
using namespace std;
class Foo
{
public:
Foo() { x=1; y=0; };
unsigned int x:12;
unsigned int y;
};
int main()
{
Foo bar;
max(bar.y,bar.x);
return 0;
}
----- cut here -----
The error is :
max.cpp: In function 'int main()':
max.cpp:17: error: no matching function for call to 'max(unsigned int&, short
unsigned int:12&)'
--
Summary: Bitfield is not promoted
Product: gcc
Version: 4.2.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: ismail at pardus dot org dot tr
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=31157