From 411e094cbee542f2e94492a72b9d62b8b00aaba2 Mon Sep 17 00:00:00 2001 From: Alexandre Oliva Date: Sun, 11 Oct 1998 19:59:27 +0000 Subject: [PATCH] ttp53.C: New test. * g++.old-deja/g++.pt/ttp53.C: New test. incorrect substitution of template parameter? From-SVN: r22996 --- gcc/testsuite/ChangeLog | 3 +++ gcc/testsuite/g++.old-deja/g++.pt/ttp53.C | 35 +++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+) create mode 100644 gcc/testsuite/g++.old-deja/g++.pt/ttp53.C diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index e43637e..81ea86b 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,5 +1,8 @@ 1998-10-12 Alexandre Oliva + * g++.old-deja/g++.pt/ttp53.C: New test. incorrect substitution + of template parameter? + * g++.old-deja/g++.other/conv3.C: New test. conversion discards const diff --git a/gcc/testsuite/g++.old-deja/g++.pt/ttp53.C b/gcc/testsuite/g++.old-deja/g++.pt/ttp53.C new file mode 100644 index 0000000..694635d --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.pt/ttp53.C @@ -0,0 +1,35 @@ +// Build don't link: + +// Submitted by Erez Louidor Lior + +template class H; +template +H foo(const H&); + +template +class H{ + +#ifdef OK +public: +#endif + template class Caster, typename Source> + static H cast(const H& s); // gets bogus error - candidate - XFAIL *-*-* + +#ifndef OK + template + friend H foo(const H&); +#endif + +}; + +template class caster; + +template +H foo(const H& s){ + return H::template cast(s); // gets bogus error - no match - XFAIL *-*-* +} + +int main(){ + H i; + foo(i); // gets bogus error - instantiated from here - XFAIL *-*-* +} -- 2.7.4