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