This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/16319] Template behaves differently with pointers depending on their source
- From: "dgr24 at drexel dot edu" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 1 Jul 2004 20:13:31 -0000
- Subject: [Bug c++/16319] Template behaves differently with pointers depending on their source
- References: <20040701192216.16319.dgr24@drexel.edu>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- Additional Comments From dgr24 at drexel dot edu 2004-07-01 20:13 -------
Subject: Re: Template behaves differently with pointers
depending on their source
Thanks, and sorry for the false alarm.
bangerth at dealii dot org wrote:
> ------- Additional Comments From bangerth at dealii dot org 2004-07-01 20:03 -------
> The compiler is correct:
> &a[0]
> is a temporary variable of type int*; you can't bind it to
> a reference of type T&, i.e. int*&.
>
> In the two other instances you give, you pass a variable rather
> than a temporary to the reference argument, which the compiler correctly
> allows.
>
> W.
>
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16319