[Bug c++/15011] partial ordering failure?

bangerth at dealii dot org gcc-bugzilla@gcc.gnu.org
Mon Apr 19 16:39:00 GMT 2004


------- Additional Comments From bangerth at dealii dot org  2004-04-19 15:58 -------
The testcase is way to long and filled with stuff that doesn't 
contribute to the problem itself. Here's what it boils down 
to: 
------------- 
template <class T> int f(T); 
template <class T> char* f(T volatile&); 
 
int a; 
char* b = f(a); 
------------- 
This shows the same problem. The code compiled with 2.95, but is 
rejected as ambiguous with 3.2, 3.3, 3.4 and mainline. It compiles 
with icc7 in strict mode, though. I personally don't know whether 
it's legal or not. 
 
(Parenthetically: this constructor in your original code 
    template <class T> 
    X(T&, typename enable_if_same<T const, X const>::type = 0); 
can never be called, since the type of X can never be deduced and 
there is no way to explicitly state template parameters on a  
constructor call. But that doesn't have any impact on the problem 
in this PR.) 

-- 


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



More information about the Gcc-bugs mailing list