]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - test/Modules/merge-deduced-return.cpp
Vendor import of clang trunk r338150:
[FreeBSD/FreeBSD.git] / test / Modules / merge-deduced-return.cpp
1 // RUN: %clang_cc1 -fmodules -std=c++17 -verify %s
2 // RUN: %clang_cc1 -fmodules -std=c++17 -verify %s -DLOCAL
3 // expected-no-diagnostics
4
5 #pragma clang module build A
6 module A {}
7 #pragma clang module contents
8 #pragma clang module begin A
9 inline auto f() { struct X {}; return X(); }
10 inline auto a = f();
11 #pragma clang module end
12 #pragma clang module endbuild
13
14 #pragma clang module build B
15 module B {}
16 #pragma clang module contents
17 #pragma clang module begin B
18 inline auto f() { struct X {}; return X(); }
19 inline auto b = f();
20 #pragma clang module end
21 #pragma clang module endbuild
22
23 #ifdef LOCAL
24 inline auto f() { struct X {}; return X(); }
25 inline auto b = f();
26 #else
27 #pragma clang module import B
28 #endif
29
30 #pragma clang module import A
31
32 using T = decltype(a);
33 using T = decltype(b);