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++/61472] New: added default-argument in later declaration of function template not caught


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

            Bug ID: 61472
           Summary: added default-argument in later declaration of
                    function template not caught
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: filip.roseen at gmail dot com

Created attachment 32923
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=32923&action=edit
testcase.cpp

template<class T> void f(int);
template<class T> void f(int=3);

int main () { }

-----------------------------

`gcc` inaccurately accepts the above snippet, which is violating the following
sentence from [dcl.fct.default]p4:

 > For non-template functions, default arguments can be added in later
 > declarations of a function in the same scope.

-----------------------------


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