OSDN Git Service

PR c++/30849
[pf3gnuchains/gcc-fork.git] / gcc / testsuite / g++.dg / parse / crash12.C
1 // { dg-do compile }
2
3 // Origin: Martin von Loewis <martin@v.loewis.de>
4
5 // PR c++/157: Incorrect type/template decision in function parameter.
6
7 template <class _Tp> class auto_ptr {};
8 template <class _Tp>
9 class counted_ptr
10 {
11 public:
12   counted_ptr(::auto_ptr<_Tp>& __a);            // { dg-error "candidate" }
13   ::auto_ptr<_Tp> auto_ptr();
14 };
15
16 template <class _Tp>
17 inline counted_ptr<_Tp>::counted_ptr(class auto_ptr& __a) // { dg-error "required|not match|template" }
18 {
19 }
20
21 template <class _Tp>
22 inline class auto_ptr<_Tp> counted_ptr<_Tp>::auto_ptr() 
23 {
24 }