Skip to content

Commit 29cbf7f

Browse files
committed
Fix bug #1378 and create a regression test.
1 parent b2d4020 commit 29cbf7f

File tree

3 files changed

+7
-2
lines changed

3 files changed

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

source/parse.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2275,8 +2275,7 @@ struct using_statement_node
22752275
auto for_namespace() const
22762276
-> bool
22772277
{
2278-
assert(id);
2279-
return id->to_string().ends_with("::_");
2278+
return (id && id->to_string().ends_with("::_"));
22802279
}
22812280

22822281
auto position() const

0 commit comments

Comments
 (0)