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++/15542] [3.4/3.5 Regression] operator & and template definitions


------- Additional Comments From bangerth at dealii dot org  2004-05-19 17:29 -------
Indeed, here is a smaller example: 
--------- 
struct S { 
    const char** operator & (); 
}; 
 
template <typename> struct S_T { 
    const char** operator & (); 
}; 
 
template <class T> void foo(T **) {} 
 
template <typename> void templateTest() { 
  S               s; 
  foo(&s); 
   
  S_T<const char> s_t; 
  foo(&s_t); 
} 
------------------- 
 
g/x> /home/bangerth/bin/gcc-3.4-pre/bin/c++ -c x.cc 
x.cc: In function `void templateTest()': 
x.cc:16: error: no matching function for call to `foo(S_T<const char>*&)' 
 
The call foo(&s) goes through, but the call to foo(&s_t) doesn't. This 
may indicate that gcc thinks that it is somehow dependent, even though it 
is not (all template arguments are actually fixed). 
 
W. 

-- 


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


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