This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
typeof throws away the reference
- From: Jari Petter Sundell <jaris at student dot matnat dot uio dot no>
- To: gcc at gcc dot gnu dot org
- Date: Fri, 28 Jan 2005 15:48:20 +0100 (CET)
- Subject: typeof throws away the reference
Compiling the following on g++-3.3 and 3.5-tree-ssa does not give a
"could not convert `0' to ` int&'" for either of the assignments. Why
doesn't typeof preserve the reference?
int& f();
int main() {
int& a = f();
typeof(a) r = 0;
typeof(f()) s = 0;
}
Rakshasa
Furu-Furu-Furu Moon!