[flang][cuda] Adapt ExternalNameConversion to work in gpu module (#117039)
[llvm-project.git] / clang / test / AST / cxx2c-variadic-friends.cpp
blobfc84e7346fe0364a951267812ab3862748e442e3
1 // RUN: %clang_cc1 -fsyntax-only -ast-dump -std=c++2c %s | FileCheck %s
2 // RUN: %clang_cc1 -ast-print -std=c++2c %s | FileCheck %s --check-prefix=PRINT
3 // RUN: %clang_cc1 -emit-pch -std=c++2c -o %t %s
4 // RUN: %clang_cc1 -x c++ -std=c++2c -include-pch %t -ast-dump-all /dev/null
6 struct S;
7 template <typename> struct TS; // #template
9 // CHECK-LABEL: CXXRecordDecl {{.*}} struct Friends
10 // PRINT-LABEL: struct Friends {
11 struct Friends {
12 // CHECK: FriendDecl {{.*}} 'int'
13 // CHECK-NEXT: FriendDecl {{.*}} 'long'
14 // PRINT-NEXT: friend int;
15 // PRINT-NEXT: friend long;
16 friend int, long;
18 // CHECK-NEXT: FriendDecl {{.*}} 'int'
19 // CHECK-NEXT: FriendDecl {{.*}} 'long'
20 // CHECK-NEXT: FriendDecl {{.*}} 'char'
21 // PRINT-NEXT: friend int;
22 // PRINT-NEXT: friend long;
23 // PRINT-NEXT: friend char;
24 friend int, long, char;
26 // CHECK-NEXT: FriendDecl {{.*}} 'S'
27 // PRINT-NEXT: friend S;
28 friend S;
30 // CHECK-NEXT: FriendDecl {{.*}} 'S'
31 // CHECK-NEXT: FriendDecl {{.*}} 'S'
32 // CHECK-NEXT: FriendDecl {{.*}} 'S'
33 // PRINT-NEXT: friend S;
34 // PRINT-NEXT: friend S;
35 // PRINT-NEXT: friend S;
36 friend S, S, S;
38 // CHECK-NEXT: FriendDecl
39 // CHECK-NEXT: ClassTemplateDecl {{.*}} friend TS
40 // PRINT-NEXT: friend template <typename> struct TS;
41 template <typename> friend struct TS;
44 namespace specialisations {
45 template<class T>
46 struct C {
47 template<class U> struct Nested;
50 struct N {
51 template<class U> class C;
54 // CHECK-LABEL: ClassTemplateDecl {{.*}} Variadic
55 // PRINT-LABEL: template <typename ...Pack> struct Variadic {
56 template <typename ...Pack> struct Variadic {
57 // CHECK: FriendDecl {{.*}} 'Pack'...
58 // CHECK-NEXT: FriendDecl {{.*}} 'long'
59 // CHECK-NEXT: FriendDecl {{.*}} 'Pack'...
60 // PRINT-NEXT: friend Pack...;
61 // PRINT-NEXT: friend long;
62 // PRINT-NEXT: friend Pack...;
63 friend Pack..., long, Pack...;
65 // CHECK-NEXT: FriendDecl {{.*}} 'TS<Pack>'...
66 // PRINT-NEXT: friend TS<Pack>...;
67 friend TS<Pack>...;
70 // CHECK-LABEL: ClassTemplateDecl {{.*}} S2
71 // PRINT-LABEL: template <class ...Ts> struct S2 {
72 template<class ...Ts> struct S2 {
73 // CHECK: FriendDecl {{.*}} 'class C<Ts>':'C<Ts>'...
74 // PRINT-NEXT: friend class C<Ts>...;
75 friend class C<Ts>...;
77 // CHECK-NEXT: FriendDecl {{.*}} 'class N::C<Ts>':'C<Ts>'...
78 // PRINT-NEXT: friend class N::C<Ts>...
79 friend class N::C<Ts>...;