]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
pt.c (type_unification_real): Correct complain arg for tsubsting default template...
authorJason Merrill <jason@redhat.com>
Wed, 7 Sep 2011 17:11:37 +0000 (13:11 -0400)
committerJason Merrill <jason@gcc.gnu.org>
Wed, 7 Sep 2011 17:11:37 +0000 (13:11 -0400)
* pt.c (type_unification_real): Correct complain arg for tsubsting
default template args.

From-SVN: r178651

gcc/cp/ChangeLog
gcc/cp/pt.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp0x/sfinae11.C
libstdc++-v3/ChangeLog
libstdc++-v3/testsuite/20_util/bind/ref_neg.cc
libstdc++-v3/testsuite/20_util/duration/cons/1_neg.cc

index 6d8430e5897a54e42f2683d3af021387bb314c60..ea67d2d5d5a0f31541c7984c06c81a68326e8095 100644 (file)
@@ -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>
index d883c1635fa7ad09622cb633b15b298176df15ea..d326c842c701a091faf8c8e06350970c5d48f6b7 100644 (file)
@@ -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;
index 07cd5934303de736e4458e0c1bf9ea5fca5b77b8..5247ac6b98499b4d738d39f9dca63540f3e0c806 100644 (file)
@@ -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.
index e62c08984e78ee193a18bccc3a3cf08faa141a1b..25902cbd65e813ebf06a1ef94a613d7749f17766 100644 (file)
@@ -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" }
 }
index 7c57a5108638fba837a3f563c8a7ad748c885def..b3d4dbb00b5b372fb1de28167a80f233e9b8fa78 100644 (file)
@@ -1,3 +1,8 @@
+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>
 
        * include/std/tuple (_Tuple_impl::_M_head, _M_tail): Mark constexpr.
index daa815c54d975f3f2363af996a1a44dc146d5e7b..f5a08c2630a9d388947f3700da5af041e413fb42 100644 (file)
@@ -29,8 +29,8 @@ int inc(int& i) { return ++i; }
 void test01()
 {
   const int dummy = 0;
-  std::bind(&inc, _1)(0);               // { dg-error  "no match" }
-  std::bind(&inc, std::ref(dummy))();  // { dg-error  "no match" }
+  std::bind(&inc, _1)(0);               // { dg-error  "no match|rvalue" }
+  std::bind(&inc, std::ref(dummy))();  // { dg-error  "no match|const" }
 }
 
 struct Inc
index eddd57ce035546b0d2b4c4cd86221e0be326c9d0..97f4ef14002ab3fcf7e2fa18f25fde9b1d4a7858 100644 (file)
@@ -26,7 +26,7 @@
 void
 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
@@ -35,6 +35,6 @@ test02()
   using namespace std::chrono;
   
   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" }
 }