File tree 8 files changed +161
-0
lines changed 8 files changed +161
-0
lines changed Original file line number Diff line number Diff line change
1
+ #include " flume_test_utils.h"
2
+ struct S {};
3
+
4
+ void foo () {
5
+ N::Friend<S>({});
6
+ }
Original file line number Diff line number Diff line change
1
+ libA_pcm=$( mktemp)
2
+ libB_pcm=$( mktemp)
3
+ lib_core_pcm=$( mktemp)
4
+
5
+ CLANG_BIN=" /usr/local/google/home/usx/build/bin/clang++"
6
+
7
+ ${CLANG_BIN} \
8
+ -fno-exceptions \
9
+ -I . \
10
+ -funsigned-char \
11
+ -fnew-alignment=8 \
12
+ -fcoro-aligned-allocation \
13
+ -fmodule-name=lib_core \
14
+ -Xclang=-fmodule-map-file-home-is-cwd \
15
+ -xc++ \
16
+ -Xclang=-emit-module \
17
+ -pthread \
18
+ -std=gnu++20 \
19
+ -c \
20
+ module-reproducer/lib_core.cppmap \
21
+ -o \
22
+ ${lib_core_pcm} \
23
+ && \
24
+ ${CLANG_BIN} \
25
+ -iquote \
26
+ . \
27
+ -fno-exceptions \
28
+ -funsigned-char \
29
+ -fnew-alignment=8 \
30
+ -fcoro-aligned-allocation \
31
+ -fmodule-name=libB \
32
+ -Xclang=-fmodule-map-file-home-is-cwd \
33
+ -xc++ \
34
+ -Xclang=-emit-module \
35
+ -Xclang=-fmodule-file=${lib_core_pcm} \
36
+ -pthread \
37
+ -std=gnu++20 \
38
+ -c \
39
+ module-reproducer/libB.cppmap \
40
+ -o \
41
+ ${libB_pcm} \
42
+ && \
43
+ ${CLANG_BIN} \
44
+ -fno-exceptions \
45
+ -funsigned-char \
46
+ -fnew-alignment=8 \
47
+ -fcoro-aligned-allocation \
48
+ -fmodule-name=libA \
49
+ -Xclang=-fmodule-map-file-home-is-cwd \
50
+ -xc++ \
51
+ -Xclang=-emit-module \
52
+ -Xclang=-fmodule-file=${libB_pcm} \
53
+ -pthread \
54
+ -std=gnu++20 \
55
+ -c \
56
+ module-reproducer/libA.cppmap \
57
+ -o \
58
+ ${libA_pcm} \
59
+ && \
60
+ ${CLANG_BIN} \
61
+ -iquote \
62
+ . \
63
+ -fno-exceptions \
64
+ -funsigned-char \
65
+ -fnew-alignment=8 \
66
+ -fcoro-aligned-allocation \
67
+ -Xclang=-fmodule-file=${libA_pcm} \
68
+ -pthread \
69
+ -std=gnu++20 \
70
+ module-reproducer/access_boundaries_test.cc
Original file line number Diff line number Diff line change
1
+ #ifndef FLUME_H_
2
+ #define FLUME_H_
3
+
4
+ #include "stream.h"
5
+
6
+ #endif // FLUME_H_
Original file line number Diff line number Diff line change
1
+ #ifndef FLUME_TEST_UTIL_H_
2
+ #define FLUME_TEST_UTIL_H_
3
+
4
+ // #include <string>
5
+ #include < vector>
6
+
7
+ template <typename T>
8
+ class Stream ;
9
+
10
+ namespace N {
11
+ template <typename T>
12
+ std::vector<T> Friend (Stream<T> stream);
13
+ } // namespace N
14
+
15
+ template <typename T>
16
+ class Stream {
17
+ template <typename V>
18
+ friend std::vector<V> N::Friend (Stream<V> stream);
19
+ };
20
+
21
+ namespace N {
22
+
23
+ template <typename T>
24
+ std::vector<T> Friend (Stream<T> stream) {
25
+ std::vector<T> ret;
26
+ return ret;
27
+ }
28
+
29
+ } // namespace N
30
+
31
+ #endif // FLUME_TEST_UTIL_H_
Original file line number Diff line number Diff line change
1
+ module "libA" {
2
+ export *
3
+ module "module-reproducer/flume_test_utils.h" {
4
+ export *
5
+ header "module-reproducer/flume_test_utils.h"
6
+ }
7
+ }
Original file line number Diff line number Diff line change
1
+ module "libB" {
2
+ export *
3
+ module "module-reproducer/flume.h" {
4
+ export *
5
+ header "module-reproducer/flume.h"
6
+ }
7
+ module "module-reproducer/flume_test_utils.h" {
8
+ export *
9
+ header "module-reproducer/flume_test_utils.h"
10
+ }
11
+ }
Original file line number Diff line number Diff line change
1
+ module "lib_core" {
2
+ export *
3
+ module "module-reproducer/stream.h" {
4
+ export *
5
+ header "module-reproducer/stream.h"
6
+ }
7
+ }
Original file line number Diff line number Diff line change
1
+ #ifndef STREAM_H_
2
+ #define STREAM_H_
3
+
4
+ #include < string>
5
+ #include < vector>
6
+
7
+ template <typename T>
8
+ class Stream ;
9
+
10
+ namespace N {
11
+ template <typename T>
12
+ std::vector<T> Friend (Stream<T> stream);
13
+ } // namespace N
14
+
15
+ template <typename T>
16
+ class Stream {
17
+ template <typename V>
18
+ friend std::vector<V> N::Friend (Stream<V> stream);
19
+ };
20
+
21
+ Stream<std::string> Bar () { return Stream<std::string>(); }
22
+
23
+ #endif // STREAM_H_
You can’t perform that action at this time.
0 commit comments