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 
foo(Vec<double> v)17 inline double foo(Vec<double> v)
18 {
19   return v[0];
20 }
21