Topic: Strange error message
Author: "milan_d" <milandav@yahoo.com>
Date: Mon, 3 Dec 2001 18:46:48 GMT Raw View
template<class T> T f(){ return T(); }
template<class T>
void g(T t = f<T>()){ } // error, says GNU C++
When I compile this code with GNU C++ version 2.95.2,
I get the following error message in line designated above:
sorry, not implemented: initializer contains unrecognized tree code
I know my code is ok, so what does this message mean?
"unrecognized tree code"?
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.research.att.com/~austern/csc/faq.html ]
Author: "Ioannis Vranos" <noicys@no_spam.yahoo.com>
Date: Mon, 3 Dec 2001 19:28:07 GMT Raw View
"milan_d" <milandav@yahoo.com> wrote in message
news:uncju9.bpt.ln@zstux.ita.pwr.wroc.pl...
>
> template<class T> T f(){ return T(); }
> template<class T>
> void g(T t = f<T>()){ } // error, says GNU C++
>
> When I compile this code with GNU C++ version 2.95.2,
> I get the following error message in line designated above:
> sorry, not implemented: initializer contains unrecognized tree code
>
> I know my code is ok, so what does this message mean?
> "unrecognized tree code"?
Your code is ok, you just found some g++ inability.
Ioannis
--
* Ioannis Vranos
* Programming pages: http://www.noicys.f2s.com
* Alternative URL: http://run.to/noicys
======================================= MODERATOR'S COMMENT:
The original article is offtopic, and was approved in error.
Please don't respond to it. The moderators will reject
further responses unless they're directly relevant to the
C++ standard.
---
[ comp.std.c++ is moderated. To submit articles, try just posting with ]
[ your news-reader. If that fails, use mailto:std-c++@ncar.ucar.edu ]
[ --- Please see the FAQ before posting. --- ]
[ FAQ: http://www.research.att.com/~austern/csc/faq.html ]