Commit 4e7739b2 by Jason Merrill Committed by Jason Merrill

re PR c++/67159 ([c++concepts] Segfault while diagnosing constraint violation)

	PR c++/67159
	* constraint.cc (finish_template_introduction):
	SET_NON_DEFAULT_TEMPLATE_ARGS_COUNT.

From-SVN: r226738
parent d6729a42
2015-08-08 Jason Merrill <jason@redhat.com>
PR c++/67159
* constraint.cc (finish_template_introduction):
SET_NON_DEFAULT_TEMPLATE_ARGS_COUNT.
PR c++/67142
* pt.c (equal): Make sure tmpl is actually a template.
......
......@@ -1337,6 +1337,7 @@ finish_template_introduction (tree tmpl_decl, tree intro_list)
tree parm = TREE_VEC_ELT (parm_list, n);
TREE_VEC_ELT (check_args, n) = template_parm_to_arg (parm);
}
SET_NON_DEFAULT_TEMPLATE_ARGS_COUNT (check_args, n);
/* If the template expects more parameters we should be able
to use the defaults from our deduced concept. */
......
// PR c++/67159
// { dg-options -std=c++1z }
template <class T>
concept bool R = requires (T& t) {
{ t.begin() } -> T
};
struct foo {
int* begin();
};
R{T}
constexpr bool f() { return true; }
static_assert(f<foo>()); // { dg-error "" }
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