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]

Re: Static member template bug?


On Mon, 2 Feb 1998, Mark Mitchell wrote about a problem submitted by
William S. Lear <rael@zopyra.com>:

  struct foo {
      template <typename T, int N>
      static T* array_end(T(&array)[N]) { return &array[N]; }
  };

  main(int ac, char* av[]) {
      int i[] = {1,2,3,4,5,6,7};
      int* e = foo::array_end(i);
  }

Mark wrote:
> Alexandre wrote:
>> I've just tested it with egcs-980129 on Solaris 2.[56]; it won't work,
>> same error :-(
> Well, the good news is that the patches I submitted aren't in that
> snapshot, so they still might fix the problem.  Would you be so kind
> as to remember this mail, and try it again in the next snapshot?

Sorry, Mark -- With egcs-2.91.07 980205 (actually CVS from 980209) on
sparc-sun-solaris2.6 I still get 

  x.cc: In function `int main(int, char **)':
  x.cc:8: no matching function for call to `foo::array_end (int[7])'
  x.cc:3: candidates are: foo::array_end<int, 7>(int (&)[7])

Gerald
-- 
Gerald Pfeifer (Jerry)      Vienna University of Technology
pfeifer@dbai.tuwien.ac.at   http://www.dbai.tuwien.ac.at/~pfeifer/




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