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: VLA inside template functions


-----

Well, it was still there last sunday....

mururoa->more TempGnuDynArray.C 
// Build don't link:
// Origin: Theo Papadopoulo <Theodore.Papadopoulo@sophia.inria.fr>

inline const unsigned& f(unsigned const& a) {
        return a;
}

template <class T>
void
g(const unsigned n)
{
        double D[f(n)];
}

template <class T,class U>
void g(unsigned const int) { }

int main()
{
        g<double>(18);
}

mururoa->g++ TempGnuDynArray.C 
TempGnuDynArray.C: In function `void g (unsigned int) [with T = double]':
TempGnuDynArray.C:20:   instantiated from here
TempGnuDynArray.C:12: invalid type argument of `unary *'
TempGnuDynArray.C:12: size of array has non-integer type
mururoa->g++ -v
Reading specs from /net/home/robotvis/gnu/egcs/lib/gcc-lib/i686-pc-linux-gnu/2.96/specs
gcc version 2.96 20000109 (experimental)

	Theo.

---------------------------------------------------------------
Theodore Papadopoulo
Email: Theodore.Papadopoulo@sophia.inria.fr Tel: (33) 04 92 38 76 01
 --------------------------------------------------------------------



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