diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index 1bc0e5a05ab5c7416c87a5615bcd70fc1f501716..21bfbcd2ebd820a07e4d30e664acd20c1cf120b7 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,8 @@
+2011-11-20  Jason Merrill  <jason@redhat.com>
+
+	* pt.c (type_unification_real): Set input_location
+	during default arg instantiation.
+
 2011-11-20  Paolo Carlini  <paolo.carlini@oracle.com>
 
 	PR c++/51230
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index f4eb1d4852afe49768d235908f16e64231a02595..5b39e9fbb4291a803905b0e7c0e14081036e8e3a 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -15218,9 +15218,13 @@ type_unification_real (tree tparms,
 	    {
 	      tree parm = TREE_VALUE (TREE_VEC_ELT (tparms, i));
 	      tree arg = TREE_PURPOSE (TREE_VEC_ELT (tparms, i));
+	      location_t save_loc = input_location;
+	      if (DECL_P (parm))
+		input_location = DECL_SOURCE_LOCATION (parm);
 	      arg = tsubst_template_arg (arg, targs, complain, NULL_TREE);
 	      arg = convert_template_argument (parm, arg, targs, complain,
 					       i, NULL_TREE);
+	      input_location = save_loc;
 	      if (arg == error_mark_node)
 		return 1;
 	      else
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 8b2f661ec77b451ffb106edc1386fd946ea696aa..57ed126332ef4102afa948dc3d45924d5b576f6a 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,9 @@
+2011-11-20  Jason Merrill  <jason@redhat.com>
+
+	* g++.dg/cpp0x/sfinae11.C: Adjust.
+	* g++.dg/cpp0x/sfinae26.C: Adjust.
+	* g++.dg/template/unify11.C: Adjust.
+
 2011-11-20  Paolo Carlini  <paolo.carlini@oracle.com>
 
 	PR c++/51230
diff --git a/gcc/testsuite/g++.dg/cpp0x/sfinae11.C b/gcc/testsuite/g++.dg/cpp0x/sfinae11.C
index 25902cbd65e813ebf06a1ef94a613d7749f17766..2e8408d8f4da83b5e0bc94e4687cd7e0c79cda61 100644
--- a/gcc/testsuite/g++.dg/cpp0x/sfinae11.C
+++ b/gcc/testsuite/g++.dg/cpp0x/sfinae11.C
@@ -12,7 +12,8 @@ inline void f1( T& x ) noexcept( noexcept( declval<T&>().foo() ) ) // { dg-error
 }
 
 template< class T,
-  bool Noexcept = noexcept( declval<T&>().foo() )
+  bool Noexcept = noexcept( declval<T&>().foo() ) // { dg-error "no member|not convert" }
+
 >
 inline void f2( T& x ) noexcept( Noexcept )
 {
@@ -51,7 +52,6 @@ int main()
   // static_assert(  noexcept( f3(y) ), "shall be ill-formed(OK)." );
 
   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 }
+  static_assert(  noexcept( f2(z) ), "shall be ill-formed." ); // { dg-error "no match" }
   noexcept( f3(z) );		// { dg-message "required" }
 }
diff --git a/gcc/testsuite/g++.dg/template/unify11.C b/gcc/testsuite/g++.dg/template/unify11.C
index 25606dc4af885f26b6d3ff7f4cf4e6eb98f0aac6..85bdbbc940ad3150412ab5d541bfba9e83bd27f3 100644
--- a/gcc/testsuite/g++.dg/template/unify11.C
+++ b/gcc/testsuite/g++.dg/template/unify11.C
@@ -6,9 +6,10 @@ struct A
 {
 };
 
-template <typename S, typename T, typename U, typename S::v = &S::v::s>
+template <typename S, typename T, typename U,
+	  typename S::v = &S::v::s> // { dg-error "is not a" }
 typename S::A
-foo (S c, T t, U u)		// { dg-message "note" }
+foo (S c, T t, U u)
 {
 }
 
@@ -20,8 +21,7 @@ struct B
     C (U t)
     {
       A a;
-      A b = foo (this, a, t); // { dg-error "(no matching function|is not a)" }
-      // { dg-message "candidate" "candidate note" { target *-*-* } 23 }
+      A b = foo (this, a, t); // { dg-error "no matching function" }
     }
   } c;
   B () : c (A ())
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index 5515c0778d2402bb7d256145e4faedb86aa33a40..282e95b1fa3ab8bf4b3a77107d05b4d7763c1790 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,3 +1,7 @@
+2011-11-20  Jason Merrill  <jason@redhat.com>
+
+	* testsuite/20_util/bind/ref_neg.cc: Adjust error markings.
+
 2011-11-20  Jonathan Wakely  <jwakely.gcc@gmail.com>
 
 	* include/backward/binders.h: Fix examples in doxygen comments and
diff --git a/libstdc++-v3/testsuite/20_util/bind/ref_neg.cc b/libstdc++-v3/testsuite/20_util/bind/ref_neg.cc
index f5a08c2630a9d388947f3700da5af041e413fb42..d2441a39ecba0a655a903e10bc6828f33cd1cd0c 100644
--- a/libstdc++-v3/testsuite/20_util/bind/ref_neg.cc
+++ b/libstdc++-v3/testsuite/20_util/bind/ref_neg.cc
@@ -29,8 +29,12 @@ int inc(int& i) { return ++i; }
 void test01()
 {
   const int dummy = 0;
-  std::bind(&inc, _1)(0);               // { dg-error  "no match|rvalue" }
-  std::bind(&inc, std::ref(dummy))();	// { dg-error  "no match|const" }
+  std::bind(&inc, _1)(0);               // { dg-error  "no match" }
+  // { dg-error "rvalue|const" "" { target *-*-* } 1199 }
+  // { dg-error "rvalue|const" "" { target *-*-* } 1212 }
+  // { dg-error "rvalue|const" "" { target *-*-* } 1226 }
+  // { dg-error "rvalue|const" "" { target *-*-* } 1240 }
+  std::bind(&inc, std::ref(dummy))();	// { dg-error  "no match" }
 }
 
 struct Inc