PR c++/86728 - C variadic generic lambda.
[official-gcc.git] / gcc / testsuite / g++.dg / template / new1.C
blob63ee2f924d106144ebe67d708ec2a8e553f7c6ae
1 // { dg-do run }
2 // { dg-options "-O2" }
4 // Copyright (C) 2004 Free Software Foundation, Inc.
5 // Contributed by Nathan Sidwell 2 Dec 2004 <nathan@codesourcery.com>
7 // PR 18318. ICE with template new[]
8 // Origin:Elliot Hughes <enh@jessies.org>
9 // Andrew Pinski <pinskia@gcc.gnu.org>
11 struct Aint
13   ~Aint ();
14   Aint ();
17 Aint::Aint () {}
18 Aint::~Aint () {}
20 static int count;
22 template <class T>
23 struct A
25   unsigned Blksize() const;
26   
27   void f()
28   {
29     new T[Blksize()];
30   }
33 template <class T> unsigned A<T>::Blksize () const
35   count++;
36   return 1;
39 int main ()
41   A<Aint> a;
42   a.f();
43   
44   return count != 1;