This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/45253] [c++0x] make_pair / cannot bind bitfield to unsigned&.
- From: "jason at gcc dot gnu dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 11 Aug 2010 13:06:51 -0000
- Subject: [Bug c++/45253] [c++0x] make_pair / cannot bind bitfield to unsigned&.
- References: <bug-45253-7667@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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