This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Static member template bug?



>>>>> "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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]