re PR c++/21352 (ICE with passing template function type as template type)
authorMark Mitchell <mark@codesourcery.com>
Thu, 5 May 2005 19:08:12 +0000 (19:08 +0000)
committerMark Mitchell <mmitchel@gcc.gnu.org>
Thu, 5 May 2005 19:08:12 +0000 (19:08 +0000)
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
gcc/cp/pt.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/template/crash37.C [new file with mode: 0644]

index dab19ae..478aa84 100644 (file)
@@ -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.
index 32ff496..9006ab9 100644 (file)
@@ -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.  */
index dfd2238..c981cee 100644 (file)
@@ -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 (file)
index 0000000..b2f0cdb
--- /dev/null
@@ -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 "" } 
+ }
+};
+