Commit ed23bf8b by Jason Merrill Committed by Jason Merrill

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

	PR c++/62659
	* semantics.c (potential_constant_expression_1): Handle un-folded
	pointer to member constants.

From-SVN: r214974
parent 01c2fa9d
2014-09-05 Jason Merrill <jason@redhat.com>
PR c++/62659
* semantics.c (potential_constant_expression_1): Handle un-folded
pointer to member constants.
2014-09-04 Markus Trippelsdorf <markus@trippelsdorf.de> 2014-09-04 Markus Trippelsdorf <markus@trippelsdorf.de>
PR ipa/61659 PR ipa/61659
......
...@@ -10348,6 +10348,11 @@ potential_constant_expression_1 (tree t, bool want_rval, tsubst_flags_t flags) ...@@ -10348,6 +10348,11 @@ potential_constant_expression_1 (tree t, bool want_rval, tsubst_flags_t flags)
designates an object with thread or automatic storage designates an object with thread or automatic storage
duration; */ duration; */
t = TREE_OPERAND (t, 0); t = TREE_OPERAND (t, 0);
if (TREE_CODE (t) == OFFSET_REF && PTRMEM_OK_P (t))
/* A pointer-to-member constant. */
return true;
#if 0 #if 0
/* FIXME adjust when issue 1197 is fully resolved. For now don't do /* FIXME adjust when issue 1197 is fully resolved. For now don't do
any checking here, as we might dereference the pointer later. If any checking here, as we might dereference the pointer later. If
......
// PR c++/62659
struct D {
typedef int (D::*cont_func)();
template <cont_func> struct B;
template <cont_func cont_f> void wait(B<cont_f> ***);
int done();
template <bool> void fix() { wait<&D::done>(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