[all-commits] [llvm/llvm-project] ff929a: [Sema] Guard transformed loop-hint expression befo...

Tommy Chiang via All-commits all-commits at lists.llvm.org
Tue Feb 24 09:38:32 PST 2026


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: ff929a21e95cd637ddf6ec9b1036eeaa4ce395d5
      https://github.com/llvm/llvm-project/commit/ff929a21e95cd637ddf6ec9b1036eeaa4ce395d5
  Author: Tommy Chiang <ototot at google.com>
  Date:   2026-02-24 (Tue, 24 Feb 2026)

  Changed paths:
    M clang/lib/Sema/SemaTemplateInstantiate.cpp
    M clang/test/Sema/unroll-template-value-crash.cpp

  Log Message:
  -----------
  [Sema] Guard transformed loop-hint expression before use (#182752)

`TransformLoopHintAttr` called `TransformExpr(...).get()` without
checking that the transformed expression was usable.

For `#pragma GCC unroll v()` instantiated with `v = int`, expression
transformation fails and Clang can assert while validating the loop
hint.

Check `ExprResult::isUsable()` before calling `get()` and keep the
original attribute on failure.

Fixes https://github.com/llvm/llvm-project/issues/49502



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