Skip to content

Commit fb26c8c

Browse files
Fix bug #1378 and create a regression test. (#1379)
* Fix bug #1378 and create a regression test. * Renamed new test file to *-error.cpp2 --------- Co-authored-by: Herb Sutter <[email protected]>
1 parent 590cab7 commit fb26c8c

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
main: () = {
2+
using
3+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
pure2-bugfix-for-bad-using-error.cpp2...
2+
pure2-bugfix-for-bad-using-error.cpp2(3,1): error: expected valid id-expression after 'using' (at '}')
3+

source/parse.h

+1-2
Original file line numberDiff line numberDiff line change
@@ -2335,8 +2335,7 @@ struct using_statement_node
23352335
auto for_namespace() const
23362336
-> bool
23372337
{
2338-
assert(id);
2339-
return id->to_string().ends_with("::_");
2338+
return (id && id->to_string().ends_with("::_"));
23402339
}
23412340

23422341
auto position() const

0 commit comments

Comments
 (0)