This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/15339] [DR217] Adding default arguments to function templates in redeclartions should be forbidden


------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]