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 12:19 -------
Subject: Re:  [DR 339] sizeof() with overload resolution

"bangerth at dealii dot org" <gcc-bugzilla@gcc.gnu.org> writes:

| I never quite understood why we have to mangle the return expression 
| for examples like this, i.e. mangle A<sizeof(xxx((T)0))> instead of 
| A<1>. I know that the ABI says so, but can someone point me to a 
| simple explanation _why_ it says so? 

I may be wrong but I believe the idea is that one should be able to
check when two symbols actually refers to the same function.  
For non-template functions, the return type does not really matter 
-- actually that is incorrect, but the only way you could screw things
up is when you violate the ODR rule.

For functions templates, the situation is radically different because
the expressions involved in function template declarations are part of
its signature.  And you can get function templates with "neighboor"
signatures co-existing in the same translation unit, without violating
the ODR.  

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