diff options
Diffstat (limited to 'gcc/cp/pt.c')
-rw-r--r-- | gcc/cp/pt.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index ece9614..be2f031 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -8967,7 +8967,6 @@ check_instantiated_args (tree tmpl, tree args, tsubst_flags_t complain) { int ix, len = DECL_NTPARMS (tmpl); bool result = false; - bool error_p = complain & tf_error; for (ix = 0; ix != len; ix++) { @@ -8984,12 +8983,16 @@ check_instantiated_args (tree tmpl, tree args, tsubst_flags_t complain) if (nt) { - if (TYPE_ANONYMOUS_P (nt)) - error ("%qT is/uses anonymous type", t); - else - error ("%qT uses local type %qT", t, nt); + /* DR 488 makes use of a type with no linkage causes + type deduction to fail. */ + if (complain & tf_error) + { + if (TYPE_ANONYMOUS_P (nt)) + error ("%qT is/uses anonymous type", t); + else + error ("%qT uses local type %qT", t, nt); + } result = true; - error_p = true; } /* In order to avoid all sorts of complications, we do not allow variably-modified types as template arguments. */ @@ -9011,7 +9014,7 @@ check_instantiated_args (tree tmpl, tree args, tsubst_flags_t complain) result = true; } } - if (result && error_p) + if (result && (complain & tf_error)) error (" trying to instantiate %qD", tmpl); return result; } |