From 7c237990f2856551440fbabd5b031b5479da012c Mon Sep 17 00:00:00 2001 From: Richard Smith Date: Tue, 22 Jul 2014 23:56:53 +0000 Subject: [PATCH] PR14615: add (passing) tests for this already-fixed bug llvm-svn: 213709 --- clang/test/SemaTemplate/pack-deduction.cpp | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/clang/test/SemaTemplate/pack-deduction.cpp b/clang/test/SemaTemplate/pack-deduction.cpp index f3f969e..84eefa6 100644 --- a/clang/test/SemaTemplate/pack-deduction.cpp +++ b/clang/test/SemaTemplate/pack-deduction.cpp @@ -37,3 +37,31 @@ namespace RetainExprPacks { template int g(X, decltype(f(Ts()...))); int n = g(X(), 0); } + +namespace PR14615 { + namespace comment0 { + template struct X {}; + template struct X { + typedef int type; + struct valid {}; + }; + template , + typename = typename T::valid> + typename T::type check(int); + int i = check(1); + } + + namespace comment2 { + template struct X; + template ::type I = 0> + char check(B...); // expected-note {{undefined template 'PR14615::comment2::X'}} + void f() { check(1, 2); } // expected-error {{no matching function}} + } + + namespace comment3 { + template struct X; + template ::type I = (typename X::type)0> + char check(B...); // expected-note {{undefined template 'PR14615::comment3::X'}} + void f() { check(1, 2); } // expected-error {{no matching function}} + } +} -- 2.7.4