Skip to content

Commit 41ca51a

Browse files
committed
fix(parse): ignore errors from alternative production
1 parent 5a57f5e commit 41ca51a

6 files changed

+25
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
main: () = std::is_void_v<* i32>;

regression-tests/test-results/gcc-13/pure2-bugfix-for-pointer-type-template-argument.cpp.execution

Whitespace-only changes.

regression-tests/test-results/gcc-13/pure2-bugfix-for-pointer-type-template-argument.cpp.output

Whitespace-only changes.
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
2+
#define CPP2_USE_MODULES Yes
3+
4+
//=== Cpp2 type declarations ====================================================
5+
6+
7+
#include "cpp2util.h"
8+
9+
10+
11+
//=== Cpp2 type definitions and function declarations ===========================
12+
13+
#line 1 "pure2-bugfix-for-pointer-type-template-argument.cpp2"
14+
auto main() -> int;
15+
16+
17+
//=== Cpp2 function definitions =================================================
18+
19+
#line 1 "pure2-bugfix-for-pointer-type-template-argument.cpp2"
20+
auto main() -> int { std::is_void_v<cpp2::i32*>; }
21+
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
pure2-bugfix-for-pointer-type-template-argument.cpp2... ok (all Cpp2, passes safety checks)
2+

source/parse.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4828,6 +4828,7 @@ class parser
48284828
}
48294829
else if (auto i = type_id()) {
48304830
term.arg = std::move(i);
4831+
errors.clear(); // clear errors from attempting to parse an expression
48314832
}
48324833
else {
48334834
break;

0 commit comments

Comments
 (0)