aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorAndrew Sutton <asutton@lock3software.com>2019-11-19 15:11:14 +0000
committerAndrew Sutton <asutton@gcc.gnu.org>2019-11-19 15:11:14 +0000
commit7aabd67f18fb1e0ef4c9981667284c2e57816e01 (patch)
tree59d5bd25177355d54ec96d685daec4ad46c0d68e /gcc
parent8b24d594fe111f96578eaaa8ecb14891ffeebdd3 (diff)
downloadgcc-7aabd67f18fb1e0ef4c9981667284c2e57816e01.zip
gcc-7aabd67f18fb1e0ef4c9981667284c2e57816e01.tar.gz
gcc-7aabd67f18fb1e0ef4c9981667284c2e57816e01.tar.bz2
Suppress diagnostics substituting into a requires-expression (PR c++/92403).
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
Diffstat (limited to 'gcc')
-rw-r--r--gcc/cp/ChangeLog7
-rw-r--r--gcc/cp/pt.c7
2 files changed, 13 insertions, 1 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 30ebf18..819de73 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -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
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index 8f7734a..424098a 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -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