public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/33930]  New: [4.3 regression] ambiguous overload in std::stack::push() when using --std=cxx0x
@ 2007-10-28 15:19 a dot chavasse at gmail dot com
  2007-10-28 15:22 ` [Bug c++/33930] " a dot chavasse at gmail dot com
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: a dot chavasse at gmail dot com @ 2007-10-28 15:19 UTC (permalink / raw)
  To: gcc-bugs

g++43 -v:

Using built-in specs.Target: x86_64-unknown-linux-gnuConfigured with:
../gcc/configure --program-suffix=43 --disable-multilib
--enable-languages=c,c++Thread model: posixgcc version 4.3.0 20071028
(experimental) (GCC)

(it was built from svn trunk, revision 129693)

Not sure whether it really counts as a regression since it happens only in
c++0x experimental mode, but it does prevent code that normally compiles to
fail to do so when enabling c++0x mode, like the following snippet:

==========================
#include <stack>

void foo()
{
  std::stack< const int* > somestack;
  int* someptr = 0;
  somestack.push( someptr );
}
==========================
It fails to build with --std=cxx0x with the following error:

rvalref-overload-stdstack.cpp: In function 'void foo()':
rvalref-overload-stdstack.cpp:7: error: call of overloaded 'push(int*&)' is
ambiguous
/usr/local/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/bits/stl_stack.h:188:
note: candidates are: void std::stack<_Tp, _Sequence>::push(const typename
_Sequence::value_type&) [with
_Tp = const int*, _Sequence = std::deque<const int*, std::allocator<const int*>
>]
/usr/local/lib/gcc/x86_64-unknown-linux-gnu/4.3.0/../../../../include/c++/4.3.0/bits/stl_stack.h:193:
note:                 void std::stack<_Tp, _Sequence>::push(typename
_Sequence::value_type&&) [with _Tp =
 const int*, _Sequence = std::deque<const int*, std::allocator<const int*> >]


Here is a c++0x only test case not involving any headers that triggers the same
error with similar overloads:

==========================
typedef const int* type;

void foo( const type& ggg ) {}
void foo( type&& ggg ) {}

void bar( int* someptr )
{
  foo( someptr );
}
==========================


-- 
           Summary: [4.3 regression] ambiguous overload in
                    std::stack::push() when using --std=cxx0x
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: a dot chavasse at gmail dot com


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


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

end of thread, other threads:[~2007-11-05 18:45 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-10-28 15:19 [Bug c++/33930] New: [4.3 regression] ambiguous overload in std::stack::push() when using --std=cxx0x a dot chavasse at gmail dot com
2007-10-28 15:22 ` [Bug c++/33930] " a dot chavasse at gmail dot com
2007-10-28 15:39 ` [Bug c++/33930] [c++0x] " pcarlini at suse dot de
2007-10-30 19:31 ` pcarlini at suse dot de
2007-10-30 23:28 ` [Bug libstdc++/33930] " pcarlini at suse dot de
2007-10-30 23:52 ` a dot chavasse at gmail dot com
2007-10-30 23:56 ` pcarlini at suse dot de
2007-10-31  0:07 ` pcarlini at suse dot de
2007-10-31 22:30 ` pcarlini at suse dot de
2007-11-01  1:24 ` [Bug libstdc++/33930] C++0x overloading problem with const lvalref and rvalref pcarlini at suse dot de
2007-11-05 18:45 ` [Bug c++/33930] " dgregor at gcc dot gnu dot org

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).