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 dab19ae2c24ec68d80d8fce7548be057ae63dff1..478aa84daa43c7a1f75ab05b32eaa37c503ba257 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 32ff496473666c0981e8f7557c8972f9e27fb2a2..9006ab910f56188031b1d237ab26cf131620374d 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 dfd22381ba04334615df3aff18cf087954585c95..c981cee51d29386bab6619693311599d436bafc7 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 "" } 
+ }
+};
+