This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/16963] Ambiguity? Seems implausible


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]