[Bug c++/6424] [DR 339] sizeof() with overload resolution
gdr at integrable-solutions dot net
gcc-bugzilla@gcc.gnu.org
Mon Aug 9 17:02:00 GMT 2004
------- 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
More information about the Gcc-bugs
mailing list