From b95cc51a28ae5aed45eebcc1a660fdf0a54f115d Mon Sep 17 00:00:00 2001 From: Mark Mitchell Date: Mon, 15 Dec 2003 21:55:19 +0000 Subject: re PR c++/13310 (Tree check error in dependent_template_p) PR c++/13310 * pt.c (dependent_template_p): Handle OVERLOADs. PR c++/13310 * g++.dg/template/crash15.C: New test. From-SVN: r74649 --- gcc/cp/ChangeLog | 5 +++++ gcc/cp/pt.c | 11 +++++++++++ gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/g++.dg/template/crash15.C | 9 +++++++++ 4 files changed, 30 insertions(+) create mode 100644 gcc/testsuite/g++.dg/template/crash15.C (limited to 'gcc') diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 5e4e824..60bfd41 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,10 @@ 2003-12-15 Mark Mitchell + PR c++/13310 + * pt.c (dependent_template_p): Handle OVERLOADs. + +2003-12-15 Mark Mitchell + PR c++/13243 PR c++/12573 * parser.c (cp_parser_postfix_expression): Tighten handling of diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 553d4f7..1a03bba 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -11912,6 +11912,17 @@ any_dependent_template_arguments_p (tree args) bool dependent_template_p (tree tmpl) { + if (TREE_CODE (tmpl) == OVERLOAD) + { + while (tmpl) + { + if (dependent_template_p (OVL_FUNCTION (tmpl))) + return true; + tmpl = OVL_CHAIN (tmpl); + } + return false; + } + /* Template template parameters are dependent. */ if (DECL_TEMPLATE_TEMPLATE_PARM_P (tmpl) || TREE_CODE (tmpl) == TEMPLATE_TEMPLATE_PARM) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 679637a..941809d 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2003-12-15 Mark Mitchell + + PR c++/13310 + * g++.dg/template/crash15.C: New test. + 2003-12-15 Geoffrey Keating * g++.old-deja/g++.pt/vaarg3.C: Don't expect an error for passing diff --git a/gcc/testsuite/g++.dg/template/crash15.C b/gcc/testsuite/g++.dg/template/crash15.C new file mode 100644 index 0000000..e0aad73 --- /dev/null +++ b/gcc/testsuite/g++.dg/template/crash15.C @@ -0,0 +1,9 @@ +// PR c++/13310 + +struct A {}; + +template void foo() +{ + A a; + a.foo(); // { dg-error "" } +} -- cgit v1.1