This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
questions about cv-qualifier for function and references
- From: zhang qingshan <steven dot zhang54373 at gmail dot com>
- To: gcc-help at gcc dot gnu dot org
- Date: Thu, 2 Dec 2010 12:52:47 +0800
- Subject: questions about cv-qualifier for function and references
std(N3126) 8.3.2/1 says that:
Cv-qualified references are ill-formed except when the cv-qualifiers
are introduced through
the use of a typedef (7.1.3) or of a template type argument (14.3), in
which case the cv-qualifiers are ignored.
Why the following code compiled failed on GCC 4.5.0 ?
template <typename T> void foo (T const &);
void baz ();
foo (baz);
while
template <typename T> void foo (T const &);
void baz ();
void Test() {
foo (baz);
}
successfully. Really wired.
another question is: what is cv-qualifier reference ? Your guys told me that:
const int &m; is not a cv-qualifier reference. Could you give me an
example on the cv-qualifier reference ? Thanks.