1// RUN: %clang_cc1 -fsyntax-only -verify %s
2struct X0 {
3  X0 f1();
4  X0 f2();
5};
6
7template<typename T>
8struct X1 {
9  X1<T>(int);
10  (X1<T>)(float);
11  X1 f2();
12  X1 f2(int);
13  X1 f2(float);
14};
15
16// Error recovery: out-of-line constructors whose names have template arguments.
17template<typename T> X1<T>::X1<T>(int) { } // expected-error{{out-of-line constructor for 'X1' cannot have template arguments}}
18template<typename T> (X1<T>::X1<T>)(float) { } // expected-error{{out-of-line constructor for 'X1' cannot have template arguments}}
19
20// Error recovery: out-of-line constructor names intended to be types
21X0::X0 X0::f1() { return X0(); } // expected-error{{qualified reference to 'X0' is a constructor name rather than a type wherever a constructor can be declared}}
22
23struct X0::X0 X0::f2() { return X0(); }
24
25template<typename T> X1<T>::X1<T> X1<T>::f2() { } // expected-error{{qualified reference to 'X1' is a constructor name rather than a template name wherever a constructor can be declared}}
26template<typename T> X1<T>::X1<T> (X1<T>::f2)(int) { } // expected-error{{qualified reference to 'X1' is a constructor name rather than a template name wherever a constructor can be declared}}
27template<typename T> struct X1<T>::X1<T> (X1<T>::f2)(float) { }
28