From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 21287 invoked by alias); 16 Jul 2003 14:39:54 -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 21278 invoked by uid 48); 16 Jul 2003 14:39:53 -0000 Date: Wed, 16 Jul 2003 14:39:00 -0000 Message-ID: <20030716143953.21277.qmail@sources.redhat.com> From: "bangerth at dealii dot org" To: gcc-bugs@gcc.gnu.org In-Reply-To: <20030716081310.11540.philippe.haution@mines-paris.org> References: <20030716081310.11540.philippe.haution@mines-paris.org> Reply-To: gcc-bugzilla@gcc.gnu.org Subject: [Bug c++/11540] Redefinition of default arguments allowed for template functions X-Bugzilla-Reason: CC X-SW-Source: 2003-07/txt/msg01832.txt.bz2 List-Id: PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org. http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11540 bangerth at dealii dot org changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Ever Confirmed| |1 Last reconfirmed|0000-00-00 00:00:00 |2003-07-16 14:39:52 date| | ------- Additional Comments From bangerth at dealii dot org 2003-07-16 14:39 ------- Um, why? The namespace is closed and then opened again. Isn't this two different scopes? Alas, you have a point -- sorry for being so quick in closing the PR. I made a couple of more experiments. We don't get a warning when I don't close and reopen the namespace. On the other hand, I _do_ get a warning when the function is not a template, with or without closing the namespace in between. So this has to do with when default arguments are parsed for templates. I remember writing a comment about exactly this in one of our other PRs, but I can't find it :-( The story of that PR was that default arguments are really only parsed at the point of _instantiation_ of the template -- but that would be clearly too late here, unless we parsed the default arguments of _all_ the declarations we have seen so far for a function, and made sure that they match. W.