-
Notifications
You must be signed in to change notification settings - Fork 13.4k
-frelaxed-template-template-args: "error: pack expansion used as argument for non-pack parameter of alias template" with constrained alias template #62529
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
Comments
@llvm/issue-subscribers-clang-frontend |
I believe clang is correct in rejecting it, per CWG1430, which is still open, but has consensus on rejection. The bug is not diagnosing it, which is an oversight in the pre-P0522 implementation of template template parameter matching, which is still used as a fast path in the post-P0522 implementation. This fast path is purposefully skipped when the argument template is constrained. |
This partially reverts b86e099 Just the default is changed back, on the Driver side. No Frontend changes. The positive spelling of the flag is undeprecated. No documentation changes or changelog entries because we plan to revert this revert as soon as llvm#62529 is fixed.
…template parameters When partial ordering alias templates against template template parameters, allow pack expansions when the alias has a fixed-size parameter list. These expansions were generally disallowed by proposed resolution for CWG1430. By previously diagnosing these when checking template template parameters, we would be too strict in trying to prevent any potential invalid use. This flows against the more general idea that template template parameters are weakly typed, that we would rather allow an argument that might be possibly misused, and only diagnose the actual misuses during instantiation. Since this interaction between P0522R0 and CWG1430 is also a backwards-compat breaking change, we implement provisional wording to allow these. Fixes #62529
…template parameters When partial ordering alias templates against template template parameters, allow pack expansions when the alias has a fixed-size parameter list. These expansions were generally disallowed by proposed resolution for CWG1430. By previously diagnosing these when checking template template parameters, we would be too strict in trying to prevent any potential invalid use. This flows against the more general idea that template template parameters are weakly typed, that we would rather allow an argument that might be possibly misused, and only diagnose the actual misuses during instantiation. Since this interaction between P0522R0 and CWG1430 is also a backwards-compat breaking change, we implement provisional wording to allow these. Fixes #62529
…template parameters (#91833) When partial ordering alias templates against template template parameters, allow pack expansions when the alias has a fixed-size parameter list. These expansions were generally disallowed by proposed resolution for CWG1430. By previously diagnosing these when checking template template parameters, we would be too strict in trying to prevent any potential invalid use. This flows against the more general idea that template template parameters are weakly typed, that we would rather allow an argument that might be possibly misused, and only diagnose the actual misuses during instantiation. Since this interaction between P0522R0 and CWG1430 is also a backwards-compat breaking change, we implement provisional wording to allow these. Fixes #62529
Motivation:
Reduced:
compiled with
-frelaxed-template-template-args
gives:(we need
-frelaxed-template-template-args
for other reasons)Workaround: use
std::enable_if_t
to constrain alias template instead.The text was updated successfully, but these errors were encountered: