summaryrefslogtreecommitdiff
path: root/gcc/cp/pt.cc
diff options
context:
space:
mode:
authorMartin Liska <mliska@suse.cz>2022-11-08 12:36:43 +0100
committerMartin Liska <mliska@suse.cz>2022-11-08 12:36:43 +0100
commit4b13c73bba935443be3207abf26f7ba05f79badc (patch)
treea6bb1525d07859fa8fc6f61dd13df7ddfd1ac254 /gcc/cp/pt.cc
parent33f5dde0cd15df9cf89b29280d4ff5fcf7b30e66 (diff)
parentfa271afb58423014e2feef9f15c1a87428e64ddc (diff)
downloadgcc-devel/sphinx.tar.gz
Merge branch 'master' into devel/sphinxdevel/sphinx
Diffstat (limited to 'gcc/cp/pt.cc')
-rw-r--r--gcc/cp/pt.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/gcc/cp/pt.cc b/gcc/cp/pt.cc
index c3fc56a13ff..57917de321f 100644
--- a/gcc/cp/pt.cc
+++ b/gcc/cp/pt.cc
@@ -20937,8 +20937,9 @@ tsubst_copy_and_build (tree t,
/* In a lambda fn, we have to be careful to not
introduce new this captures. Legacy code can't
be using lambdas anyway, so it's ok to be
- stricter. Be strict with C++20 template-id ADL too. */
- bool strict = in_lambda || template_id_p;
+ stricter. Be strict with C++20 template-id ADL too.
+ And be strict if we're already failing anyway. */
+ bool strict = in_lambda || template_id_p || seen_error();
bool diag = true;
if (strict)
error_at (cp_expr_loc_or_input_loc (t),