History log of /llvm-project/clang/lib/Sema/SemaTemplateDeductionGuide.cpp (Results 1 – 18 of 18)
Revision (<<< Hide revision tags) (Show revision tags >>>) Date Author Comments
Revision tags: llvmorg-21-init
# f94c4815 27-Jan-2025 antangelo <contact@antangelo.com>

[clang] Track source deduction guide for alias template deduction guides (#123875)

For deduction guides generated from alias template CTAD, store the
deduction guide they were originated from. The s

[clang] Track source deduction guide for alias template deduction guides (#123875)

For deduction guides generated from alias template CTAD, store the
deduction guide they were originated from. The source kind is also
maintained for future expansion in CTAD from inherited constructors.

This tracking is required to determine whether an alias template already
has a deduction guide corresponding to some deduction guide on the
original template, in order to support deduction guides for the alias
from deduction guides declared after the initial usage.

show more ...


# b46fcb9f 23-Jan-2025 Younan Zhang <zyn7109@gmail.com>

[Clang] Implement CWG 2628 "Implicit deduction guides should propagate constraints" (#111143)

Closes https://github.com/llvm/llvm-project/issues/98592


# fd4f94dd 16-Jan-2025 Younan Zhang <zyn7109@gmail.com>

[Clang] Correct the order of substituted arguments in CTAD alias guides (#123022)

We missed a case of type constraints referencing deduced template
parameters when constructing a deduction guide for

[Clang] Correct the order of substituted arguments in CTAD alias guides (#123022)

We missed a case of type constraints referencing deduced template
parameters when constructing a deduction guide for the type alias. This
patch fixes the issue by swapping the order of constructing 'template
arguments not appearing in the type alias parameters' and 'template
arguments that are not yet deduced'.

Fixes https://github.com/llvm/llvm-project/issues/122134

show more ...


Revision tags: llvmorg-19.1.7
# 3972ed57 08-Jan-2025 Younan Zhang <zyn7109@gmail.com>

Revert "[Clang] Implement CWG2369 "Ordering between constraints and substitution"" (#122130)

Unfortunately that breaks some code on Windows when lambdas come into
play, as reported in
https://github

Revert "[Clang] Implement CWG2369 "Ordering between constraints and substitution"" (#122130)

Unfortunately that breaks some code on Windows when lambdas come into
play, as reported in
https://github.com/llvm/llvm-project/pull/102857#issuecomment-2577861178

This reverts commit 96eced624e0f120155256033fdcb8342e7e58d6e.

show more ...


# 96eced62 05-Jan-2025 Younan Zhang <zyn7109@gmail.com>

[Clang] Implement CWG2369 "Ordering between constraints and substitution" (#102857)

This patch partially implements CWG2369 for non-lambda-constrained
functions.

Lambdas are left intact at this poi

[Clang] Implement CWG2369 "Ordering between constraints and substitution" (#102857)

This patch partially implements CWG2369 for non-lambda-constrained
functions.

Lambdas are left intact at this point because we need extra work to
correctly instantiate captures before the function instantiation.

As a premise of CWG2369, this patch also implements CWG2770 to ensure
the function parameters are instantiated on demand.

Closes https://github.com/llvm/llvm-project/issues/54440

show more ...


Revision tags: llvmorg-19.1.6, llvmorg-19.1.5, llvmorg-19.1.4
# 46d750be 16-Nov-2024 Kazu Hirata <kazu@google.com>

[Sema] Remove unused includes (NFC) (#116461)

Identified with misc-include-cleaner.


# dde802b1 15-Nov-2024 Sirraide <aeternalmail@gmail.com>

[Clang] [NFC] Refactor AST visitors in Sema and the static analyser to use DynamicRecursiveASTVisitor (#115144)

This pr refactors all recursive AST visitors in `Sema`, `Analyze`, and
`StaticAnalysi

[Clang] [NFC] Refactor AST visitors in Sema and the static analyser to use DynamicRecursiveASTVisitor (#115144)

This pr refactors all recursive AST visitors in `Sema`, `Analyze`, and
`StaticAnalysis` to inherit from DRAV instead. This is over half of the
visitors that inherit from RAV directly.

See also #115132, #110040, #93462

LLVM Compile-Time Tracker link for this branch:
https://llvm-compile-time-tracker.com/compare.php?from=5adb5c05a2e9f31385fbba8b0436cbc07d91a44d&to=b58e589a86c06ba28d4d90613864d10be29aa5ba&stat=instructions%3Au

show more ...


# 44ab3805 06-Nov-2024 Krystian Stasiowski <sdkrystian@gmail.com>

Revert "Reapply "[Clang][Sema] Refactor collection of multi-level template argument lists (#106585, #111173)" (#111852)" (#115159)

This reverts commit 2bb3d3a3f32ffaef3d9b6a27db7f1941f0cb1136.


Revision tags: llvmorg-19.1.3
# 4dd55c56 24-Oct-2024 Jay Foad <jay.foad@amd.com>

[clang] Use {} instead of std::nullopt to initialize empty ArrayRef (#109399)

Follow up to #109133.


Revision tags: llvmorg-19.1.2
# 2bb3d3a3 11-Oct-2024 Krystian Stasiowski <sdkrystian@gmail.com>

Reapply "[Clang][Sema] Refactor collection of multi-level template argument lists (#106585, #111173)" (#111852)

This patch reapplies #111173, fixing a bug when instantiating dependent
expressions t

Reapply "[Clang][Sema] Refactor collection of multi-level template argument lists (#106585, #111173)" (#111852)

This patch reapplies #111173, fixing a bug when instantiating dependent
expressions that name a member template that is later explicitly
specialized for a class specialization that is implicitly instantiated.

The bug is addressed by adding the `hasMemberSpecialization` function,
which return `true` if _any_ redeclaration is a member specialization.
This is then used when determining the instantiation pattern for a
specialization of a template, and when collecting template arguments for
a specialization of a template.

show more ...


# 0bc02b99 11-Oct-2024 Younan Zhang <zyn7109@gmail.com>

[Clang] Instantiate Typedefs referenced by type alias deduction guides (#111804)

TypedefNameDecl referenced by a synthesized CTAD guide for type aliases
was not transformed previously, resulting in

[Clang] Instantiate Typedefs referenced by type alias deduction guides (#111804)

TypedefNameDecl referenced by a synthesized CTAD guide for type aliases
was not transformed previously, resulting in a substitution failure in
BuildDeductionGuideForTypeAlias() when substituting into the
right-hand-side deduction guide.

This patch fixes it in the way we have been doing since
https://reviews.llvm.org/D80743. We transform all the function
parameters, parenting referenced TypedefNameDecls with the
CXXDeductionGuideDecl. Then we instantiate these declarations in
FindInstantiatedDecl() as we build up the eventual deduction guide,
using the mechanism introduced in D80743

Fixes #111508

show more ...


# 1dff3309 09-Oct-2024 Krystian Stasiowski <sdkrystian@gmail.com>

Revert "Reapply "[Clang][Sema] Refactor collection of multi-level template argument lists (#106585)" (#111173)" (#111766)

This reverts commit 4da8ac34f76e707ab94380b94f616457cfd2cb83.


# 4da8ac34 08-Oct-2024 Krystian Stasiowski <sdkrystian@gmail.com>

Reapply "[Clang][Sema] Refactor collection of multi-level template argument lists (#106585)" (#111173)

Reapplies #106585, fixing an issue where non-dependent names of member
templates appearing pri

Reapply "[Clang][Sema] Refactor collection of multi-level template argument lists (#106585)" (#111173)

Reapplies #106585, fixing an issue where non-dependent names of member
templates appearing prior to that member template being explicitly
specialized for an implicitly instantiated class template specialization
would incorrectly use the definition of the explicitly specialized
member template.

show more ...


Revision tags: llvmorg-19.1.1
# 1818ca5c 21-Sep-2024 Martin Storsjö <martin@martin.st>

Revert "[Clang][Sema] Refactor collection of multi-level template argument lists (#106585)"

This reverts commit cdd71d61664b63ae57bdba9ee0d891f78ef79c07 (and
30adb43c897a45c18d7dd163fb4ff40c915fc488

Revert "[Clang][Sema] Refactor collection of multi-level template argument lists (#106585)"

This reverts commit cdd71d61664b63ae57bdba9ee0d891f78ef79c07 (and
30adb43c897a45c18d7dd163fb4ff40c915fc488).

This change broke compiling Qt, see
https://github.com/llvm/llvm-project/pull/106585#issuecomment-2365309463
for details.

show more ...


# cdd71d61 20-Sep-2024 Krystian Stasiowski <sdkrystian@gmail.com>

[Clang][Sema] Refactor collection of multi-level template argument lists (#106585)

Currently, clang rejects the following explicit specialization of `f`
due to the constraints not being equivalent:

[Clang][Sema] Refactor collection of multi-level template argument lists (#106585)

Currently, clang rejects the following explicit specialization of `f`
due to the constraints not being equivalent:
```
template<typename T>
struct A
{
template<bool B>
void f() requires B;
};

template<>
template<bool B>
void A<int>::f() requires B { }
```
This happens because, in most cases, we do not set the flag indicating
whether a `RedeclarableTemplate` is an explicit specialization of a
member of an implicitly instantiated class template specialization until
_after_ we compare constraints for equivalence. This patch addresses the
issue (and a number of other issues) by:
- storing the flag indicating whether a declaration is a member
specialization on a per declaration basis, and
- significantly refactoring `Sema::getTemplateInstantiationArgs` so we
collect the right set of template argument in all cases.

Many of our declaration matching & constraint evaluation woes can be
traced back to bugs in `Sema::getTemplateInstantiationArgs`. This
change/refactor should fix a lot of them. It also paves the way for
fixing #101330 and #105462 per my suggestion in #102267 (which I have
implemented on top of this patch but will merge in a subsequent PR).

show more ...


Revision tags: llvmorg-19.1.0, llvmorg-19.1.0-rc4, llvmorg-19.1.0-rc3, llvmorg-19.1.0-rc2
# bb064535 28-Jul-2024 Younan Zhang <zyn7109@gmail.com>

[Clang][CTAD][NFC] Unify transformTemplateParameter() (#100865)

We ended up having two transformTemplateParameter() after CTAD for type
aliases was landed. This patch cleans them up and allows them

[Clang][CTAD][NFC] Unify transformTemplateParameter() (#100865)

We ended up having two transformTemplateParameter() after CTAD for type
aliases was landed. This patch cleans them up and allows them to share
one implementation.

As a bonus, this also uses getDepthAndIndex() in preference to
getTemplateParameter{Depth,Index}().

show more ...


Revision tags: llvmorg-19.1.0-rc1, llvmorg-20-init
# c7bfc418 22-Jul-2024 Younan Zhang <zyn7109@gmail.com>

[Clang][NFCI] Prefer non-canonical template arguments for synthesized CTAD guides (#99840)

This seems to be low-hanging fruit: We could remove all calls to
`Context.getCanonicalTemplateArgument()`

[Clang][NFCI] Prefer non-canonical template arguments for synthesized CTAD guides (#99840)

This seems to be low-hanging fruit: We could remove all calls to
`Context.getCanonicalTemplateArgument()` and gain a better
diagnostic/AST.

The non-canonical template arguments shouldn't make a difference when
synthesizing a CTAD guide, so this is intended to be an NFC.

Closes https://github.com/llvm/llvm-project/issues/79798

show more ...


# 18c70b07 15-Jul-2024 Haojian Wu <hokein.wu@gmail.com>

[clang] Refactor: Move CTAD code from SemaTemplate.cpp to a dedicated file, NFC (#98524)

Split out the deduction guide related code from SemaTemplate.cpp to a
dedicated file.

These code has grow

[clang] Refactor: Move CTAD code from SemaTemplate.cpp to a dedicated file, NFC (#98524)

Split out the deduction guide related code from SemaTemplate.cpp to a
dedicated file.

These code has grown significantly, and moving it to a separate file
will improve code organization.

show more ...