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
This commit is contained in:
parent
949bd6c8ce
commit
6e0681b715
|
@ -1,5 +1,8 @@
|
|||
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",
|
||||
|
|
|
@ -0,0 +1,10 @@
|
|||
// 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); }
|
||||
};
|
Loading…
Reference in New Issue