This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/16963] Ambiguity? Seems implausible
- From: "bangerth at dealii dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 10 Aug 2004 14:24:01 -0000
- Subject: [Bug c++/16963] Ambiguity? Seems implausible
- References: <20040810140907.16963.igodard@pacbell.net>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From bangerth at dealii dot org 2004-08-10 14:23 -------
icc rejects the code with the same error, though I must admit that I am
at present at a loss as to why.
A slightly simplified example is this:
---------------------
template <typename T>
struct Foo {
int Bar(T);
};
struct R : public Foo<int>, public Foo<char> {};
int i = R().Bar(1);
---------------------
g/x> /home/bangerth/bin/gcc-3.5-pre/bin/c++ -c x.cc
x.cc:8: error: request for member `Bar' is ambiguous
x.cc:3: error: candidates are: int Foo<T>::Bar(T) [with T = char]
x.cc:3: error: int Foo<T>::Bar(T) [with T = int]
It is true that name lookup happens before argument conversion, but
I can't at present explain why not both functions are found at the
same time and then overload resolution happens.
W.
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16963