Commit 6e0681b7 by Jason Merrill Committed by Jason Merrill

re PR c++/61488 (Regression in template argument substitution in 4.9+)

	PR c++/61488
	* pt.c (check_valid_ptrmem_cst_expr): Fix for template context.

From-SVN: r211704
parent 949bd6c8
2014-06-13 Jason Merrill <jason@redhat.com>
PR c++/61488
* pt.c (check_valid_ptrmem_cst_expr): Fix for template context.
PR c++/61500
* tree.c (lvalue_kind): Handle MEMBER_REF and DOTSTAR_EXPR.
......
......@@ -5350,6 +5350,10 @@ check_valid_ptrmem_cst_expr (tree type, tree expr,
return true;
if (cxx_dialect >= cxx11 && null_member_pointer_value_p (expr))
return true;
if (processing_template_decl
&& TREE_CODE (expr) == ADDR_EXPR
&& TREE_CODE (TREE_OPERAND (expr, 0)) == OFFSET_REF)
return true;
if (complain & tf_error)
{
error ("%qE is not a valid template argument for type %qT",
......
// PR c++/61488
struct A {
typedef int (A::*cont_func)();
template <A::cont_func> void wait(int);
int notify();
void fix() { wait<&A::notify>(0); } // OK
template <int> void repair() { wait<&A::notify>(0); }
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment