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

Splices not entirely working in requires clauses #26

Closed katzdm closed 3 weeks ago

katzdm commented 5 months ago

This code example shows syntax that should be valid being rejected from a requires clause. Adding parentheses (as suggested by the error message, though it should be unnecessary) furthermore produces a crash.

delimbetov commented 2 months ago

picking up

delimbetov commented 2 months ago

Just for the record - another (relatively simpler) example where it doesn't work: https://godbolt.org/z/6K78sszEY

katzdm commented 2 months ago

Just for the record - another (relatively simpler) example where it doesn't work: https://godbolt.org/z/6K78sszEY

This one actually works as intended; that's a "simple requirement", so it should be an expression (but ^int represents a type). Putting typename in front of it should work, but manifests the same error as the example given above.

As far as I can tell, the issue seems to only show when parsing type requirements.

katzdm commented 2 months ago

As noted in offline discussion, this is probably an issue with parsing typename as a part of the splice type, instead of as a part of the requirement clause.