OSDN Git Service

PR c++/28878
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / g++.dg / template / array10.C
1 // Copyright (C) 2005 Free Software Foundation, Inc.
2 // Contributed by Nathan Sidwell 5 Jan 2005 <nathan@codesourcery.com>
3
4 // PR 19270: ICE
5 // Origin:  Ralf Wildenhues <Ralf.Wildenhues@gmx.de>
6
7 template<class T> struct Vec {
8   T* data;
9   T& operator[](int i) const;
10 };
11
12 template<class T> inline T& Vec<T>::operator[](int i) const
13 {
14   return (&data[0])[i];
15 }
16
17 inline double foo(Vec<double> v)
18 {
19   return v[0];
20 }