diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-07-16 01:09:10 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2012-07-16 01:09:10 +0000 |
commit | 7e54fb5fcc7d7b8e843501652cf7c19cea6c4c57 (patch) | |
tree | e8a4ab38aa16a2b4502da66f01884a7a70585ae4 /test/SemaTemplate/instantiation-backtrace.cpp | |
parent | d8672ef2d343a0dbfe838724fb2d9fb4efea6041 (diff) | |
download | clang-7e54fb5fcc7d7b8e843501652cf7c19cea6c4c57.tar.gz |
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
Diffstat (limited to 'test/SemaTemplate/instantiation-backtrace.cpp')
-rw-r--r-- | test/SemaTemplate/instantiation-backtrace.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/test/SemaTemplate/instantiation-backtrace.cpp b/test/SemaTemplate/instantiation-backtrace.cpp index 21456e902a..f640836b76 100644 --- a/test/SemaTemplate/instantiation-backtrace.cpp +++ b/test/SemaTemplate/instantiation-backtrace.cpp @@ -30,3 +30,22 @@ struct G : A<T>, // expected-error{{implicit instantiation of undefined template 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}} + } +} |