Treat opencl_unroll_hint subject errors as semantic rather than parse errors
The attribute definition claimed the attribute was inheritable (which only applies to declaration attributes) and not a statement attribute. Further, it treats subject appertainment errors as being parse errors rather than semantic errors, which leads to us accepting invalid code. For instance, we currently fail to reject: void foo() { int i = 1000; __attribute__((nomerge, opencl_unroll_hint(8))) if (i) { foo(); } } This addresses the issues by clarifying that opencl_unroll_hint is a statement attribute and handles its appertainment checks in the semantic layer instead of the parsing layer. This changes the output of the diagnostic text to be more consistent with other appertainment errors.
Loading
Please register or sign in to comment