]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/Modules/merge-lambdas.cpp
Vendor import of clang trunk r351319 (just before the release_80 branch
[FreeBSD/FreeBSD.git] / test / Modules / merge-lambdas.cpp
1 // RUN: %clang_cc1 -fmodules -verify %s -emit-llvm-only
2 // expected-no-diagnostics
3
4 #pragma clang module build A
5 module A {}
6 #pragma clang module contents
7 #pragma clang module begin A
8 template<typename T> auto f() { return []{}; }
9 #pragma clang module end
10 #pragma clang module endbuild
11
12 #pragma clang module build B
13 module B {}
14 #pragma clang module contents
15 #pragma clang module begin B
16 #pragma clang module import A
17 inline auto x1() { return f<int>(); }
18 inline auto z() { return []{}; }
19 inline auto x2() { return z(); }
20 #pragma clang module end
21 #pragma clang module endbuild
22
23 #pragma clang module build C
24 module C {}
25 #pragma clang module contents
26 #pragma clang module begin C
27 #pragma clang module import A
28 inline auto y1() { return f<int>(); }
29 inline auto z() { return []{}; }
30 inline auto y2() { return z(); }
31 inline auto q() { return []{}; }
32 inline auto y3() { return q(); }
33 #pragma clang module end
34 #pragma clang module endbuild
35
36 inline auto q() { return []{}; }
37 inline auto x3() { return q(); }
38
39 #pragma clang module import B
40 #pragma clang module import C
41 using T = decltype(x1);
42 using T = decltype(y1);
43
44 using U = decltype(x2);
45 using U = decltype(y2);
46
47 using V = decltype(x3);
48 using V = decltype(y3);
49
50 #pragma clang module import A
51 void (*p)() = f<int>();