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 12:19:44 -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 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