[clang] [mlir] [mlir] Diagnose missing call result arrow (PR #206215)

via cfe-commits cfe-commits at lists.llvm.org
Fri Jul 10 04:29:31 PDT 2026


================
@@ -1388,8 +1388,11 @@ static ParseResult parseCallTypeAndResolveOperands(
   }
   SmallVector<Type> argTypes;
   SmallVector<Type> resTypes;
+  SMLoc signatureLoc = parser.getCurrentLocation();
   if (call_interface_impl::parseFunctionSignature(parser, argTypes, argAttrs,
                                                   resTypes, resultAttrs)) {
+    if (parser.getCurrentLocation() != signatureLoc)
----------------
mygitljf wrote:

I added this to keep the existing fallback diagnostic when parsing fails before consuming any of the signature. In the missing `->` case, the parser has already consumed `()` and emitted a more specific error, so without this check we'd also emit the generic `expected direct call...` error.
The nearby `call_missing_ptr_type` test covers the no-progress case. I can add a comment here if that would help.

https://github.com/llvm/llvm-project/pull/206215


More information about the cfe-commits mailing list