------- Additional Comments From geoffk at gcc dot gnu dot org 2005-04-26 06:53 ------- Here's the same thing with overloaded functions, causing a wrong-code error. If the last definition of 'bar' is commented out, the testcase passes, but otherwise not.
template <class T> int func(T & x) { return bar (x); } int bar(const int & x) { return x; } extern "C" void abort (); int main (void) { int x = 3; if (func<int>(x) != 3) abort (); } int bar (int &x) { return x + 3; } -- What |Removed |Added ---------------------------------------------------------------------------- Keywords| |wrong-code Known to fail| |3.3 4.0.0 Summary|g++ doesn't diagnose |g++ instantiates templates |instantiation of template |at the wrong place |that uses incomplete type | http://gcc.gnu.org/bugzilla/show_bug.cgi?id=16635