public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug other/29515]  New: [reject-valid] error: forming reference to reference type X.
@ 2006-10-19 11:53 pluto at agmk dot net
  2006-10-19 11:55 ` [Bug other/29515] " pluto at agmk dot net
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: pluto at agmk dot net @ 2006-10-19 11:53 UTC (permalink / raw)
  To: gcc-bugs

comeau reports no error, and with stlport5 testcase works fine.

$ g++ -I/usr/include/stlport main.cpp -o main -lstlport && ./main
Hello 1
Hello 2

with libstdc++ i get:

$ g++ main.cpp -o main && ./main

/usr/include/c++/4.1.2/bits/stl_function.h: In instantiation of
&#8216;std::binder2nd<std::pointer_to_binary_function<int, const std::string&,
void> >&#8217;:
main.cpp:13:   instantiated from here
/usr/include/c++/4.1.2/bits/stl_function.h:435: error: forming reference to
reference type &#8216;const std::string&&#8217;
/usr/include/c++/4.1.2/bits/stl_function.h: In function
&#8216;std::binder2nd<_Operation> std::bind2nd(const _Operation&, const _Tp&)
[with _Operation = std::pointer_to_binary_function<int, const std::string&,
void>, _Tp = std::basic_string<char, std::char_traits<char>,
std::allocator<char> >]&#8217;:
main.cpp:13:   instantiated from here
/usr/include/c++/4.1.2/bits/stl_function.h:455: error: no matching function for
call to &#8216;std::binder2nd<std::pointer_to_binary_function<int, const
std::string&, void> >::binder2nd(const std::pointer_to_binary_function<int,
const std::string&, void>&, const std::basic_string<char,
std::char_traits<char>, std::allocator<char> >&)&#8217;
/usr/include/c++/4.1.2/bits/stl_function.h:429: note: candidates are:
std::binder2nd<std::pointer_to_binary_function<int, const std::string&, void>
>::binder2nd(const std::binder2nd<std::pointer_to_binary_function<int, const
std::string&, void> >&)


-- 
           Summary: [reject-valid] error: forming reference to reference
                    type X.
           Product: gcc
           Version: 4.1.2
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: other
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: pluto at agmk dot net
GCC target triplet: x86_64-linux


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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug other/29515] [reject-valid] error: forming reference to reference type X.
  2006-10-19 11:53 [Bug other/29515] New: [reject-valid] error: forming reference to reference type X pluto at agmk dot net
@ 2006-10-19 11:55 ` pluto at agmk dot net
  2006-10-19 13:11 ` [Bug libstdc++/29515] " pcarlini at suse dot de
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: pluto at agmk dot net @ 2006-10-19 11:55 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #1 from pluto at agmk dot net  2006-10-19 11:54 -------
Created an attachment (id=12461)
 --> (http://gcc.gnu.org/bugzilla/attachment.cgi?id=12461&action=view)
testcase


-- 


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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug libstdc++/29515] error: forming reference to reference type X.
  2006-10-19 11:53 [Bug other/29515] New: [reject-valid] error: forming reference to reference type X pluto at agmk dot net
  2006-10-19 11:55 ` [Bug other/29515] " pluto at agmk dot net
@ 2006-10-19 13:11 ` pcarlini at suse dot de
  2006-10-19 14:52 ` pinskia at gcc dot gnu dot org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: pcarlini at suse dot de @ 2006-10-19 13:11 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #2 from pcarlini at suse dot de  2006-10-19 13:10 -------
This is a well knows issue with the current standard binders, see, for example:

  http://gcc.gnu.org/ml/libstdc++/2000-06/msg00210.html

It is possible to extend the implementation, but the real way to go is moving
to the new generalized bind facility, which will be in C++0x and we are already
providing as part of our tr1 delivery. It would be (modulo tr1 namespace
decorations...):

  bind(std::ptr_fun( print ), _1, str)


-- 

pcarlini at suse dot de changed:

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


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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug libstdc++/29515] error: forming reference to reference type X.
  2006-10-19 11:53 [Bug other/29515] New: [reject-valid] error: forming reference to reference type X pluto at agmk dot net
  2006-10-19 11:55 ` [Bug other/29515] " pluto at agmk dot net
  2006-10-19 13:11 ` [Bug libstdc++/29515] " pcarlini at suse dot de
@ 2006-10-19 14:52 ` pinskia at gcc dot gnu dot org
  2006-10-19 14:52 ` pinskia at gcc dot gnu dot org
  2006-10-19 23:29 ` pcarlini at suse dot de
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-10-19 14:52 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #4 from pinskia at gcc dot gnu dot org  2006-10-19 14:52 -------
To close as a dup of bug 7412.

*** This bug has been marked as a duplicate of 7412 ***


-- 

pinskia at gcc dot gnu dot org changed:

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


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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug libstdc++/29515] error: forming reference to reference type X.
  2006-10-19 11:53 [Bug other/29515] New: [reject-valid] error: forming reference to reference type X pluto at agmk dot net
                   ` (2 preceding siblings ...)
  2006-10-19 14:52 ` pinskia at gcc dot gnu dot org
@ 2006-10-19 14:52 ` pinskia at gcc dot gnu dot org
  2006-10-19 23:29 ` pcarlini at suse dot de
  4 siblings, 0 replies; 6+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2006-10-19 14:52 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #3 from pinskia at gcc dot gnu dot org  2006-10-19 14:51 -------
Actually this is valid C++ via DR 106.
Reopening to ...


-- 

pinskia at gcc dot gnu dot org changed:

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


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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug libstdc++/29515] error: forming reference to reference type X.
  2006-10-19 11:53 [Bug other/29515] New: [reject-valid] error: forming reference to reference type X pluto at agmk dot net
                   ` (3 preceding siblings ...)
  2006-10-19 14:52 ` pinskia at gcc dot gnu dot org
@ 2006-10-19 23:29 ` pcarlini at suse dot de
  4 siblings, 0 replies; 6+ messages in thread
From: pcarlini at suse dot de @ 2006-10-19 23:29 UTC (permalink / raw)
  To: gcc-bugs



------- Comment #5 from pcarlini at suse dot de  2006-10-19 23:29 -------
Ah, interesting! Therefore, if I understand correctly DR 106, when the C++
front-end will implement the resolution, this kind of bind2nd usage will
magically start working without changing at all the library... On the other
hand, Bjarne' observation in DR 106 is also interesting, because maintains that
the library is mainly at fault for the binders... and this is already fixed in
tr1::bind! Making progress everywhere!


-- 


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


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2006-10-19 23:29 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-10-19 11:53 [Bug other/29515] New: [reject-valid] error: forming reference to reference type X pluto at agmk dot net
2006-10-19 11:55 ` [Bug other/29515] " pluto at agmk dot net
2006-10-19 13:11 ` [Bug libstdc++/29515] " pcarlini at suse dot de
2006-10-19 14:52 ` pinskia at gcc dot gnu dot org
2006-10-19 14:52 ` pinskia at gcc dot gnu dot org
2006-10-19 23:29 ` pcarlini at suse dot de

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).