Conversation
2f8538e to
367c4d8
Compare
9884df3 to
00e7abe
Compare
| @@ -1047,13 +1068,38 @@ impl ConversionContext { | |||
| }; | |||
|
|
|||
| if expected_ty & EXPR != 0 { | |||
There was a problem hiding this comment.
What about the callers of expr_possibly_as_stmt? I.e. expressions used as statements?
There was a problem hiding this comment.
Those get wrapped in a CStmtKind::Expr, in which the statement part and the expression part are handled separately.
2a6372a to
759cf38
Compare
| let info = macro_infos | ||
| .remove(&key) | ||
| .unwrap_or_else(|| panic!("No macro_infos entry for key {key}")); | ||
| let info = Rc::new(MacroInvocationInfo { expr_id, ..info }); |
There was a problem hiding this comment.
Do we want to also normalize info.arguments here (through unwrap_implicit_cast_expr or something else)?
There was a problem hiding this comment.
Possibly, but I'm not sure. It kinda works "in reverse" when it comes to macro arguments, because they are placed within the macro definition. So if casts are left as-is, then they are considered to form part of the argument passed at the call site. If they are unwrapped, then they are considered part of the context surrounding the argument within the macro definition.
759cf38 to
094ecb8
Compare
Following up from #1792, this adds the necessary infrastructure to the AST to handle functional macro arguments. The
MacroInvocationInfo::argumentsvalue is currently unused.