1// RUN: %clang_cc1 -fsyntax-only -verify %s
2
3struct X0 {
4  struct type { };
5
6  X0();
7  X0(int);
8  (X0)(float);
9  X0 (f0)(int);
10  X0 (f0)(type);
11
12  X0 f1();
13  X0 f1(double);
14};
15
16X0::X0() { }
17(X0::X0)(int) { }
18
19X0 (X0::f0)(int) { return X0(); }
20
21template<typename T>
22struct X1 {
23  struct type { };
24
25  X1<T>();
26  X1<T>(int);
27  (X1<T>)(float);
28  X1(float, float);
29  (X1)(double);
30  X1<T> (f0)(int);
31  X1<T> (f0)(type);
32  X1 (f1)(int);
33  X1 (f1)(type);
34
35  template<typename U> X1(U);
36  X1 f2();
37  X1 f2(int);
38};
39
40template<typename T> X1<T>::X1() { }
41template<typename T> (X1<T>::X1)(double) { }
42template<typename T> X1<T> X1<T>::f1(int) { return 0; }
43template<typename T> X1<T> (X1<T>::f1)(type) { return 0; }
44
45class X2 {
46  X2::X2(); // expected-error {{extra qualification on member 'X2'}}
47};
48
49// We used to parse 'X3::X3' as a member function declaration.
50// DR 1435 and DR 1310 made this invalid.
51typedef int T1;
52struct X3 {
53  X3::X3(T1()); // expected-error {{extra qualification on member 'X3'}}
54};
55
56