OSDN Git Service

PR c++/54858
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / g++.dg / template / wrap1.C
1 // { dg-do compile }
2
3 // Copyright (C) 2002 Free Software Foundation, Inc.
4 // Contributed by Michael Matz 03 Mar 2002 <matz@suse.de>
5 // instance of an actual pattern in 252.eon from SPEC2000
6
7 // The last Wrapper<char> once wasn't completed when applying '='.
8
9 template <class T>
10 class Wrapper {
11   public:
12     Wrapper (T& a);
13     Wrapper (const Wrapper<char>& ref);
14 };
15
16 template <class T>
17 class Element {
18 public:
19   T * operator[](int x);
20 };
21
22 void test()
23 {
24   char bla = 42;
25   Element< Wrapper <unsigned char> > elem;
26   elem[1][1] = Wrapper<char> (bla);
27 }