99#line 1 "pure2-function-body-reflection.cpp2"
1010
1111#line 2 "pure2-function-body-reflection.cpp2"
12+ namespace xyzzy {
13+
14+ #line 7 "pure2-function-body-reflection.cpp2"
1215class test ;
1316
17+ #line 81 "pure2-function-body-reflection.cpp2"
18+ }
19+
1420
1521// === Cpp2 type definitions and function declarations ===========================
1622
1723#line 1 "pure2-function-body-reflection.cpp2"
1824
1925#line 2 "pure2-function-body-reflection.cpp2"
26+ namespace xyzzy {
27+
28+ // This function will be visible as a namespace member while reflecting on xyzzy::test
29+ auto sample_function_before_type () -> void;
30+
2031class test
2132 {
2233 public: [[nodiscard]] static auto one_liner (cpp2::impl::in<double > a, cpp2::impl::in<double > b, cpp2::impl::in<double > c) -> decltype(auto );
2334struct return_list_ret { double r; float s; std::string t; };
2435
2536
2637
27- #line 6 "pure2-function-body-reflection.cpp2"
38+ #line 11 "pure2-function-body-reflection.cpp2"
2839 public: [[nodiscard]] static auto return_list () -> return_list_ret;
2940using branches_ret = double ;
3041
3142
32- #line 14 "pure2-function-body-reflection.cpp2"
43+ #line 19 "pure2-function-body-reflection.cpp2"
3344 public: [[nodiscard]] static auto branches (cpp2::impl::in<double > a, cpp2::impl::in<double > b, cpp2::impl::in<double > c) -> branches_ret;
3445
35- #line 29 "pure2-function-body-reflection.cpp2"
46+ #line 34 "pure2-function-body-reflection.cpp2"
3647 public: static auto binary_ops (double & a, cpp2::impl::in<double > b, cpp2::impl::in<double > c) -> void;
3748
38- #line 38 "pure2-function-body-reflection.cpp2"
49+ #line 43 "pure2-function-body-reflection.cpp2"
3950 public: [[nodiscard]] static auto prefix () -> int;
4051
41- #line 48 "pure2-function-body-reflection.cpp2"
52+ #line 53 "pure2-function-body-reflection.cpp2"
4253 public: static auto postfix (double & a) -> void;
4354
44- #line 54 "pure2-function-body-reflection.cpp2"
55+ #line 59 "pure2-function-body-reflection.cpp2"
4556 public: [[nodiscard]] static auto qualified_ids () -> auto;
4657
47- #line 60 "pure2-function-body-reflection.cpp2"
58+ #line 65 "pure2-function-body-reflection.cpp2"
4859 public: static auto loops () -> void;
4960 public: test() = default ;
5061 public: test(test const &) = delete ; /* No 'that' constructor, suppress copy */
5162 public: auto operator =(test const &) -> void = delete ;
5263
5364
54- #line 71 "pure2-function-body-reflection.cpp2"
65+ #line 76 "pure2-function-body-reflection.cpp2"
5566};
5667
68+ // This function will not be visible as a namespace member while reflecting on xyzzy::test
69+ auto sample_function_after_type () -> void;
70+
71+ }
72+
5773auto main () -> int;
5874
5975// === Cpp2 function definitions =================================================
6076
6177#line 1 "pure2-function-body-reflection.cpp2"
6278
63- #line 4 "pure2-function-body-reflection.cpp2"
79+ #line 2 "pure2-function-body-reflection.cpp2"
80+ namespace xyzzy {
81+
82+ #line 5 "pure2-function-body-reflection.cpp2"
83+ auto sample_function_before_type () -> void{}
84+
85+ #line 9 "pure2-function-body-reflection.cpp2"
6486 [[nodiscard]] auto test::one_liner (cpp2::impl::in<double > a, cpp2::impl::in<double > b, cpp2::impl::in<double > c) -> decltype(auto ) { return (a + c) * b; }
6587
66- #line 6 "pure2-function-body-reflection.cpp2"
88+ #line 11 "pure2-function-body-reflection.cpp2"
6789 [[nodiscard]] auto test::return_list () -> return_list_ret
6890
6991 {
7092 cpp2::impl::deferred_init<double > r;
7193 cpp2::impl::deferred_init<float > s;
7294 cpp2::impl::deferred_init<std::string> t;
73- #line 9 "pure2-function-body-reflection.cpp2"
95+ #line 14 "pure2-function-body-reflection.cpp2"
7496 r.construct (42.0 );
7597 s.construct (2 .71828f );
7698 t.construct (" e times pi" );
7799 return { std::move (r.value ()), std::move (s.value ()), std::move (t.value ()) }; }
78100
79- #line 14 "pure2-function-body-reflection.cpp2"
101+ #line 19 "pure2-function-body-reflection.cpp2"
80102 [[nodiscard]] auto test::branches (cpp2::impl::in<double > a, cpp2::impl::in<double > b, cpp2::impl::in<double > c) -> branches_ret
81103
82104 {
83105 double r {3.14159 };
84- #line 17 "pure2-function-body-reflection.cpp2"
106+ #line 22 "pure2-function-body-reflection.cpp2"
85107 if (true ) {
86108 r = r + a;
87109 }
@@ -94,7 +116,7 @@ auto main() -> int;
94116 }return r;
95117 }
96118
97- #line 29 "pure2-function-body-reflection.cpp2"
119+ #line 34 "pure2-function-body-reflection.cpp2"
98120 auto test::binary_ops (double & a, cpp2::impl::in<double > b, cpp2::impl::in<double > c) -> void
99121 {
100122 a -= b * c + (1 << 2 );
@@ -104,7 +126,7 @@ auto main() -> int;
104126 auto z {5 | 6 };
105127 }
106128
107- #line 38 "pure2-function-body-reflection.cpp2"
129+ #line 43 "pure2-function-body-reflection.cpp2"
108130 [[nodiscard]] auto test::prefix () -> int
109131 {
110132 auto a {-1 };
@@ -115,21 +137,21 @@ auto main() -> int;
115137 return cpp2::move (a) + cpp2::move (b);
116138 }
117139
118- #line 48 "pure2-function-body-reflection.cpp2"
140+ #line 53 "pure2-function-body-reflection.cpp2"
119141 auto test::postfix (double & a) -> void
120142 {
121143 auto ptr {&a};
122144 --++*cpp2::impl::assert_not_null (cpp2::move (ptr));
123145 }
124146
125- #line 54 "pure2-function-body-reflection.cpp2"
147+ #line 59 "pure2-function-body-reflection.cpp2"
126148 [[nodiscard]] auto test::qualified_ids () -> auto
127149 {
128150 std::vector<int > v {1 , 2 , 3 };
129151 return CPP2_UFCS (ssize)(cpp2::move (v));
130152 }
131153
132- #line 60 "pure2-function-body-reflection.cpp2"
154+ #line 65 "pure2-function-body-reflection.cpp2"
133155 auto test::loops () -> void
134156 {
135157 std::vector v {1 , 2 , 3 };
@@ -142,6 +164,11 @@ auto main() -> int;
142164 do {std::cout << " plugh\n " ; } while ( false );
143165 }
144166
145- #line 73 "pure2-function-body-reflection.cpp2"
167+ #line 79 "pure2-function-body-reflection.cpp2"
168+ auto sample_function_after_type () -> void{}
169+
170+ }
171+
172+ #line 83 "pure2-function-body-reflection.cpp2"
146173auto main () -> int{}
147174
0 commit comments