public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/11940] New: Ambiguous name lookup error regression
@ 2003-08-16 1:45 raimond_merkert at raytheon dot com
2003-08-16 1:55 ` [Bug c++/11940] " pinskia at gcc dot gnu dot org
` (2 more replies)
0 siblings, 3 replies; 4+ messages in thread
From: raimond_merkert at raytheon dot com @ 2003-08-16 1:45 UTC (permalink / raw)
To: gcc-bugs
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11940
Summary: Ambiguous name lookup error regression
Product: gcc
Version: 3.4
Status: UNCONFIRMED
Severity: critical
Priority: P1
Component: c++
AssignedTo: unassigned at gcc dot gnu dot org
ReportedBy: raimond_merkert at raytheon dot com
CC: gcc-bugs at gcc dot gnu dot org
The following code no longer compiles with GCC 3.4 (gcc-3.4-20030813):
cat >> test.cpp <<EOF
#include <vector>
namespace n {
template <class T>
inline void swap (T& x, T& y)
{ T t(x);x=y;y=x; }
struct Y {};
void foo()
{
::std::vector<Y> v1;
::std::vector<Y> v2;
v1.swap(v2);
}
}
EOF
g++ test.cpp -c
This is the error message I'm getting:
/local/gcc-3.4-20030813/lib/gcc/i686-pc-linux-gnu/3.4/../../../../include/c++/3.4/bits/stl_vector.h:
In
member function `void std::vector<_Tp, _Alloc>::swap(std::vector<_Tp,
_Alloc>&) [with _Tp = n::Y, _Alloc = std::allocator<n::Y>]':
test.cpp:14: instantiated from here
/local/gcc-3.4-20030813/lib/gcc/i686-pc-linux-gnu/3.4/../../../../include/c++/3.4/bits/stl_vector.h:730:
error: call
of overloaded `swap(n::Y*&, n::Y*&)' is ambiguous
/local/gcc-3.4-20030813/lib/gcc/i686-pc-linux-gnu/3.4/../../../../include/c++/3.4/bits/stl_algobase.h:119:
note: candidates
are: void std::swap(_Tp&, _Tp&) [with _Tp = n::Y*]
test.cpp:6: note: void n::swap(T&, T&) [with T = n::Y*]
/local/gcc-3.4-20030813/lib/gcc/i686-pc-linux-gnu/3.4/../../../../include/c++/3.4/bits/stl_vector.h:731:
error: call
of overloaded `swap(n::Y*&, n::Y*&)' is ambiguous
/local/gcc-3.4-20030813/lib/gcc/i686-pc-linux-gnu/3.4/../../../../include/c++/3.4/bits/stl_algobase.h:119:
note: candidates
are: void std::swap(_Tp&, _Tp&) [with _Tp = n::Y*]
test.cpp:6: note: void n::swap(T&, T&) [with T = n::Y*]
/local/gcc-3.4-20030813/lib/gcc/i686-pc-linux-gnu/3.4/../../../../include/c++/3.4/bits/stl_vector.h:732:
error: call
of overloaded `swap(n::Y*&, n::Y*&)' is ambiguous
/local/gcc-3.4-20030813/lib/gcc/i686-pc-linux-gnu/3.4/../../../../include/c++/3.4/bits/stl_algobase.h:119:
note: candidates
are: void std::swap(_Tp&, _Tp&) [with _Tp = n::Y*]
test.cpp:6: note: void n::swap(T&, T&) [with T = n::Y*]
I'm fairly sure that the code is correct, because the offending line in
stl_vector actually calls std::swap() and not just swap.
Is this an incorrect application of Koenig lookup?
Code compiles fine with 3.3.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug c++/11940] Ambiguous name lookup error regression
2003-08-16 1:45 [Bug c++/11940] New: Ambiguous name lookup error regression raimond_merkert at raytheon dot com
@ 2003-08-16 1:55 ` pinskia at gcc dot gnu dot org
2003-08-16 11:46 ` [Bug c++/11940] [3.4 Regression] " lerdsuwa at gcc dot gnu dot org
2003-08-17 17:38 ` bangerth at dealii dot org
2 siblings, 0 replies; 4+ messages in thread
From: pinskia at gcc dot gnu dot org @ 2003-08-16 1:55 UTC (permalink / raw)
To: gcc-bugs
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11940
------- Additional Comments From pinskia at gcc dot gnu dot org 2003-08-16 01:55 -------
Most likely the same as bug 11808 or bug 11828.
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug c++/11940] [3.4 Regression] Ambiguous name lookup error regression
2003-08-16 1:45 [Bug c++/11940] New: Ambiguous name lookup error regression raimond_merkert at raytheon dot com
2003-08-16 1:55 ` [Bug c++/11940] " pinskia at gcc dot gnu dot org
@ 2003-08-16 11:46 ` lerdsuwa at gcc dot gnu dot org
2003-08-17 17:38 ` bangerth at dealii dot org
2 siblings, 0 replies; 4+ messages in thread
From: lerdsuwa at gcc dot gnu dot org @ 2003-08-16 11:46 UTC (permalink / raw)
To: gcc-bugs
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11940
lerdsuwa at gcc dot gnu dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |NEW
Ever Confirmed| |1
Keywords| |rejects-valid
Last reconfirmed|0000-00-00 00:00:00 |2003-08-16 11:46:50
date| |
Summary|Ambiguous name lookup error |[3.4 Regression] Ambiguous
|regression |name lookup error regression
------- Additional Comments From lerdsuwa at gcc dot gnu dot org 2003-08-16 11:46 -------
It's a regression in 3.4. Inside vector, std::swap is called.
So n::swap should not be considered here.
^ permalink raw reply [flat|nested] 4+ messages in thread
* [Bug c++/11940] [3.4 Regression] Ambiguous name lookup error regression
2003-08-16 1:45 [Bug c++/11940] New: Ambiguous name lookup error regression raimond_merkert at raytheon dot com
2003-08-16 1:55 ` [Bug c++/11940] " pinskia at gcc dot gnu dot org
2003-08-16 11:46 ` [Bug c++/11940] [3.4 Regression] " lerdsuwa at gcc dot gnu dot org
@ 2003-08-17 17:38 ` bangerth at dealii dot org
2 siblings, 0 replies; 4+ messages in thread
From: bangerth at dealii dot org @ 2003-08-17 17:38 UTC (permalink / raw)
To: gcc-bugs
PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11940
bangerth at dealii dot org changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |DUPLICATE
------- Additional Comments From bangerth at dealii dot org 2003-08-17 17:38 -------
It's a duplicate of 11808
*** This bug has been marked as a duplicate of 11808 ***
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2003-08-17 17:38 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-08-16 1:45 [Bug c++/11940] New: Ambiguous name lookup error regression raimond_merkert at raytheon dot com
2003-08-16 1:55 ` [Bug c++/11940] " pinskia at gcc dot gnu dot org
2003-08-16 11:46 ` [Bug c++/11940] [3.4 Regression] " lerdsuwa at gcc dot gnu dot org
2003-08-17 17:38 ` bangerth at dealii 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).