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 | 8093465a0b1fdc1d6de58891b23b3a52c9d8084d (patch) | |
tree | d179909ffde1c4b94c358ff34e7cd881d8fc91c1 /clang/test/SemaTemplate/instantiation-backtrace.cpp | |
parent | 68eea507fa46d2697e51d552efba2341060c0fb3 (diff) | |
download | bcm5719-llvm-8093465a0b1fdc1d6de58891b23b3a52c9d8084d.tar.gz bcm5719-llvm-8093465a0b1fdc1d6de58891b23b3a52c9d8084d.zip |
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.
llvm-svn: 160245
Diffstat (limited to 'clang/test/SemaTemplate/instantiation-backtrace.cpp')
-rw-r--r-- | clang/test/SemaTemplate/instantiation-backtrace.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/clang/test/SemaTemplate/instantiation-backtrace.cpp b/clang/test/SemaTemplate/instantiation-backtrace.cpp index 21456e902ae..f640836b768 100644 --- a/clang/test/SemaTemplate/instantiation-backtrace.cpp +++ b/clang/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}} + } +} |