[flang][cuda] Adapt ExternalNameConversion to work in gpu module (#117039)
[llvm-project.git] / clang / test / AST / ast-print-out-of-line-func.cpp
blob7d42f1f4037fe7184ebe2c56a8f699e16084c891
1 // RUN: %clang_cc1 -ast-print -std=c++14 %s | FileCheck %s
3 namespace ns {
5 struct Wrapper {
6 class Inner {
7 Inner();
8 Inner(int);
9 ~Inner();
11 void operator += (int);
13 template<typename T>
14 void member();
16 static void staticMember();
18 operator int();
20 operator ns::Wrapper();
21 // CHECK: operator ns::Wrapper()
25 Wrapper::Inner::Inner() { }
26 // CHECK: Wrapper::Inner::Inner()
28 void Wrapper::Inner::operator +=(int) { }
29 // CHECK: void Wrapper::Inner::operator+=(int)
33 ns::Wrapper::Inner::Inner(int) { }
34 // CHECK: ns::Wrapper::Inner::Inner(int)
36 ns::Wrapper::Inner::~Inner() { }
37 // CHECK: ns::Wrapper::Inner::~Inner()
39 template<typename T>
40 void ::ns::Wrapper::Inner::member() { }
41 // CHECK: template <typename T> void ::ns::Wrapper::Inner::member()
43 ns::Wrapper::Inner::operator int() { return 0; }
44 // CHECK: ns::Wrapper::Inner::operator int()
46 ns::Wrapper::Inner::operator ::ns::Wrapper() { return ns::Wrapper(); }
47 // CHECK: ns::Wrapper::Inner::operator ::ns::Wrapper()
49 namespace ns {
51 void Wrapper::Inner::staticMember() { }
52 // CHECK: void Wrapper::Inner::staticMember()
56 template<int x, typename T>
57 class TemplateRecord {
58 void function();
59 template<typename U> void functionTemplate(T, U);
62 template<int x, typename T>
63 void TemplateRecord<x, T>::function() { }
64 // CHECK: template <int x, typename T> void TemplateRecord<x, T>::function()
66 template<int x, typename T>
67 template<typename 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)
71 template<>
72 class TemplateRecord<0, int> {
73 void function();
74 template<typename U> void functionTemplate(int, U);
77 void TemplateRecord<0, int>::function() { }
78 // CHECK: void TemplateRecord<0, int>::function()
80 template<typename U>
81 void TemplateRecord<0, int>::functionTemplate(int, U) { }
82 // CHECK: template <typename U> void TemplateRecord<0, int>::functionTemplate(int, U)
84 template<typename T>
85 struct OuterTemplateRecord {
86 template<typename U>
87 struct Inner {
88 void function();
92 template<typename T>
93 template<typename U>
94 void OuterTemplateRecord<T>::Inner<U>::function() { }
95 // CHECK: template <typename T> template <typename U> void OuterTemplateRecord<T>::Inner<U>::function()