public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/61471] New: redeclaration of default-argument in function template declaration not caught
@ 2014-06-11 10:45 filip.roseen at gmail dot com
  2014-06-11 10:49 ` [Bug c++/61471] " filip.roseen at gmail dot com
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: filip.roseen at gmail dot com @ 2014-06-11 10:45 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 61471
           Summary: redeclaration of default-argument in function template
                    declaration 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 32921
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=32921&action=edit
testcase.cpp

template<class T> void f(int=3);
template<class T> void f(int=3); // ill-formed

int main () { }

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

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

 > A default argument shall not be redefined b a later declaration
 > (not even to the same value).

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

By making `f` a non-template the violating is caught, and appropriate
diagnostics are shown.


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2014-06-11 11:23 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-06-11 10:45 [Bug c++/61471] New: redeclaration of default-argument in function template declaration not caught filip.roseen at gmail dot com
2014-06-11 10:49 ` [Bug c++/61471] " filip.roseen at gmail dot com
2014-06-11 11:15 ` redi at gcc dot gnu.org
2014-06-11 11:23 ` redi at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).