From 2226e997d7849508b15306736f1dab88cdc29445 Mon Sep 17 00:00:00 2001 From: Mark Mitchell Date: Thu, 5 May 2005 19:08:12 +0000 Subject: [PATCH] re PR c++/21352 (ICE with passing template function type as template type) PR c++/21352 * pt.c (build_non_dependent_expr): Use is_overloaded_fn. PR c++/21352 * g++.dg/template/crash37.C: New test. From-SVN: r99281 --- gcc/cp/ChangeLog | 5 +++++ gcc/cp/pt.c | 5 +---- gcc/testsuite/ChangeLog | 5 +++++ gcc/testsuite/g++.dg/template/crash37.C | 26 ++++++++++++++++++++++++++ 4 files changed, 37 insertions(+), 4 deletions(-) create mode 100644 gcc/testsuite/g++.dg/template/crash37.C diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index dab19ae..478aa84 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2005-05-05 Mark Mitchell + + PR c++/21352 + * pt.c (build_non_dependent_expr): Use is_overloaded_fn. + 2005-05-05 Kazu Hirata * pt.c: Fix a comment typo. diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index 32ff496..9006ab9 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -12505,10 +12505,7 @@ build_non_dependent_expr (tree expr) types. */ inner_expr = (TREE_CODE (expr) == ADDR_EXPR ? TREE_OPERAND (expr, 0) : expr); - if (TREE_CODE (inner_expr) == OVERLOAD - || TREE_CODE (inner_expr) == FUNCTION_DECL - || TREE_CODE (inner_expr) == TEMPLATE_DECL - || TREE_CODE (inner_expr) == TEMPLATE_ID_EXPR + if (is_overloaded_fn (inner_expr) || TREE_CODE (inner_expr) == OFFSET_REF) return expr; /* There is no need to return a proxy for a variable. */ diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index dfd2238..c981cee 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,8 @@ +2005-05-05 Mark Mitchell + + PR c++/21352 + * g++.dg/template/crash37.C: New test. + 2005-05-05 Paul Brook * gcc.dg/arm-g2.c: Use effective-target arm32. diff --git a/gcc/testsuite/g++.dg/template/crash37.C b/gcc/testsuite/g++.dg/template/crash37.C new file mode 100644 index 0000000..b2f0cdb --- /dev/null +++ b/gcc/testsuite/g++.dg/template/crash37.C @@ -0,0 +1,26 @@ +// PR c++/21352 + +struct coperator_stack +{ + template + void push3() + { + } +}; + +struct helper {}; + +template +void bla(F f) +{ +} + +template +struct definition +{ + definition() + { + bla(coperator_stack::push3); // { dg-error "" } + } +}; + -- 2.7.4