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

Clang C++20 Feature: P1814R0 - Wording for Class Template Argument Deduction for Alias Templates #54051

Closed
tstellar opened this issue Feb 24, 2022 · 12 comments · Fixed by #77890
Assignees
Labels
c++20 clang:frontend Language frontend issues, e.g. anything involving "Sema"
Milestone

Comments

@tstellar
Copy link
Collaborator


id: P1814R0
paper: https://wg21.link/p1814r0

@tstellar tstellar added this to the Clang C++20 milestone Feb 24, 2022
@llvmbot
Copy link
Member

llvmbot commented Feb 24, 2022

@llvm/issue-subscribers-c-20

@yuanfang-chen yuanfang-chen self-assigned this Aug 15, 2022
@usx95 usx95 moved this to In Progress in C++ 20 in Clang Aug 22, 2022
@alanzhao1
Copy link
Contributor

Friendly ping, any updates on this?

@yuanfang-chen yuanfang-chen removed their assignment Nov 14, 2022
@yuanfang-chen
Copy link
Collaborator

@alanzhao1 sorry, I haven't had the time to work on this.

@yuanfang-chen yuanfang-chen self-assigned this Nov 15, 2022
@yuanfang-chen
Copy link
Collaborator

It turned out this and #54050 are both parts of https://www.open-std.org/jtc1/sc22/wg21/docs/papers/2022/p1021r6.html which I'm currently working on.

@alanzhao1
Copy link
Contributor

@yuanfang-chen, I've been looking at this for the past few days, but I saw that you've been pretty active with https://reviews.llvm.org/D139837, which addresses #54050 which is related to this bug. Have you made any progress on this bug? If so, I'll abandon my efforts, as I'm sure you'll have something out before I do and I'd prefer to avoid duplicating work.

@yuanfang-chen
Copy link
Collaborator

Hi @alanzhao1, I'm still working on this. However, P2582R0 is yet to be picked up AFAIK.

@alanzhao1
Copy link
Contributor

Thanks for the update! Since you're working on it, I'll abandon my efforts, as you're more experienced in this area.

Feel free to add me as a reviewer to the patch (I'm ayzhao on LLVM's phabricator)

@robertmaxton42
Copy link

robertmaxton42 commented Aug 3, 2023

Ran into this pothole today. So uh... Any news here?

@13steinj
Copy link

Ran into again today; just for another voice / raised hand.

@hokein
Copy link
Collaborator

hokein commented Dec 4, 2023

Hi @yuanfang-chen, I wonder what's the status now, are you still working on it? If not, I'm happy to pick it up.

@hokein
Copy link
Collaborator

hokein commented Dec 12, 2023

Reassign this issue to me. I'm working on it.

hokein added a commit that referenced this issue Mar 8, 2024
Fixes #54051

This patch implements the C++20 feature -- CTAD for alias templates (P1814R0, specified in https://eel.is/c++draft/over.match.class.deduct#3). It is an initial patch:
- it cover major pieces, thus it works for most cases;
- the big missing piece is to implement the associated constraints (over.match.class.deduct#3.3) for the synthesized deduction guides, see the FIXME in code and tests;
- Some enhancements on the TreeTransform&TemplateInstantiator to allow performing instantiation on `BuildingDeductionGuides` mode;
@github-project-automation github-project-automation bot moved this from In Progress to Done in C++ 20 in Clang Mar 8, 2024
@EugeneZelenko EugeneZelenko added the clang:frontend Language frontend issues, e.g. anything involving "Sema" label Mar 8, 2024
@llvmbot
Copy link
Member

llvmbot commented Mar 8, 2024

@llvm/issue-subscribers-clang-frontend

Author: Tom Stellard (tstellar)

--- id: P1814R0 paper: https://wg21.link/p1814r0

adalessandro added a commit to adalessandro/meta-browser that referenced this issue Feb 11, 2025
Fix the following compilation error:

```
| ../../pdf/pdfium/pdfium_api_wrappers.cc:150:32: error: alias template
  'PDFiumAPIStringBufferAdapter' requires template arguments; argument
  deduction only allowed for class templates
|   150 |   PDFiumAPIStringBufferAdapter adapter(&name, expected_size,
|       |                                ^
| ../../pdf/pdfium/pdfium_api_string_buffer_adapter.h:173:1: note: template
  is declared here
|   173 | using PDFiumAPIStringBufferAdapter =
|       | ^
| 1 error generated.
```

This patch will be dropped once clang >= 19.1.0 is available, which
includes support for class template argument deduction (CTAD) for type
alias templates (P1814R0 [0]) (#54051 [1]).

Note that currently meta-clang [2] provides the clang version `18.1.6`.

[0] https://wg21.link/p1814r0
[1] llvm/llvm-project#54051
[2] https://github.com/kraj/meta-clang

Signed-off-by: Ariel D'Alessandro <[email protected]>
adalessandro added a commit to adalessandro/meta-browser that referenced this issue Feb 11, 2025
Fix the following compilation error:

```
| ../../pdf/pdfium/pdfium_api_wrappers.cc:150:32: error: alias template
  'PDFiumAPIStringBufferAdapter' requires template arguments; argument
  deduction only allowed for class templates
|   150 |   PDFiumAPIStringBufferAdapter adapter(&name, expected_size,
|       |                                ^
| ../../pdf/pdfium/pdfium_api_string_buffer_adapter.h:173:1: note: template
  is declared here
|   173 | using PDFiumAPIStringBufferAdapter =
|       | ^
| 1 error generated.
```

This patch will be dropped once clang >= 19.1.0 is available, which
includes support for class template argument deduction (CTAD) for type
alias templates (P1814R0 [0]) (#54051 [1]).

Note that currently meta-clang [2] provides the clang version `18.1.6`.

[0] https://wg21.link/p1814r0
[1] llvm/llvm-project#54051
[2] https://github.com/kraj/meta-clang

Signed-off-by: Ariel D'Alessandro <[email protected]>
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.

8 participants