From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19132 invoked by alias); 12 May 2005 17:49:50 -0000 Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org Received: (qmail 19084 invoked by uid 48); 12 May 2005 17:49:45 -0000 Date: Thu, 12 May 2005 17:49:00 -0000 Message-ID: <20050512174945.19081.qmail@sourceware.org> From: "bangerth at dealii dot org" To: gcc-bugs@gcc.gnu.org In-Reply-To: <20050511182420.21515.marciso@box43.pl> References: <20050511182420.21515.marciso@box43.pl> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug c++/21515] problem with template and template function compilation in a namespace X-Bugzilla-Reason: CC X-SW-Source: 2005-05/txt/msg01695.txt.bz2 List-Id: ------- Additional Comments From bangerth at dealii dot org 2005-05-12 17:49 ------- You can't do this: template std::ostream & std::operator<< (std::ostream &, a::A 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 ostream & operator<< (ostream &, a::A 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