This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
Static member template bug?
- To: "William S. Lear" <rael at zopyra dot com>
- Subject: Static member template bug?
- From: Mark Mitchell <mmitchell at usa dot net>
- Date: Sun, 1 Feb 1998 23:11:38 GMT
- Cc: egcs-bugs at cygnus dot com
- References: <199802020155.TAA12936@zopyra.com>
- Reply-To: mmitchell at usa dot net
>>>>> "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