Commit 30288f9a by Jason Merrill Committed by Jason Merrill

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
parent 10e8dd82
2011-09-07 Jason Merrill <jason@redhat.com> 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. * pt.c (tsubst_aggr_type): Check TYPE_P before tsubsting.
2011-09-06 Jason Merrill <jason@redhat.com> 2011-09-06 Jason Merrill <jason@redhat.com>
......
...@@ -14804,6 +14804,10 @@ type_unification_real (tree tparms, ...@@ -14804,6 +14804,10 @@ type_unification_real (tree tparms,
if (!subr) 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 /* Check to see if we need another pass before we start clearing
ARGUMENT_PACK_INCOMPLETE_P. */ ARGUMENT_PACK_INCOMPLETE_P. */
for (i = 0; i < ntparms; i++) for (i = 0; i < ntparms; i++)
...@@ -14854,11 +14858,8 @@ type_unification_real (tree tparms, ...@@ -14854,11 +14858,8 @@ type_unification_real (tree tparms,
{ {
tree parm = TREE_VALUE (TREE_VEC_ELT (tparms, i)); tree parm = TREE_VALUE (TREE_VEC_ELT (tparms, i));
tree arg = TREE_PURPOSE (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 = tsubst_template_arg (arg, targs, complain, NULL_TREE);
arg = convert_template_argument (parm, arg, targs, arg = convert_template_argument (parm, arg, targs, complain,
(explain_p
? tf_warning_or_error
: tf_none),
i, NULL_TREE); i, NULL_TREE);
if (arg == error_mark_node) if (arg == error_mark_node)
return 1; return 1;
......
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> 2011-09-07 Georg-Johann Lay <avr@gjlay.de>
* gcc.dg/section1.c: Don't xfail for avr. * gcc.dg/section1.c: Don't xfail for avr.
......
...@@ -52,5 +52,6 @@ int main() ...@@ -52,5 +52,6 @@ int main()
noexcept( f1(z) ); // { dg-message "required" } noexcept( f1(z) ); // { dg-message "required" }
static_assert( noexcept( f2(z) ), "shall be ill-formed." ); // { dg-error "no match|could not convert" } 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" } noexcept( f3(z) ); // { dg-message "required" }
} }
2011-09-07 Jason Merrill <jason@redhat.com>
* testsuite/20_util/bind/ref_neg.cc: Adjust errors.
* testsuite/20_util/duration/cons/1_neg.cc: Adjust errors.
2011-09-06 Benjamin Kosnik <bkoz@redhat.com> 2011-09-06 Benjamin Kosnik <bkoz@redhat.com>
* include/std/tuple (_Tuple_impl::_M_head, _M_tail): Mark constexpr. * include/std/tuple (_Tuple_impl::_M_head, _M_tail): Mark constexpr.
......
...@@ -29,8 +29,8 @@ int inc(int& i) { return ++i; } ...@@ -29,8 +29,8 @@ int inc(int& i) { return ++i; }
void test01() void test01()
{ {
const int dummy = 0; const int dummy = 0;
std::bind(&inc, _1)(0); // { dg-error "no match" } std::bind(&inc, _1)(0); // { dg-error "no match|rvalue" }
std::bind(&inc, std::ref(dummy))(); // { dg-error "no match" } std::bind(&inc, std::ref(dummy))(); // { dg-error "no match|const" }
} }
struct Inc struct Inc
......
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
void void
test01() test01()
{ {
std::chrono::duration<int> d1(1.0); // { dg-error "no matching" } std::chrono::duration<int> d1(1.0); // { dg-error "no matching|no type" }
} }
void void
...@@ -35,6 +35,6 @@ test02() ...@@ -35,6 +35,6 @@ test02()
using namespace std::chrono; using namespace std::chrono;
duration<int, std::micro> d2(8); duration<int, std::micro> d2(8);
duration<int, std::milli> d2_copy(d2); // { dg-error "no matching" } duration<int, std::milli> d2_copy(d2); // { dg-error "no matching|no type" }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment