]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
Suppress diagnostics substituting into a requires-expression (PR c++/92403).
authorAndrew Sutton <asutton@lock3software.com>
Tue, 19 Nov 2019 15:11:14 +0000 (15:11 +0000)
committerAndrew Sutton <asutton@gcc.gnu.org>
Tue, 19 Nov 2019 15:11:14 +0000 (15:11 +0000)
gcc/cp/
* pt.c (tsubst_copy_and_build): Perform the first substitution without
diagnostics and a second only if tsubst_requries_expr returns an error.

From-SVN: r278449

gcc/cp/ChangeLog
gcc/cp/pt.c

index 30ebf18a24494f88f75ce63b5ba622f6abb34b19..819de7315a51a786b5cf5702a2cb392132d18c6f 100644 (file)
@@ -1,3 +1,10 @@
+2019-11-19  Andrew Sutton  <asutton@lock3software.com>
+
+       PR c++/92403
+       Suppress diagnostics substituting into a requires-expression.
+       * pt.c (tsubst_copy_and_build): Perform the first substitution without
+       diagnostics and a second only if tsubst_requries_expr returns an error.
+
 2019-11-19  Jakub Jelinek  <jakub@redhat.com>
 
        PR c++/92504
index 8f7734a7a4196ac34c56c42fe0028e6b8b76e058..424098aab3abd82e06e5ff71495c26eda0f7b82c 100644 (file)
@@ -20139,7 +20139,12 @@ tsubst_copy_and_build (tree t,
       }
 
     case REQUIRES_EXPR:
-      RETURN (tsubst_requires_expr (t, args, complain, in_decl));
+      {
+       tree r = tsubst_requires_expr (t, args, tf_none, in_decl);
+       if (r == error_mark_node && (complain & tf_error))
+         tsubst_requires_expr (t, args, complain, in_decl);
+       RETURN (r);
+      }
 
     case RANGE_EXPR:
       /* No need to substitute further, a RANGE_EXPR will always be built