Skip to content
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

[temp.deduct.general] The rules regarding "deduction fails" need to be rearranged #5150

Open
xmh0511 opened this issue Dec 15, 2021 · 0 comments

Comments

@xmh0511
Copy link
Contributor

xmh0511 commented Dec 15, 2021

The following sentence frequently appears in several paragraphs in subclause [temp.deduct.general]

If the substitution results in an invalid type, as described above, type deduction fails.

However, we do not see the relevant contents referred to by "as described above". AFAIK, the invalid type or expression in the immediate context of the function type or something else stated in [temp.deduct.general] p8 can result in "deduction fails" rather than a program ill-formed. Does "as described above" intend to refer to [temp.deduct.general] p8? Should we rearrange the position of [temp.deduct.general] p8 to make "as described above" have a corresponding expound.


Since [temp.deduct.general] p7 says

The substitution occurs in all types and expressions that are used in the function type function type outside of the exception specification and in template parameter declarations.

[temp.deduct.general] p8 says

Only invalid types and expressions in the immediate context of the function type outside of the exception specification, its template parameters, and its explicit-specifier can result in a deduction failure.

template parameter seems to refer to T rather than typename T = type-idopt(if it is the template parameter declaration), deduction failure can also occur in type-id.

@xmh0511 xmh0511 changed the title [temp.deduct.general] The rule regarding "deduction fails" may be restructured [temp.deduct.general] The rule regarding "deduction fails" need to be rearranged Dec 15, 2021
@xmh0511 xmh0511 changed the title [temp.deduct.general] The rule regarding "deduction fails" need to be rearranged [temp.deduct.general] The rules regarding "deduction fails" need to be rearranged Dec 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant