Issue 115230
Summary `__attribute__((enable_if(...)))` checked before constraints
Labels
Assignees
Reporter pkasting
    When using `__attribute__((enable_if(...)))` with a condition that may be ill-formed, you cannot use a `requires` clause to constrain the function to only be considered in the well-formed cases, because apparently the `enable_if` condition is considered first.

The workaround is to use SFINAE instead, which is ugly.

Sample code: https://godbolt.org/z/x3MjWv1ET

IMO, enable_if should be considered after constraint satisfaction (like with SFINAE), not before.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to