------- Comment #12 from pinskia at gcc dot gnu dot org 2008-12-30 05:22 ------- (In reply to comment #11) > 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; > + }
The test has go in front of perform_qualification_conversions with an extra STRIP_NOPS. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=37093