1 // RUN: %clang_cc1 -std=c++14 -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
__anonf778b1540102null8 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>(); }
__anonf778b1540202null18 inline auto z() { return []{}; }
x2()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>(); }
__anonf778b1540302null29 inline auto z() { return []{}; }
y2()30 inline auto y2() { return z(); }
__anonf778b1540402null31 inline auto q() { return []{}; }
y3()32 inline auto y3() { return q(); }
33 #pragma clang module end
34 #pragma clang module endbuild
35 
q()36 inline auto q() { return []{}; }
x3()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>();
52