PR13365: Fix code which was trying to treat an array of DeducedTemplateArgument
as an array of its base class TemplateArgument. Switch the const
TemplateArgument* parameters of InstantiatingTemplate's constructors to
ArrayRef<TemplateArgument> to prevent this from happening again in the future.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@160245 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/test/SemaTemplate/instantiation-backtrace.cpp b/test/SemaTemplate/instantiation-backtrace.cpp
index 21456e9..f640836 100644
--- a/test/SemaTemplate/instantiation-backtrace.cpp
+++ b/test/SemaTemplate/instantiation-backtrace.cpp
@@ -30,3 +30,22 @@
void h() {
(void)sizeof(G<int>); // expected-note{{in instantiation of template class 'G<int>' requested here}}
}
+
+namespace PR13365 {
+ template <class T> class ResultTy { // expected-warning {{does not declare any constructor}}
+ T t; // expected-note {{reference member 't' will never be initialized}}
+ };
+
+ template <class T1, class T2>
+ typename ResultTy<T2>::error Deduce( void (T1::*member)(T2) ) {} // \
+ // expected-note {{instantiation of template class 'PR13365::ResultTy<int &>'}} \
+ // expected-note {{substituting deduced template arguments into function template 'Deduce' [with T1 = PR13365::Cls, T2 = int &]}} \
+ // expected-note {{substitution failure [with T1 = PR13365::Cls, T2 = int &]}}
+
+ struct Cls {
+ void method(int&);
+ };
+ void test() {
+ Deduce(&Cls::method); // expected-error {{no matching function}}
+ }
+}