[clang][modules] Don't prevent translation of FW_Private includes when explicitly...
[llvm-project.git] / clang / test / AST / ast-print-method-decl.cpp
blob9f5d11260994420012bba979698d26741aa7c9e7
1 // RUN: %clang_cc1 -ast-print -triple i386-linux-gnu %s -o - -std=c++20 | FileCheck %s
3 // CHECK: struct DelegatingCtor1 {
4 struct DelegatingCtor1 {
5 // CHECK-NEXT: DelegatingCtor1();
6 DelegatingCtor1();
8 // CHECK-NEXT: DelegatingCtor1(int) : DelegatingCtor1() {
9 DelegatingCtor1(int) : DelegatingCtor1() {
10 // CHECK-NEXT: }
13 // CHECK-NEXT: };
17 // CHECK: struct DelegatingCtor2 {
18 struct DelegatingCtor2 {
19 // CHECK-NEXT: template <typename Ty> DelegatingCtor2(Ty);
20 template <typename Ty> DelegatingCtor2(Ty);
22 // FIXME: Implicitly specialized method should not be output
23 // CHECK-NEXT: template<> DelegatingCtor2<float>(float);
25 // CHECK-NEXT: DelegatingCtor2(int X) : DelegatingCtor2((float)X) {
26 DelegatingCtor2(int X) : DelegatingCtor2((float)X) {
27 // CHECK-NEXT: }
30 // CHECK-NEXT: };
33 // CHECK: struct DelegatingCtor3 {
34 struct DelegatingCtor3 {
35 // FIXME: template <> should not be output
36 // CHECK: template <> DelegatingCtor3(auto);
37 DelegatingCtor3(auto);
39 // FIXME: Implicitly specialized method should not be output
40 // CHECK: template<> DelegatingCtor3<const char *>(const char *);
42 // CHECK: DelegatingCtor3(int) : DelegatingCtor3("") {
43 DelegatingCtor3(int) : DelegatingCtor3("") {
44 // CHECK-NEXT: }
47 // CHECK-NEXT: };
50 // CHECK: struct CurlyCtorInit {
51 struct CurlyCtorInit {
52 // CHECK-NEXT: struct A {
53 struct A {
54 // CHECK-NEXT: int x;
55 int x;
56 // CHECK-NEXT: };
59 // CHECK-NEXT: A a;
60 A a;
61 // CHECK-NEXT: int i;
62 int i;
64 // FIXME: /*implicit*/(int)0 should not be output
65 // CHECK-NEXT: CurlyCtorInit(int *) : a(), i(/*implicit*/(int)0) {
66 CurlyCtorInit(int *) : a(), i() {
67 // CHECK-NEXT: }
70 // CHECK-NEXT: CurlyCtorInit(int **) : a{}, i{} {
71 CurlyCtorInit(int **) : a{}, i{} {
72 // CHECK-NEXT: }
75 // CHECK-NEXT: CurlyCtorInit(int ***) : a({}), i(0) {
76 CurlyCtorInit(int ***) : a({}), i(0) {
77 // CHECK-NEXT: }
80 // FIXME: Implicit this should not be output
81 // CHECK-NEXT: CurlyCtorInit(int ****) : a({.x = 0}), i(this->a.x) {
82 CurlyCtorInit(int ****) : a({.x = 0}), i(a.x) {
83 // CHECK-NEXT: }
86 // CHECK-NEXT: };
90 // CHECK: struct DefMethodsWithoutBody {
91 struct DefMethodsWithoutBody {
92 // CHECK-NEXT: DefMethodsWithoutBody() = delete;
93 DefMethodsWithoutBody() = delete;
95 // CHECK-NEXT: DefMethodsWithoutBody() = default;
96 ~DefMethodsWithoutBody() = default;
98 // CHECK-NEXT: __attribute__((alias("X"))) void m1();
99 void m1() __attribute__((alias("X")));
101 // CHECK-NEXT: };
105 // ---- Check that implict (non-written) constructor initializers are not output
107 struct ImplicitCtorInit1 {
108 int a;
111 // CHECK: struct ImplicitCtorInit2 : ImplicitCtorInit1 {
112 struct ImplicitCtorInit2 : ImplicitCtorInit1 {
114 // CHECK-NEXT: ImplicitCtorInit2(int *) {
115 ImplicitCtorInit2(int *) {
116 // CHECK-NEXT: }
119 // CHECK-NEXT: ImplicitCtorInit2(int **) : ImplicitCtorInit1() {
120 ImplicitCtorInit2(int **) : ImplicitCtorInit1() {
121 // CHECK-NEXT: }
124 // CHECK-NEXT: };