Skip to content

Diagnostic for requiring [raypayload] attribute could be clearer #7358

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
tex3d opened this issue Apr 17, 2025 · 0 comments
Open

Diagnostic for requiring [raypayload] attribute could be clearer #7358

tex3d opened this issue Apr 17, 2025 · 0 comments
Labels
bug Bug, regression, crash needs-triage Awaiting triage

Comments

@tex3d
Copy link
Contributor

tex3d commented Apr 17, 2025

Description
When using a payload without the [raypayload] attribute on the struct, you get a diagnostic error pointing at the variable declaration, such as:

<file:line>: error: type 'Payload' used as payload requires that it is annotated with the [raypayload] attribute
MyPayload pld;
          ^

The problem is with the type used, so just pointing at the variable declaration does not show you where the attribute was expected. It should add a note pointing to the struct declaration, and provide a fixit for the location of the attribute, since the location is not very intuitive: between the struct and the name of the struct.

Steps to Reproduce
https://godbolt.org/z/7sq5q17h6

@tex3d tex3d added bug Bug, regression, crash needs-triage Awaiting triage labels Apr 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug, regression, crash needs-triage Awaiting triage
Projects
Status: No status
Development

No branches or pull requests

1 participant