From acccf7887ed18571bdd816a15e6ba6bc84670f04 Mon Sep 17 00:00:00 2001 From: Mark Mitchell Date: Wed, 18 Aug 2004 18:25:10 +0000 Subject: [PATCH] re PR c++/17068 (ICE: tree check: expected class 'd', have 'x' (identifier_node) in dependent_template_p, at cp/pt.c:12043) PR c++/17068 * pt.c (dependent_template_p): Treat IDENTIFIER_NODEs as dependent. PR c++/17068 * g++.dg/template/operator4.C: New test. From-SVN: r86199 --- gcc/cp/ChangeLog | 6 ++++++ gcc/cp/pt.c | 5 +++-- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/g++.dg/template/operator4.C | 11 +++++++++++ 4 files changed, 25 insertions(+), 2 deletions(-) create mode 100644 gcc/testsuite/g++.dg/template/operator4.C diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 1a97ccaeb49..0ba2415b4a4 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,9 @@ +2004-08-18 Mark Mitchell + + PR c++/17068 + * pt.c (dependent_template_p): Treat IDENTIFIER_NODEs as + dependent. + 2004-08-17 Mark Mitchell PR c++/16246 diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 257f1066bb5..5175eb1e705 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -12033,8 +12033,9 @@ dependent_template_p (tree tmpl) if (DECL_TEMPLATE_TEMPLATE_PARM_P (tmpl) || TREE_CODE (tmpl) == TEMPLATE_TEMPLATE_PARM) return true; - /* So are qualified names that have not been looked up. */ - if (TREE_CODE (tmpl) == SCOPE_REF) + /* So arenames that have not been looked up. */ + if (TREE_CODE (tmpl) == SCOPE_REF + || TREE_CODE (tmpl) == IDENTIFIER_NODE) return true; /* So are member templates of dependent classes. */ if (TYPE_P (CP_DECL_CONTEXT (tmpl))) diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 78cd8dfeceb..c95d844cf59 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2004-08-18 Mark Mitchell + + PR c++/17068 + * g++.dg/template/operator4.C: New test. + 2004-08-18 Richard Henderson * gcc.dg/20040206-1.c: XFAIL. diff --git a/gcc/testsuite/g++.dg/template/operator4.C b/gcc/testsuite/g++.dg/template/operator4.C new file mode 100644 index 00000000000..972d52fc184 --- /dev/null +++ b/gcc/testsuite/g++.dg/template/operator4.C @@ -0,0 +1,11 @@ +// PR c++/17068 + +struct A +{ + template void operator()() {} +}; + +template void foo() +{ + A().template operator()<0>(); +} -- 2.30.2