================
@@ -539,6 +547,12 @@ bool FormatTokenLexer::tryTransformTryUsageForC() {
auto &Try = *(Tokens.end() - 2);
if (Try->isNot(tok::kw_try))
return false;
+ // Don't reset TryMacros back to identifier — they legitimately use kw_try
+ // even when followed by '(' (for macro arguments like JSG_TRY(js)). If a
+ // configured TryMacro name is also used as a plain identifier somewhere,
that
+ // is a user configuration error, consistent with IfMacros/ForEachMacros.
+ if (Try->is(TT_TryMacro))
+ return false;
----------------
HazardyKnusperkeks wrote:
```suggestion
if (Try->isNot(tok::kw_try || Try->is(TT_TryMacro))
return false;
```
I think there's no need for the comment. The Try-Macro should be a try, then
handle it as try.
https://github.com/llvm/llvm-project/pull/183352
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits