[all-commits] [llvm/llvm-project] d995b2: [Clang][AMDGPU] Accept builtins in lambda declarat...

Juan Manuel Martinez Caamaño via All-commits all-commits at lists.llvm.org
Fri Apr 11 10:12:07 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: d995b2ebdc1a312c8583351c13dac90e8e320a09
      https://github.com/llvm/llvm-project/commit/d995b2ebdc1a312c8583351c13dac90e8e320a09
  Author: Juan Manuel Martinez Caamaño <jmartinezcaamao at gmail.com>
  Date:   2025-04-11 (Fri, 11 Apr 2025)

  Changed paths:
    M clang/lib/Sema/SemaAMDGPU.cpp
    A clang/test/SemaHIP/amdgpu-builtin-in-lambda-with-unsupported-attribute.hip
    A clang/test/SemaHIP/amdgpu-builtin-in-lambda.hip

  Log Message:
  -----------
  [Clang][AMDGPU] Accept builtins in lambda declarations (#135027)

`Sema::getCurFunctionDecl(AllowLambda = false)` returns a nullptr when
the lambda declaration is outside a function (for example, when
assigning a lambda to a static constexpr variable).

This triggered an assertion in
`SemaAMDGPU::CheckAMDGCNBuiltinFunctionCall`.

Using `Sema::getCurFunctionDecl(AllowLambda = true)` returns the
declaration of the enclosing lambda.

Stumbled with this issue when refactoring some code in CK.



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