Mercurial > hg > CbC > CbC_gcc
annotate gcc/testsuite/g++.dg/template/array10.C @ 131:84e7813d76e9
gcc-8.2
author | mir3636 |
---|---|
date | Thu, 25 Oct 2018 07:37:49 +0900 |
parents | 04ced10e8804 |
children |
rev | line source |
---|---|
111 | 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 } |