Skip to content

Commit

Permalink
fix(parse): ignore errors from alternative production
Browse files Browse the repository at this point in the history
  • Loading branch information
JohelEGP committed Jun 21, 2023
1 parent 5a57f5e commit 41ca51a
Show file tree
Hide file tree
Showing 6 changed files with 25 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
main: () = std::is_void_v<* i32>;
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@

#define CPP2_USE_MODULES Yes

//=== Cpp2 type declarations ====================================================


#include "cpp2util.h"



//=== Cpp2 type definitions and function declarations ===========================

#line 1 "pure2-bugfix-for-pointer-type-template-argument.cpp2"
auto main() -> int;


//=== Cpp2 function definitions =================================================

#line 1 "pure2-bugfix-for-pointer-type-template-argument.cpp2"
auto main() -> int { std::is_void_v<cpp2::i32*>; }

Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
pure2-bugfix-for-pointer-type-template-argument.cpp2... ok (all Cpp2, passes safety checks)

1 change: 1 addition & 0 deletions source/parse.h
Original file line number Diff line number Diff line change
Expand Up @@ -4828,6 +4828,7 @@ class parser
}
else if (auto i = type_id()) {
term.arg = std::move(i);
errors.clear(); // clear errors from attempting to parse an expression
}
else {
break;
Expand Down

0 comments on commit 41ca51a

Please sign in to comment.