Static member template bug?
Mark Mitchell
mmitchell@usa.net
Sun Feb 1 23:08:00 GMT 1998
>>>>> "William" == William S Lear <rael@zopyra.com> writes:
William> I am running egcs-1.0.1 (egcs-2.90.23 980102) on both
William> Sparc Solaris 2.6 and Linux 2.0.27.
William> The following program fails to compile:
William> struct foo { template <typename T, int N> static T*
William> array_end(T(&array)[N]) { return &array[N]; } };
William> main(int ac, char* av[]) { int i[] = {1,2,3,4,5,6,7};
William> int* e = foo::array_end(i); }
William> % g++ t.cc t.cc: In function `int main(int, char **)':
William> t.cc:8: no matching function for call to `foo::array_end
William> (int[7])' t.cc:3: candidates are: foo::array_end<int,
William> 7>(int (&)[7])
This might well be fixed in the latest bits. I just recently submitted
some fixes for static member templates, and there have been many
template fixes since 1.0.1. If someone on the list, with access to a
Solaris box, would try this example, I would appreciate it.
--
Mark Mitchell mmitchell@usa.net
Stanford University http://www.stanford.edu
More information about the Gcc-bugs
mailing list