Decl *
TemplateDeclInstantiator::VisitCXXDeductionGuideDecl(CXXDeductionGuideDecl *D) {
- return VisitFunctionDecl(D, nullptr);
+ Decl *Inst = VisitFunctionDecl(D, nullptr);
+ if (Inst && !D->getDescribedFunctionTemplate())
+ Owner->addDecl(Inst);
+ return Inst;
}
Decl *TemplateDeclInstantiator::VisitCXXMethodDecl(CXXMethodDecl *D) {
using T = decltype(b);
}
+namespace member_guides {
+ // PR34520
+ template<class>
+ struct Foo {
+ template <class T> struct Bar {
+ Bar(...) {}
+ };
+ Bar(int) -> Bar<int>;
+ };
+ Foo<int>::Bar b = 0;
+}
+
#else
// expected-no-diagnostics