This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/45253] [c++0x] make_pair / cannot bind bitfield to unsigned&.



------- Comment #2 from jason at gcc dot gnu dot org  2010-08-11 13:06 -------
This result, while unfortunate, is not a bug; template argument deduction only
uses the type and lvalueness of the function argument (unsigned, lvalue) and
therefore deduces the type of __x to be unsigned&.  But an reference cannot
bind to a bitfield, so the call is ill-formed.

You can work around this issue by using the unary + to make the argument an
rvalue:

std::make_pair ( + X::s.addr, true );


-- 

jason at gcc dot gnu dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]