aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorMark Mitchell <mark@codesourcery.com>2005-05-05 19:08:12 +0000
committerMark Mitchell <mmitchel@gcc.gnu.org>2005-05-05 19:08:12 +0000
commit2226e997d7849508b15306736f1dab88cdc29445 (patch)
treea2782d0a70028fe7eb431d9f2fb5070263765d63 /gcc
parent43ac1934bad02902f1912d0b820edf14c52e7f0f (diff)
downloadgcc-2226e997d7849508b15306736f1dab88cdc29445.zip
gcc-2226e997d7849508b15306736f1dab88cdc29445.tar.gz
gcc-2226e997d7849508b15306736f1dab88cdc29445.tar.bz2
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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog5
-rw-r--r--gcc/cp/pt.c5
-rw-r--r--gcc/testsuite/ChangeLog5
-rw-r--r--gcc/testsuite/g++.dg/template/crash37.C26
4 files changed, 37 insertions, 4 deletions
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 <mark@codesourcery.com>
+
+ PR c++/21352
+ * pt.c (build_non_dependent_expr): Use is_overloaded_fn.
+
2005-05-05 Kazu Hirata <kazu@cs.umass.edu>
* 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 <mark@codesourcery.com>
+
+ PR c++/21352
+ * g++.dg/template/crash37.C: New test.
+
2005-05-05 Paul Brook <paul@codesourcery.com>
* 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<class type>
+ void push3()
+ {
+ }
+};
+
+struct helper {};
+
+template<class F>
+void bla(F f)
+{
+}
+
+template <typename ScannerT>
+struct definition
+{
+ definition()
+ {
+ bla(coperator_stack::push3<helper>); // { dg-error "" }
+ }
+};
+