mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2024-12-12 01:18:53 +00:00
PR35045: Convert injected-class-name to its corresponding simple-template-id
during template argument deduction. We already did this when the injected-class-name was in P, but missed the case where it was in A. This (probably) can't happen except in implicit deduction guides. llvm-svn: 321779
This commit is contained in:
parent
8fbad0a4c2
commit
1337318eea
@ -502,6 +502,10 @@ DeduceTemplateArguments(Sema &S,
|
||||
SmallVectorImpl<DeducedTemplateArgument> &Deduced) {
|
||||
assert(Arg.isCanonical() && "Argument type must be canonical");
|
||||
|
||||
// Treat an injected-class-name as its underlying template-id.
|
||||
if (auto *Injected = dyn_cast<InjectedClassNameType>(Arg))
|
||||
Arg = Injected->getInjectedSpecializationType();
|
||||
|
||||
// Check whether the template argument is a dependent template-id.
|
||||
if (const TemplateSpecializationType *SpecArg
|
||||
= dyn_cast<TemplateSpecializationType>(Arg)) {
|
||||
|
@ -309,6 +309,17 @@ namespace dependent {
|
||||
template int New(int);
|
||||
}
|
||||
|
||||
namespace injected_class_name {
|
||||
template<typename T = void> struct A {
|
||||
A();
|
||||
template<typename U> A(A<U>);
|
||||
};
|
||||
A<int> a;
|
||||
A b = a;
|
||||
using T = decltype(a);
|
||||
using T = decltype(b);
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
// expected-no-diagnostics
|
||||
|
Loading…
Reference in New Issue
Block a user