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

CTAD for alias templates: implement the "is_deducible" constrain #84492

Closed
hokein opened this issue Mar 8, 2024 · 3 comments · Fixed by #89358
Closed

CTAD for alias templates: implement the "is_deducible" constrain #84492

hokein opened this issue Mar 8, 2024 · 3 comments · Fixed by #89358
Assignees
Labels
c++20 clang:frontend Language frontend issues, e.g. anything involving "Sema"

Comments

@hokein
Copy link
Collaborator

hokein commented Mar 8, 2024

We have an initial support at #77890 now.

However, the feature is not fully implemented yet, the is_deducible constrain is missing, see the FIXME at https://github.com/llvm/llvm-project/blob/main/clang/lib/Sema/SemaTemplate.cpp#L2909-L2914, and related testcase at https://github.com/llvm/llvm-project/blob/main/clang/test/SemaCXX/cxx20-ctad-type-alias.cpp#L188-L200

We should have this fixed before the next clang 19 release.

@hokein hokein added c++20 clang:frontend Language frontend issues, e.g. anything involving "Sema" labels Mar 8, 2024
@hokein hokein self-assigned this Mar 8, 2024
@llvmbot
Copy link
Collaborator

llvmbot commented Mar 8, 2024

@llvm/issue-subscribers-clang-frontend

Author: Haojian Wu (hokein)

We have an initial support at #77890 now.

However, the feature is not fully implemented yet, the is_deducible constrain is missing, see the FIXME at https://github.com/llvm/llvm-project/blob/main/clang/lib/Sema/SemaTemplate.cpp#L2909-L2914, and related testcase at https://github.com/llvm/llvm-project/blob/main/clang/test/SemaCXX/cxx20-ctad-type-alias.cpp#L188-L200

@llvmbot
Copy link
Collaborator

llvmbot commented Mar 8, 2024

@llvm/issue-subscribers-c-20

Author: Haojian Wu (hokein)

We have an initial support at #77890 now.

However, the feature is not fully implemented yet, the is_deducible constrain is missing, see the FIXME at https://github.com/llvm/llvm-project/blob/main/clang/lib/Sema/SemaTemplate.cpp#L2909-L2914, and related testcase at https://github.com/llvm/llvm-project/blob/main/clang/test/SemaCXX/cxx20-ctad-type-alias.cpp#L188-L200

@ilya-biryukov ilya-biryukov added this to the LLVM 19.X Release milestone Mar 11, 2024
@ilya-biryukov
Copy link
Contributor

Added to the LLVM 19 release milestone as we probably don't want to release without this. Not having this feature would allow writing code that will break in future releases of Clang.

We currently completely ignore constraints written in template aliases if the template arguments for it were deduced via CTAD.

hokein added a commit that referenced this issue Mar 13, 2024
…te for the synthesized deduction guide (#84913)

We ignored the require-clause of the original template when building the deduction guide for type-alias CTAD, this resulted in accepting code which should be rejected (see the test case). This patch fixes it, part of #84492.
hokein added a commit to hokein/llvm-project that referenced this issue Apr 19, 2024
hokein added a commit to hokein/llvm-project that referenced this issue Apr 22, 2024
hokein added a commit to hokein/llvm-project that referenced this issue Apr 24, 2024
hokein added a commit to hokein/llvm-project that referenced this issue May 7, 2024
hokein added a commit to hokein/llvm-project that referenced this issue May 13, 2024
…templates.

Fixes llvm#85192
Fixes llvm#84492

- rebase to main
- add release note for __is_deducible
- implement diagnostics for bad argument types for __is_deducible

Don't expose __is_deducible trait.

Refine the implementation of hiding __is_deducible type trait.

Apply approach 3.
hokein added a commit to hokein/llvm-project that referenced this issue May 15, 2024
…templates.

Fixes llvm#85192
Fixes llvm#84492

- rebase to main
- add release note for __is_deducible
- implement diagnostics for bad argument types for __is_deducible

Don't expose __is_deducible trait.

Refine the implementation of hiding __is_deducible type trait.

Apply approach 3.
@hokein hokein closed this as completed in a960573 May 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c++20 clang:frontend Language frontend issues, e.g. anything involving "Sema"
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants