diff --git a/clang/include/clang/Basic/DiagnosticSemaKinds.td b/clang/include/clang/Basic/DiagnosticSemaKinds.td index df28eb2a961f8..ca20b27d88859 100644 --- a/clang/include/clang/Basic/DiagnosticSemaKinds.td +++ b/clang/include/clang/Basic/DiagnosticSemaKinds.td @@ -8302,7 +8302,10 @@ let CategoryName = "Lambda Issue" in { def note_var_explicitly_captured_here : Note<"variable %0 is" "%select{| explicitly}1 captured here">; def err_implicit_this_capture : Error< - "implicit capture of 'this' is not allowed for kernel functions">; + "implicit capture of 'this' is not allowed for kernel functions. " + "Either ensure the object is allocated in the memory available " + "on the device (e.g., shared USM memory) and capture it explicitly " + "or consider capturing the current object by copy ([*this]).">; def err_lambda_member_access : Error< "invalid attempt to access member of lambda">;