File tree 11 files changed +301
-242
lines changed
regression-tests/test-results
11 files changed +301
-242
lines changed Original file line number Diff line number Diff line change @@ -386,8 +386,10 @@ auto assert_not_null(auto&& p CPP2_SOURCE_LOCATION_PARAM_WITH_DEFAULT) -> declty
386
386
{
387
387
// NOTE: This "!= T{}" test may or may not work for STL iterators. The standard
388
388
// doesn't guarantee that using == and != will reliably report whether an
389
- // STL iterator has the default-constructed value
390
- Null.expects (p != CPP2_TYPEOF (p){}, " dynamic null dereference attempt detected" CPP2_SOURCE_LOCATION_ARG);
389
+ // STL iterator has the default-constructed value. So use it only for raw *...
390
+ if constexpr (std::is_pointer_v<CPP2_TYPEOF (p)>) {
391
+ Null.expects (p != CPP2_TYPEOF (p){}, " dynamic null dereference attempt detected" CPP2_SOURCE_LOCATION_ARG);
392
+ }
391
393
return CPP2_FORWARD (p);
392
394
}
393
395
Original file line number Diff line number Diff line change 22
22
rm -f * .obj * .exp * .lib
23
23
printf " \nDone: %s .cpp tests compiled\n" " $count "
24
24
printf " \n %s .cpp executables generated and run\n" " $exe_count "
25
+ echo " $( date +" %T" ) "
Original file line number Diff line number Diff line change 22
22
rm -f * .obj * .exp * .lib
23
23
printf " \nDone: %s .cpp tests compiled\n" " $count "
24
24
printf " \n %s .cpp executables generated and run\n" " $exe_count "
25
+ echo " $( date +" %T" ) "
Original file line number Diff line number Diff line change @@ -23,4 +23,5 @@ del *.obj *.exp *.lib
23
23
echo .
24
24
echo Done: %count% .cpp tests compiled
25
25
echo .
26
- echo . %exe_count% executables generated and run
26
+ echo . %exe_count% executables generated and run
27
+ echo %TIME%
Original file line number Diff line number Diff line change @@ -28,4 +28,5 @@ echo. %err_count% error test cases (should not generate .cpp)
28
28
echo . %total_count% total
29
29
if %total_count% NEQ %count% (
30
30
echo . *** MISMATCH: should equal total tests run
31
- )
31
+ )
32
+ echo %TIME%
Original file line number Diff line number Diff line change 1
1
2
- cppfront compiler v0.2.1 Build 8521:1217
2
+ cppfront compiler v0.2.1 Build 8522:0446
3
3
Copyright(c) Herb Sutter All rights reserved
4
4
5
5
SPDX-License-Identifier: CC-BY-NC-ND-4.0
Original file line number Diff line number Diff line change 1
- "8521:1217 "
1
+ "8522:0446 "
Original file line number Diff line number Diff line change @@ -4481,7 +4481,7 @@ class cppfront
4481
4481
4482
4482
auto found_explicit_init = false ;
4483
4483
auto found_default_init = false ;
4484
- auto stmt_pos = source_position{} ;
4484
+ auto stmt_pos = n. position () ;
4485
4485
4486
4486
auto initializer = std::string{};
4487
4487
Original file line number Diff line number Diff line change @@ -4184,17 +4184,27 @@ class parser
4184
4184
}
4185
4185
}
4186
4186
4187
- // G expression: // eliminated condition: - use expression:
4187
+ // G expression: // eliminated ' condition:' - just use ' expression:'
4188
4188
// G assignment-expression
4189
4189
// GTODO try expression
4190
4190
// G
4191
- auto expression (bool allow_angle_operators = true )
4191
+ auto expression (bool allow_angle_operators = true , bool check_arrow = true )
4192
4192
-> std::unique_ptr<expression_node>
4193
4193
{
4194
4194
auto n = std::make_unique<expression_node>();
4195
4195
if (!(n->expr = assignment_expression (allow_angle_operators))) {
4196
4196
return {};
4197
4197
}
4198
+
4199
+ if (
4200
+ check_arrow
4201
+ && curr ().type () == lexeme::Arrow
4202
+ )
4203
+ {
4204
+ error (" '->' is not Cpp2 deference syntax - write '*.' instead" );
4205
+ return {};
4206
+ }
4207
+
4198
4208
return n;
4199
4209
}
4200
4210
@@ -5073,7 +5083,7 @@ class parser
5073
5083
next ();
5074
5084
}
5075
5085
5076
- if (auto e = expression ()) {
5086
+ if (auto e = expression (true , false )) {
5077
5087
n->expression = std::move (e);
5078
5088
}
5079
5089
else {
You can’t perform that action at this time.
0 commit comments