C++: Add getTemplateClass to DeductionGuide

This commit is contained in:
Jeroen Ketema
2024-08-01 13:44:19 +02:00
parent 377301a55a
commit 4dcf67940c
15 changed files with 10080 additions and 741 deletions

View File

@@ -0,0 +1,4 @@
---
category: feature
---
* A `getTemplateClass` predicate was added to the `DeductionGuide` class to get the class template for which the deduction guide is a guide.

View File

@@ -898,4 +898,11 @@ class UserDefinedLiteral extends Function {
*/
class DeductionGuide extends Function {
DeductionGuide() { functions(underlyingElement(this), _, 8) }
/**
* Gets the class template for which this is a deduction guide.
*/
TemplateClass getTemplateClass() {
deduction_guide_for_class(underlyingElement(this), unresolveElement(result))
}
}

View File

@@ -409,6 +409,11 @@ function_defaulted(unique int id: @function ref);
function_prototyped(unique int id: @function ref)
deduction_guide_for_class(
int id: @function ref,
int class_template: @usertype ref
)
member_function_this_type(
unique int id: @function ref,
int this_type: @type ref

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,2 @@
description: Add relation between deduction guides and class templates
compatibility: partial