This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/15339] [DR217] Adding default arguments to function templates in redeclartions should be forbidden
- From: "giovannibajo at libero dot it" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 8 May 2004 16:32:58 -0000
- Subject: [Bug c++/15339] [DR217] Adding default arguments to function templates in redeclartions should be forbidden
- References: <20040507150259.15339.MichaelLi8195@hotmail.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From giovannibajo at libero dot it 2004-05-08 16:32 -------
This should be diagnosed:
------------------------------------
template<typename> void fun(int);
template<typename> void fun(int = 0) {}
------------------------------------
but it's not. I don't think it's a regression, but can anybody check?
Also, DR217 (TC1 status) says that this is also for regular member function of
class templates. In other words, the following is invalid as well:
------------------------------------
template <class T>
struct S
{
void foo (int);
};
template <class T>
void S<T>::foo (int = 0) { }
------------------------------------
(note that this testcase is already in our testsuite: g++.dg/tc1/dr217.C)
--
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |accepts-invalid
Known to fail| |3.4.0 3.5.0
Summary|function call error |[DR217] Adding default
| |arguments to function
| |templates in redeclartions
| |should be forbidden
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=15339