summaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog4
-rw-r--r--gcc/cp/constraint.cc1
-rw-r--r--gcc/testsuite/g++.dg/concepts/diagnostic1.C16
3 files changed, 21 insertions, 0 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 32392395a22..f04b15c0f62 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,5 +1,9 @@
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.
diff --git a/gcc/cp/constraint.cc b/gcc/cp/constraint.cc
index cf57cc010a4..c981212271d 100644
--- a/gcc/cp/constraint.cc
+++ b/gcc/cp/constraint.cc
@@ -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. */
diff --git a/gcc/testsuite/g++.dg/concepts/diagnostic1.C b/gcc/testsuite/g++.dg/concepts/diagnostic1.C
new file mode 100644
index 00000000000..7c360cc3943
--- /dev/null
+++ b/gcc/testsuite/g++.dg/concepts/diagnostic1.C
@@ -0,0 +1,16 @@
+// 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 "" }