diff options
author | Krystian Stasiowski <sdkrystian@gmail.com> | 2024-05-15 18:55:53 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-15 18:55:53 -0400 |
commit | 667d12f86e626173726e87e101626a9060b8d967 (patch) | |
tree | 2dff1226a336fef1dc216b15a6d066d1c7f3db4b /flang/lib/Frontend/CompilerInvocation.cpp | |
parent | e00a3ccf43563209b71c5b68f56d83f4052dca63 (diff) | |
download | llvm-667d12f86e626173726e87e101626a9060b8d967.zip llvm-667d12f86e626173726e87e101626a9060b8d967.tar.gz llvm-667d12f86e626173726e87e101626a9060b8d967.tar.bz2 |
[Clang][Sema] Do not mark template parameters in the exception specification as used during partial ordering (#91534)
We do not deduce template arguments from the exception specification
when determining the primary template of a function template
specialization or when taking the address of a function template.
Therefore, this patch changes `isAtLeastAsSpecializedAs` such that we do
not mark template parameters in the exception specification as 'used'
during partial ordering (per [temp.deduct.partial]
p12) to prevent the following from being ambiguous:
```
template<typename T, typename U>
void f(U) noexcept(noexcept(T())); // #1
template<typename T>
void f(T*) noexcept; // #2
template<>
void f<int>(int*) noexcept; // currently ambiguous, selects #2 with this patch applied
```
Although there is no corresponding wording in the standard (see core issue filed here
https://github.com/cplusplus/CWG/issues/537), this seems
to be the intended behavior given the definition of _deduction
substitution loci_ in [temp.deduct.general] p7 (and EDG does the same thing).
Diffstat (limited to 'flang/lib/Frontend/CompilerInvocation.cpp')
0 files changed, 0 insertions, 0 deletions