This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/6424] [DR 339] sizeof() with overload resolution
- From: "gdr at integrable-solutions dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 9 Aug 2004 17:02:07 -0000
- Subject: [Bug c++/6424] [DR 339] sizeof() with overload resolution
- References: <20020423071601.6424.jens.maurer@gmx.net>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From gdr at integrable-solutions dot net 2004-08-09 17:02 -------
Subject: Re: [DR 339] sizeof() with overload resolution
"bangerth at dealii dot org" <gcc-bugzilla@gcc.gnu.org> writes:
| Ah, ok, what you quote Mark says makes sense.
|
| > Yes, but you must be able to define those two functions in two different
| > translation units, instantiate them, and link the whole program without
| > getting a symbol conflict.
|
| But that assumes that the two signatures I mentioned actually refer to
| two different functions. However, I don't see why that should be so, though
| answering that question is completely off-topic for this PR and we shouldn't
| do it here.
Consider
template<int I, int J>
Y<I+J> f(X<I>, X<J>); // #1
template<int I, int J>
Y<I-J> f(X<I>, X<J>); // #2
C++ standard says that #1 and #2 declare different function templates.
Consider the instantiations you get with I = 0 and J = 0.
-- Gaby
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=6424