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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@321779
91177308-0d34-0410-b5e6-
96231b3b80d8
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)) {
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