[Bug c++/61471] redeclaration of default-argument in function template declaration not caught

redi at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Mon Oct 16 10:31:00 GMT 2017


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=61471

--- Comment #4 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Fixed in GCC 5.1.0:

d.cc:2:31: error: redeclaration of ‘template<class T> void f(int)’ may not have
default arguments [-fpermissive]
 template<class T> void f(int=3); // ill-formed
                               ^

If we don't have one, we should add a testcase for this and close it.


More information about the Gcc-bugs mailing list