Commit aa2500e9 by Patrick Palka

re PR c++/68936 (ICE: tree check: expected call_expr, have target_expr in…

re PR c++/68936 (ICE: tree check: expected call_expr, have target_expr in build_min_non_dep_call_vec, at cp/tree.c:2744)

Fix PR c++/68936

gcc/cp/ChangeLog:

	PR c++/68936
	* tree.c (build_min_non_dep_call_vec): Don't retain the
	KOENIG_LOOKUP_P flag of the non-dependent expression that's
	been built.
	(build_min_non_dep_op_overload): Instead, do it here.

gcc/testsuite/ChangeLog:

	PR c++/68936
	* g++.dg/template/pr68936.C: New test.

From-SVN: r232461
parent 22c8388f
2016-01-16 Patrick Palka <ppalka@gcc.gnu.org>
PR c++/68936
* tree.c (build_min_non_dep_call_vec): Don't retain the
KOENIG_LOOKUP_P flag of the non-dependent expression that's
been built.
(build_min_non_dep_op_overload): Instead, do it here.
2016-01-15 Jakub Jelinek <jakub@redhat.com>
PR bootstrap/68271
......
......@@ -2747,7 +2747,6 @@ build_min_non_dep_call_vec (tree non_dep, tree fn, vec<tree, va_gc> *argvec)
non_dep = TREE_OPERAND (non_dep, 0);
TREE_TYPE (t) = TREE_TYPE (non_dep);
TREE_SIDE_EFFECTS (t) = TREE_SIDE_EFFECTS (non_dep);
KOENIG_LOOKUP_P (t) = KOENIG_LOOKUP_P (non_dep);
return convert_from_reference (t);
}
......@@ -2810,6 +2809,11 @@ build_min_non_dep_op_overload (enum tree_code op,
call = build_min_non_dep_call_vec (non_dep, fn, args);
release_tree_vector (args);
tree call_expr = call;
if (REFERENCE_REF_P (call_expr))
call_expr = TREE_OPERAND (call_expr, 0);
KOENIG_LOOKUP_P (call_expr) = KOENIG_LOOKUP_P (non_dep);
return call;
}
......
2016-01-16 Patrick Palka <ppalka@gcc.gnu.org>
PR c++/68936
* g++.dg/template/pr68936.C: New test.
2016-01-15 David Edelsohn <dje.gcc@gmail.com>
PR target/68609
......
// PR c++/68936
class A {};
struct predefined_macros {
struct B {
A (predefined_macros::*generator)();
};
};
template <typename> class C {
void m_fn1();
predefined_macros predef;
};
predefined_macros::B m;
template <typename ContextT> void C<ContextT>::m_fn1() {
(predef.*m.generator)();
}
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