Clang Project

clang_source_code/test/Modules/merge-static-locals.cpp
1// RUN: %clang_cc1 -std=c++17 -fmodules -verify %s
2// expected-no-diagnostics
3
4#pragma clang module build A
5module A {}
6#pragma clang module contents
7#pragma clang module begin A
8template<int*> struct X {};
9auto get() { static int n; return X<&n>(); }
10using A = decltype(get());
11#pragma clang module end
12#pragma clang module endbuild
13
14#pragma clang module build B
15module B {}
16#pragma clang module contents
17#pragma clang module begin B
18template<int*> struct X {};
19auto get() { static int n; return X<&n>(); }
20using B = decltype(get());
21#pragma clang module end
22#pragma clang module endbuild
23
24#pragma clang module import A
25#pragma clang module import B
26using T = A;
27using T = B;
28