bloomberg / clang-p2996

Experimental clang support for WG21 P2996 (Reflection).
https://github.com/bloomberg/clang-p2996/tree/p2996/P2996.md
51 stars 8 forks source link

Reflection syntax may be incompatible with OpenMP #33

Closed tambry closed 2 weeks ago

tambry commented 4 months ago

Similar to ObjC's -fblocks OpenCL supports blocks started by ^. This check should check LangOpts.Blocks instead.
OpenMP pragmas use syntax such as +:argv[0][:1] so a || LangOpts.OpenMP should also be added.

katzdm commented 4 months ago

Hey @tambry ! Thanks for the bug report.

This check should check LangOpts.Blocks instead.

Agreed.

OpenMP pragmas use syntax such as +:argv[0][:1]

I'm aware of the OpenMP case, but what I'm less clear on (due to limited familiarity with OpenMP) it would be sensible for splices to ever appear in OpenMP pragmas - if not, this could maybe be handled by parsing the [: and :] tokens differently when in the context of an OpenMP pragma. If you have an OpenMP background, I'd appreciate any insight you can share here!

tambry commented 4 months ago

Unfortunately I don't have an OpenMP background so can't help with that. 😞

katzdm commented 4 months ago

No worries - I've adopted your suggested LangOpts.Blocks change. For the time being, I'll change this issue name to reflect the uncertain conflict with OpenMP, and will seek further clarification.

katzdm commented 2 weeks ago

We'll be adopting a different syntax for P2996, likely in the next (R6) revision.