This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/11540] Redefinition of default arguments allowed for template functions
- From: "bangerth at dealii dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 16 Jul 2003 14:02:42 -0000
- Subject: [Bug c++/11540] Redefinition of default arguments allowed for template functions
- References: <20030716081310.11540.philippe.haution@mines-paris.org>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
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 |RESOLVED
Resolution| |INVALID
------- Additional Comments From bangerth at dealii dot org 2003-07-16 14:02 -------
The code is legal: first, there is only one definition (but two declarations),
so the one-definition rule is inapplicable. Besides a violation of the ODR
does not require a diagonstic.
On the other hand, 8.6.3/4 specifically allows your case, saying that
default arguments defined in different scopes have completely independent
values.
W.