[clang] [clang][OpenMP] Fix code completion hang in var-list clauses (PR #234586)

Zahira Ammarguellat via cfe-commits cfe-commits at lists.llvm.org
Mon Nov 16 06:49:05 PST 2026


================
@@ -5471,8 +5474,12 @@ bool Parser::ParseOpenMPVarList(OpenMPDirectiveKind DKind,
       (Kind == OMPC_adjust_args &&
        Data.ExtraModifier != OMPC_ADJUST_ARGS_unknown);
   const bool MayHaveTail = (Kind == OMPC_linear || Kind == OMPC_aligned);
+  // If code completion cut off parsing, the current token is morphed into
+  // eof; the loop body makes no progress then, so exit to avoid an infinite
+  // loop.
   while (IsComma || (Tok.isNot(tok::r_paren) && Tok.isNot(tok::colon) &&
----------------
zahiraam wrote:

This needs a rebase. This condition is missing `!ParsedAdjustArgsList`.

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


More information about the cfe-commits mailing list