This commit fixes a compiler crash when expanding an empty macro into an existing AST.
Signed-off-by: Lyra Karenai <teromene@teromene.fr>
transcribe_expression (Parser<MacroInvocLexer> &parser)
{
auto expr = parser.parse_expr ();
+ if (expr == nullptr)
+ return AST::Fragment::create_error ();
return AST::Fragment::complete ({std::move (expr)});
}
--- /dev/null
+macro_rules! empty {
+ () => {}; // { dg-error "found unexpected token '\}' in null denotation" }
+}
+
+fn main() {
+ let a = empty!();
+}