@@ -14,7 +14,7 @@ namespace ns {
1414#line 7 "pure2-function-body-reflection.cpp2"
1515class test ;
1616
17- #line 81 "pure2-function-body-reflection.cpp2"
17+ #line 88 "pure2-function-body-reflection.cpp2"
1818}
1919
2020
@@ -52,20 +52,20 @@ using branches_ret = double;
5252#line 43 "pure2-function-body-reflection.cpp2"
5353 public: [[nodiscard]] static auto prefix () -> int;
5454
55- #line 53 "pure2-function-body-reflection.cpp2"
55+ #line 55 "pure2-function-body-reflection.cpp2"
5656 public: static auto postfix (double & a) -> void;
5757
58- #line 59 "pure2-function-body-reflection.cpp2"
58+ #line 61 "pure2-function-body-reflection.cpp2"
5959 public: [[nodiscard]] static auto qualified_ids () -> auto;
6060
61- #line 65 "pure2-function-body-reflection.cpp2"
61+ #line 67 "pure2-function-body-reflection.cpp2"
6262 public: static auto loops () -> void;
6363 public: test() = default ;
6464 public: test(test const &) = delete ; /* No 'that' constructor, suppress copy */
6565 public: auto operator =(test const &) -> void = delete ;
6666
6767
68- #line 76 "pure2-function-body-reflection.cpp2"
68+ #line 83 "pure2-function-body-reflection.cpp2"
6969};
7070
7171// This function will not be visible as a namespace member while reflecting on ns::test
@@ -136,45 +136,60 @@ auto sample_function_before_type() -> void{}
136136 {
137137 auto a {-1 };
138138 auto b {+2 };
139+ {
140+ auto const & local{a - b};
141+
142+ #line 49 "pure2-function-body-reflection.cpp2"
139143 if (!(true )) {
140- return 0 ;
144+ return local ;
141145 }
146+ }
147+ #line 52 "pure2-function-body-reflection.cpp2"
142148 return cpp2::move (a) + cpp2::move (b);
143149 }
144150
145- #line 53 "pure2-function-body-reflection.cpp2"
151+ #line 55 "pure2-function-body-reflection.cpp2"
146152 auto test::postfix (double & a) -> void
147153 {
148154 auto ptr {&a};
149155 --++*cpp2::impl::assert_not_null (cpp2::move (ptr));
150156 }
151157
152- #line 59 "pure2-function-body-reflection.cpp2"
158+ #line 61 "pure2-function-body-reflection.cpp2"
153159 [[nodiscard]] auto test::qualified_ids () -> auto
154160 {
155161 std::vector<int > v {1 , 2 , 3 };
156162 return CPP2_UFCS (ssize)(cpp2::move (v));
157163 }
158164
159- #line 65 "pure2-function-body-reflection.cpp2"
165+ #line 67 "pure2-function-body-reflection.cpp2"
160166 auto test::loops () -> void
161167 {
162168 std::vector v {1 , 2 , 3 };
169+ {
170+ auto index{1 };
171+
172+ #line 72 "pure2-function-body-reflection.cpp2"
173+ for (
174+ auto const & value : cpp2::move (v) )
175+ {
176+ std::cout << " " + cpp2::to_string (index) + " " + cpp2::to_string (value) + " \n " ;
177+ }
178+ }
163179
164- for ( auto const & value : cpp2::move (v) ) {std::cout << value << " \n " ; }
165-
180+ #line 78 "pure2-function-body-reflection.cpp2"
166181 auto i {0 };
167182 for ( ; cpp2::impl::cmp_less (i,3 ); i += 1 ) {std::cout << i << " \n " ; }
168183
169184 do {std::cout << " plugh\n " ; } while ( false );
170185 }
171186
172- #line 79 "pure2-function-body-reflection.cpp2"
187+ #line 86 "pure2-function-body-reflection.cpp2"
173188auto sample_function_after_type () -> void{}
174189
175190}
176191
177- #line 83 "pure2-function-body-reflection.cpp2"
192+ #line 90 "pure2-function-body-reflection.cpp2"
178193auto main () -> int{
179194 std::cout << " calling generated function ns::add_1... ns::add_1(42) returned " + cpp2::to_string (ns::add_1 (42 )) + " \n " ;
180195}
0 commit comments