-
Notifications
You must be signed in to change notification settings - Fork 11.2k
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
Class template argument deduction fails in case of function type argument #51710
Comments
Clang behaves as expected if user-provided deduction guide written after http://eel.is/c++draft/over.match.class.deduct#1.1 is present: https://godbolt.org/z/3o367Wz9x |
@llvm/issue-subscribers-c-17 Author: None (llvmbot)
| | |
| --- | --- |
| Bugzilla Link | [52368](https://llvm.org/bz52368) |
| Version | trunk |
| OS | Windows NT |
| Reporter | LLVM Bugzilla Contributor |
| CC | @DougGregor,@zygoloid |
Extended DescriptionIn the following program Clang is unable to perform class template argument deduction:
GCC accepts it successfully, demo: https://gcc.godbolt.org/z/PKe6T5aW5 Related discussion: https://stackoverflow.com/q/69778510/7325599 |
@llvm/issue-subscribers-clang-frontend Author: None (llvmbot)
| | |
| --- | --- |
| Bugzilla Link | [52368](https://llvm.org/bz52368) |
| Version | trunk |
| OS | Windows NT |
| Reporter | LLVM Bugzilla Contributor |
| CC | @DougGregor,@zygoloid |
Extended DescriptionIn the following program Clang is unable to perform class template argument deduction:
GCC accepts it successfully, demo: https://gcc.godbolt.org/z/PKe6T5aW5 Related discussion: https://stackoverflow.com/q/69778510/7325599 |
CC @erichkeane |
From the diagnostic message: and the AST for the implicitly-generated deduction guide from the explicit constructor:
The type for the ParaVarDecl is |
…llvm#78159) Fixes llvm#51710. When transforming a constructor into a corresponding deduction guide, the decayed types (function/array type) were not handled properly which made clang fail to compile valid code. The patch teaches clang handle these decayed type in the transformation.
Extended Description
In the following program Clang is unable to perform class template argument deduction:
GCC accepts it successfully, demo: https://gcc.godbolt.org/z/PKe6T5aW5
Related discussion: https://stackoverflow.com/q/69778510/7325599
The text was updated successfully, but these errors were encountered: