[all-commits] [llvm/llvm-project] 8b0127: [Clang][OpenMP][NFC] Add test for `class-type` dat...

Akash Manna via All-commits all-commits at lists.llvm.org
Sun Oct 4 06:13:50 PDT 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 8b0127c14e18f5856afbc2cc61461e2ab7e67609
      https://github.com/llvm/llvm-project/commit/8b0127c14e18f5856afbc2cc61461e2ab7e67609
  Author: Akash Manna <akash.manna.mymail at gmail.com>
  Date:   2026-10-04 (Sun, 04 Oct 2026)

  Changed paths:
    M clang/test/OpenMP/parallel_for_loop_messages.cpp

  Log Message:
  -----------
  [Clang][OpenMP][NFC] Add test for `class-type` data members as loop counters (#228831)

Fixes #140243

An OpenMP loop whose init assigns to a data member of class type, like
`for (a = x; ...)` with `I<int> a`, crashed in
`OpenMPIterationSpaceChecker::checkAndSetInit`. Such an assignment is an
`operator=` call, so it goes through the `CXXOperatorCallExpr` branch,
and two of the `setLCDeclAndLB` calls there took the bound from `BO`,
the `BinaryOperator` cast that had already failed and is null at that
point. The invalid code in the report is not needed: a valid loop over
an iterator-typed data member crashed the same way.

#203252 replaced those `BO->getRHS()` uses with `CE->getArg(1)` as part
of another fix, so the crash is gone on trunk and no source change is
needed. This PR only adds a regression test so the issue can be closed.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list