[Bug target/37808] [4.4 Regression]: Revision 141067 breaks Linux/x86

2008-10-12 Thread gcc-bugzilla at daryl dot haresign dot com


--- Comment #4 from gcc-bugzilla at daryl dot haresign dot com  2008-10-12 
16:57 ---
(In reply to comment #3)
> Created an attachment (id=16485)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=16485&action=view) [edit]
> possible patch to fix the problem
> 
> I am pretty sure that this fixes it, but i need to do more testing.
> 
> kenny
> 

I too had this ICE. The patch seems to make it work nicely.


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37808



[Bug c++/43663] New: Can't take a const-ref to a bit field

2010-04-06 Thread gcc-bugzilla at daryl dot haresign dot com
Given the code below, gcc emits the following error:

error: attempt to take address of bit-field structure member 'MyClass::field1'

This compiles fine with Sun's CC, IBM's xlC, and Comeau. The C++ 2003 standard
mentions in 9.6p2 that a non-const reference can't be bound to a bit field, but
that a const reference can be (although it's actually bound to a temporary
initialized with a copy of the bit field rather than the field itself) so I
expect the below code to work fine.

// Code
class MyClass
{
public:
  MyClass() { field1 = 0; };
  int field1 : 4;
};

int main()
{
  MyClass myClass;

  const int &fieldRef1 = myClass.field1;

  return 0;
}


-- 
   Summary: Can't take a const-ref to a bit field
   Product: gcc
   Version: 4.3.2
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: gcc-bugzilla at daryl dot haresign dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=43663