[clang] [CUDA][HIP] Fix missing caller notes and add HD-promoted function note for deferred diagnostics (PR #187153)

Tom Honermann via cfe-commits cfe-commits at lists.llvm.org
Wed Mar 18 08:27:55 PDT 2026


tahonermann wrote:

@yxsamliu,
> Both errors are in the same HD function, and df1/df2 both call that function, so every error gets the exact same caller list. Given that, maybe we should keep the original behavior of emitting the call chain once after all errors, and focus this PR on just the "in HD-promoted function" note instead.

This is why I suggested (in [this comment](https://github.com/llvm/llvm-project/issues/180638#issuecomment-4070742085)) issuing an additional "error: use of device-promoted function 'lambda at ...' with errors" diagnostic to attach the "called by" notes to. This avoids issuing the "called by" notes multiple times and avoids the asymmetric attachment of such notes to an arbitrary error within the promoted function.

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


More information about the cfe-commits mailing list