Debian Codegraph @

gcc/testsuite/g++.dg/template/array10.C

raw
1 // Copyright (C) 2005 Free Software Foundation, Inc.
2 // Contributed by Nathan Sidwell 5 Jan 2005 <[email protected]>
3
4 // PR 19270: ICE
5 // Origin: Ralf Wildenhues <[email protected]>
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 }