[Bug c++/37093] [4.2/4.3/4.4 Regression] ICE with pointer to member template parameters

pinskia at gcc dot gnu dot org gcc-bugzilla@gcc.gnu.org
Tue Dec 30 01:42:00 GMT 2008



------- Comment #11 from pinskia at gcc dot gnu dot org  2008-12-30 01:40 -------
Patch which I am testing:
Index: pt.c
===================================================================
--- pt.c        (revision 142951)
+++ pt.c        (working copy)
@@ -4626,6 +4626,13 @@ convert_nontype_argument (tree type, tre
       expr = perform_qualification_conversions (type, expr);
       if (expr == error_mark_node)
        return expr;
+      if (TREE_CODE (expr) != PTRMEM_CST)
+        {
+         error ("%qE is not a valid template argument for type %qT "
+                "because it not a pointer-to-member of the form `&X::Y'",
+                expr, type);
+         return NULL_TREE;
+       }
     }
   /* A template non-type parameter must be one of the above.  */
   else


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37093



More information about the Gcc-bugs mailing list