This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/21515] problem with template and template function compilation in a namespace
- From: "bangerth at dealii dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 12 May 2005 17:49:45 -0000
- Subject: [Bug c++/21515] problem with template and template function compilation in a namespace
- References: <20050511182420.21515.marciso@box43.pl>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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