From: Paolo Carlini Date: Mon, 29 Sep 2014 09:06:31 +0000 (+0000) Subject: re PR c++/51385 (Unnecessary instantiation converting to pointer to template class... X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f1d6f494666f6fb9ee061d21a1a190e45c2ea83c;p=gcc.git re PR c++/51385 (Unnecessary instantiation converting to pointer to template class instance) 2014-09-29 Paolo Carlini PR c++/51385 * g++.dg/template/pr51385.C: New. From-SVN: r215680 --- diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 870ca0e3952..925adf80205 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2014-09-29 Paolo Carlini + + PR c++/51385 + * g++.dg/template/pr51385.C: New. + 2014-09-28 Robert Suchanek * gcc.target/mips/20140928.c: New test. diff --git a/gcc/testsuite/g++.dg/template/pr51385.C b/gcc/testsuite/g++.dg/template/pr51385.C new file mode 100644 index 00000000000..e76995467ca --- /dev/null +++ b/gcc/testsuite/g++.dg/template/pr51385.C @@ -0,0 +1,24 @@ +// PR c++/51385 + +template <__SIZE_TYPE__ N> struct NTmpl; +template > +struct PtrConvs { + enum { bad = 1 }; +}; + +template +struct PtrConvs >; + +template struct test { static const bool value = true; }; +template<> struct test { static const bool value = false; }; + +template +struct FussyTemplate +{ + int sa[test::value ? 1 : -1]; +}; + +struct B { }; + +typedef char chk[1]; +typedef char chk[PtrConvs, B>::bad];