re PR c++/84330 ([concepts] ICE with broken constraint)
authorPaolo Carlini <paolo.carlini@oracle.com>
Thu, 15 Feb 2018 18:05:40 +0000 (18:05 +0000)
committerPaolo Carlini <paolo@gcc.gnu.org>
Thu, 15 Feb 2018 18:05:40 +0000 (18:05 +0000)
/cp
2018-02-15  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/84330
* constraint.cc (tsubst_constraint_info): Handle an error_mark_node
as first argument.

/testsuite
2018-02-15  Paolo Carlini  <paolo.carlini@oracle.com>

PR c++/84330
* g++.dg/concepts/pr84330.C: New.

From-SVN: r257698

gcc/cp/ChangeLog
gcc/cp/constraint.cc
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/concepts/pr84330.C [new file with mode: 0644]

index 6c95dfe3a6209e78445e4b82b2169cf158e4c7d0..f7fd4e36278cb05f1062bcbff4b73fdcbbd2a11f 100644 (file)
@@ -1,3 +1,9 @@
+2018-02-15  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/84330
+       * constraint.cc (tsubst_constraint_info): Handle an error_mark_node
+       as first argument.
+
 2018-02-14  Paolo Carlini  <paolo.carlini@oracle.com>
 
        PR c++/84350
index 622c9fe97a529e8b07f7e02c90d32e6ba2a86dae..37eded17c941f42d48a5373091dfa6bec757a93a 100644 (file)
@@ -1918,7 +1918,7 @@ tsubst_constraint_info (tree t, tree args,
 tree
 tsubst_constraint (tree t, tree args, tsubst_flags_t complain, tree in_decl)
 {
-  if (t == NULL_TREE)
+  if (t == NULL_TREE || t == error_mark_node)
     return t;
   switch (TREE_CODE (t))
   {
index 3d6da2a9ca4b59bce99fa33895a76a252b26fd0e..91e14ced710958dfa77b769648d4993641e503f0 100644 (file)
@@ -1,3 +1,8 @@
+2018-02-15  Paolo Carlini  <paolo.carlini@oracle.com>
+
+       PR c++/84330
+       * g++.dg/concepts/pr84330.C: New.
+
 2018-02-15  Tom de Vries  <tom@codesourcery.com>
 
        * gcc.dg/Wstringop-overflow-3.c: Require effective target alloca.
diff --git a/gcc/testsuite/g++.dg/concepts/pr84330.C b/gcc/testsuite/g++.dg/concepts/pr84330.C
new file mode 100644 (file)
index 0000000..975ee89
--- /dev/null
@@ -0,0 +1,12 @@
+// PR c++/84330
+// { dg-options "-fconcepts" }
+
+struct A
+{
+  template<typename T> requires sizeof(T) >> 0 void foo(T);  // { dg-error "predicate constraint" }
+
+  void bar()
+  {
+    foo(0);  // { dg-error "no matching" }
+  }
+};