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: "bangerth at dealii dot org" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 1 Jul 2004 20:03:36 -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 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.
--
What |Removed |Added
----------------------------------------------------------------------------
Status|UNCONFIRMED |RESOLVED
Resolution| |INVALID
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16319