• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // RUN: %clang_cc1 -fsyntax-only -verify %s
2 
3 struct 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 
X0()16 X0::X0() { }
17 (X0::X0)(int) { }
18 
X0(X0::f0)19 X0 (X0::f0)(int) { return X0(); }
20 
21 template<typename T>
22 struct 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 
X1()40 template<typename T> X1<T>::X1() { }
41 template<typename T> (X1<T>::X1)(double) { }
f1(int)42 template<typename T> X1<T> X1<T>::f1(int) { return 0; }
X1(X1<T>::f1)43 template<typename T> X1<T> (X1<T>::f1)(type) { return 0; }
44 
45 class 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.
51 typedef int T1;
52 struct X3 {
53   X3::X3(T1()); // expected-error {{extra qualification on member 'X3'}}
54 };
55 
56