This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/13963] gcc rejects array of unknown bounds as parameter of function template specialization
- From: "austern at apple dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 1 Feb 2004 23:10:05 -0000
- Subject: [Bug c++/13963] gcc rejects array of unknown bounds as parameter of function template specialization
- References: <20040201194206.13963.austern@apple.com>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From austern at apple dot com 2004-02-01 23:10 -------
Subject: Re: gcc rejects array of unknown bounds as parameter of function template specialization
On Feb 1, 2004, at 11:58 AM, pinskia at gcc dot gnu dot org wrote:
>
> ------- Additional Comments From pinskia at gcc dot gnu dot org
> 2004-02-01 19:58 -------
> The mangled symbol ICC produces is _Z1hIA0_iEvT_ which corresponds to
> "void h<int [0]>(int [0])"
> which does not take your theory of "int[] should be treated as a
> synonym for int*".
Mangled names (especially of templates) aren't a good guide to how the
compiler interprets function types. Remember that the mangled name of
a template must keep track of the template argument exactly as written,
because it needs to account for specializations and such: template
parameters can be used for other things than just functino parameters,
and the section of the standard that I quoted refers only to
adjustments on function parameters.
Here's a better test: ask icc what it thinks is the type of the
function template specialization h<int[]>. If you apply typeid to
h<int[]>, icc gives you "FvPiE".
And, of course, the test that began all this is that gcc thinks that
h<int[]>(A) is illegal while icc accepts it. Based on my reading of
the standard (see above), I believe that icc is right and gcc is wrong.
Does anyone have an argument from the standard that says that gcc's
behavior is right?
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=13963