diff options
author | Jason Merrill <jason@redhat.com> | 2011-09-07 13:11:37 -0400 |
---|---|---|
committer | Jason Merrill <jason@gcc.gnu.org> | 2011-09-07 13:11:37 -0400 |
commit | 30288f9aa21c6ef870bdf792a1eee4f90fd2c468 (patch) | |
tree | 22d6ae8519d8931bc1071d38e7e5836299a2105f /gcc | |
parent | 10e8dd82753c1b5a864bc5a28c77ddd037528578 (diff) | |
download | gcc-30288f9aa21c6ef870bdf792a1eee4f90fd2c468.zip gcc-30288f9aa21c6ef870bdf792a1eee4f90fd2c468.tar.gz gcc-30288f9aa21c6ef870bdf792a1eee4f90fd2c468.tar.bz2 |
pt.c (type_unification_real): Correct complain arg for tsubsting default template args.
* pt.c (type_unification_real): Correct complain arg for tsubsting
default template args.
From-SVN: r178651
Diffstat (limited to 'gcc')
-rw-r--r-- | gcc/cp/ChangeLog | 3 | ||||
-rw-r--r-- | gcc/cp/pt.c | 11 | ||||
-rw-r--r-- | gcc/testsuite/ChangeLog | 4 | ||||
-rw-r--r-- | gcc/testsuite/g++.dg/cpp0x/sfinae11.C | 1 |
4 files changed, 14 insertions, 5 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index 6d8430e..ea67d2d 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,8 @@ 2011-09-07 Jason Merrill <jason@redhat.com> + * pt.c (type_unification_real): Correct complain arg for tsubsting + default template args. + * pt.c (tsubst_aggr_type): Check TYPE_P before tsubsting. 2011-09-06 Jason Merrill <jason@redhat.com> diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c index d883c16..d326c84 100644 --- a/gcc/cp/pt.c +++ b/gcc/cp/pt.c @@ -14804,6 +14804,10 @@ type_unification_real (tree tparms, if (!subr) { + tsubst_flags_t complain = (explain_p + ? tf_warning_or_error + : tf_none); + /* Check to see if we need another pass before we start clearing ARGUMENT_PACK_INCOMPLETE_P. */ for (i = 0; i < ntparms; i++) @@ -14854,11 +14858,8 @@ type_unification_real (tree tparms, { tree parm = TREE_VALUE (TREE_VEC_ELT (tparms, i)); tree arg = TREE_PURPOSE (TREE_VEC_ELT (tparms, i)); - arg = tsubst_template_arg (arg, targs, tf_none, NULL_TREE); - arg = convert_template_argument (parm, arg, targs, - (explain_p - ? tf_warning_or_error - : tf_none), + arg = tsubst_template_arg (arg, targs, complain, NULL_TREE); + arg = convert_template_argument (parm, arg, targs, complain, i, NULL_TREE); if (arg == error_mark_node) return 1; diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog index 07cd593..5247ac6 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,7 @@ +2011-09-07 Jason Merrill <jason@redhat.com> + + * g++.dg/cpp0x/sfinae11.C: Check for explanatory diagnostic. + 2011-09-07 Georg-Johann Lay <avr@gjlay.de> * gcc.dg/section1.c: Don't xfail for avr. diff --git a/gcc/testsuite/g++.dg/cpp0x/sfinae11.C b/gcc/testsuite/g++.dg/cpp0x/sfinae11.C index e62c089..25902cb 100644 --- a/gcc/testsuite/g++.dg/cpp0x/sfinae11.C +++ b/gcc/testsuite/g++.dg/cpp0x/sfinae11.C @@ -52,5 +52,6 @@ int main() noexcept( f1(z) ); // { dg-message "required" } static_assert( noexcept( f2(z) ), "shall be ill-formed." ); // { dg-error "no match|could not convert" } + // { dg-error "no member" "" { target *-*-* } 54 } noexcept( f3(z) ); // { dg-message "required" } } |