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++/21515] problem with template and template function compilation in a namespace


------- Additional Comments From bangerth at dealii dot org  2005-05-12 17:49 -------
You can't do this: 
  template<typename T> 
  std::ostream & std::operator<< (std::ostream &, a::A<T> const &); 
If you want to overload something in namespace std, you have to open that 
namespace, put the declaration in it, and close it again. If you do this 
everything is fine, i.e. like so: 
 
namespace std 
{ 
  template<typename T> 
  ostream & operator<< (ostream &, a::A<T> const &); 
} 
 
The fact that we don't reject the declaration is a bug in gcc in itself, 
for which I'll open a PR in a minute. 
 
W. 

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|                            |INVALID


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


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