summaryrefslogtreecommitdiff
path: root/test/Modules/merge-static-locals.cpp
blob: 37ae22ee38a385aa5291132f0a0de32a64ebb298 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// RUN: %clang_cc1 -std=c++17 -fmodules -verify %s
// expected-no-diagnostics

#pragma clang module build A
module A {}
#pragma clang module contents
#pragma clang module begin A
template<int*> struct X {};
auto get() { static int n; return X<&n>(); }
using A = decltype(get());
#pragma clang module end
#pragma clang module endbuild

#pragma clang module build B
module B {}
#pragma clang module contents
#pragma clang module begin B
template<int*> struct X {};
auto get() { static int n; return X<&n>(); }
using B = decltype(get());
#pragma clang module end
#pragma clang module endbuild

#pragma clang module import A
#pragma clang module import B
using T = A;
using T = B;