From: Mark Mitchell Date: Thu, 5 May 2005 19:08:12 +0000 (+0000) Subject: re PR c++/21352 (ICE with passing template function type as template type) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=2226e997d7849508b15306736f1dab88cdc29445;p=gcc.git 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 --- diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index dab19ae2c24..478aa84daa4 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 32ff4964736..9006ab910f5 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 dfd22381ba0..c981cee51d2 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 00000000000..b2f0cdb7b66 --- /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 "" } + } +}; +