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++/6424] [DR 339] sizeof() with overload resolution


------- 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


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