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++/11540] Redefinition of default arguments allowed for template functions


PLEASE REPLY TO gcc-bugzilla@gcc.gnu.org ONLY, *NOT* gcc-bugs@gcc.gnu.org.

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=11540


bangerth at dealii dot org changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
     Ever Confirmed|                            |1
   Last reconfirmed|0000-00-00 00:00:00         |2003-07-16 14:39:52
               date|                            |


------- Additional Comments From bangerth at dealii dot org  2003-07-16 14:39 -------
Um, why? The namespace is closed and then opened again. Isn't this two
different scopes?

Alas, you have a point -- sorry for being so quick in closing the PR. 
I made a couple of more experiments. We don't get a warning when I don't
close and reopen the namespace. On the other hand, I _do_ get a warning
when the function is not a template, with or without closing the
namespace in between. So this has to do with when default arguments
are parsed for templates. I remember writing a comment about exactly
this in one of our other PRs, but I can't find it :-( The story of
that PR was that default arguments are really only parsed at the
point of _instantiation_ of the template -- but that would be clearly
too late here, unless we parsed the default arguments of _all_ the
declarations we have seen so far for a function, and made sure that
they match.

W.


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