1 // RUN: %clang_cc1 -ast-print -std=c++14 %s | FileCheck %s
2
3 namespace ns {
4
5 struct Wrapper {
6 class Inner {
7 Inner();
8 Inner(int);
9 ~Inner();
10
11 void operator += (int);
12
13 template<typename T>
14 void member();
15
16 static void staticMember();
17
18 operator int();
19
20 operator ns::Wrapper();
21 // CHECK: operator ns::Wrapper()
22 };
23 };
24
Inner()25 Wrapper::Inner::Inner() { }
26 // CHECK: Wrapper::Inner::Inner()
27
operator +=(int)28 void Wrapper::Inner::operator +=(int) { }
29 // CHECK: void Wrapper::Inner::operator+=(int)
30
31 }
32
Inner(int)33 ns::Wrapper::Inner::Inner(int) { }
34 // CHECK: ns::Wrapper::Inner::Inner(int)
35
~Inner()36 ns::Wrapper::Inner::~Inner() { }
37 // CHECK: ns::Wrapper::Inner::~Inner()
38
39 template<typename T>
member()40 void ::ns::Wrapper::Inner::member() { }
41 // CHECK: template <typename T> void ::ns::Wrapper::Inner::member()
42
operator int()43 ns::Wrapper::Inner::operator int() { return 0; }
44 // CHECK: ns::Wrapper::Inner::operator int()
45
operator ::ns::Wrapper()46 ns::Wrapper::Inner::operator ::ns::Wrapper() { return ns::Wrapper(); }
47 // CHECK: ns::Wrapper::Inner::operator ::ns::Wrapper()
48
49 namespace ns {
50
staticMember()51 void Wrapper::Inner::staticMember() { }
52 // CHECK: void Wrapper::Inner::staticMember()
53
54 }
55
56 template<int x, typename T>
57 class TemplateRecord {
58 void function();
59 template<typename U> void functionTemplate(T, U);
60 };
61
62 template<int x, typename T>
function()63 void TemplateRecord<x, T>::function() { }
64 // CHECK: template <int x, typename T> void TemplateRecord<x, T>::function()
65
66 template<int x, typename T>
67 template<typename U>
functionTemplate(T,U)68 void TemplateRecord<x, T>::functionTemplate(T, U) { }
69 // CHECK: template <int x, typename T> template <typename U> void TemplateRecord<x, T>::functionTemplate(T, U)
70
71 template<>
72 class TemplateRecord<0, int> {
73 void function();
74 template<typename U> void functionTemplate(int, U);
75 };
76
function()77 void TemplateRecord<0, int>::function() { }
78 // CHECK: void TemplateRecord<0, int>::function()
79
80 template<typename U>
functionTemplate(int,U)81 void TemplateRecord<0, int>::functionTemplate(int, U) { }
82 // CHECK: template <typename U> void TemplateRecord<0, int>::functionTemplate(int, U)
83
84 template<typename T>
85 struct OuterTemplateRecord {
86 template<typename U>
87 struct Inner {
88 void function();
89 };
90 };
91
92 template<typename T>
93 template<typename U>
function()94 void OuterTemplateRecord<T>::Inner<U>::function() { }
95 // CHECK: template <typename T> template <typename U> void OuterTemplateRecord<T>::Inner<U>::function()
96