repo.or.cz
/
llvm-project.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Run DCE after a LoopFlatten test to reduce spurious output [nfc]
[llvm-project.git]
/
clang
/
test
/
Modules
/
ctor.arg.dep.cppm
blob
0e5b1a694f6a5e149c08e7ed25e6a782bd9a2e90
1
// RUN: rm -rf %t
2
// RUN: split-file %s %t
3
// RUN: cd %t
4
//
5
// RUN: %clang_cc1 -std=c++20 %t/A.cppm -I%t -emit-module-interface -o %t/A.pcm
6
// RUN: %clang_cc1 -std=c++20 -fprebuilt-module-path=%t %t/Use.cpp -verify -fsyntax-only
7
//
8
//--- foo.h
9
10
namespace ns {
11
12
struct T {
13
T(void*);
14
};
15
16
struct A {
17
template <typename F>
18
A(F f) : t(&f) {}
19
20
T t;
21
};
22
23
template <typename T>
24
void foo(T) {
25
auto f = [](){};
26
ns::A a(f);
27
}
28
}
29
30
//--- A.cppm
31
module;
32
#include "foo.h"
33
export module A;
34
export namespace ns {
35
using ns::A;
36
using ns::foo;
37
}
38
39
//--- Use.cpp
40
// expected-no-diagnostics
41
import A;
42
void test() {
43
ns::foo(5);
44
}