Patchwork C++ PATCH for c++/48969 (infinite template recursion with enum scope)

login
register
mail settings
Submitter Jason Merrill
Date June 8, 2011, 2:27 a.m.
Message ID <4DEEDE02.2030704@redhat.com>
Download mbox | patch
Permalink /patch/99354/
State New
Headers show

Comments

Jason Merrill - June 8, 2011, 2:27 a.m.
Discussion on the committee reflectors referred me to N2634, the design 
paper for the new SFINAE rules, which says that exceeding an 
implementation limit is a hard error, not a substitution failure.  So 
this patch does away with the tracking of indivitual substitutions and 
just uses push_tinst_level to handle nesting.  On enum11.C the compiler 
crashes before hitting the limit of 1024 due to excessive recursion, so 
I've lowered the default for -ftemplate-depth to 900.

Tested x86_64-pc-linux-gnu, applied to trunk.

Patch

commit d6f0884d94341406257c525185fbf8faf14cd390
Author: Jason Merrill <jason@redhat.com>
Date:   Tue Jun 7 16:06:48 2011 -0400

    	* error.c (subst_to_string): New.
    	(cp_printer): Use it for 'S'.
    	(print_instantiation_partial_context_line): Handle subst context.
    	* pt.c (push_tinst_level): Handle subst context.
    	(deduction_tsubst_fntype): Don't track specific substitutions.
    	Use push_tinst_level.

diff --git a/gcc/c-family/c-common.c b/gcc/c-family/c-common.c
index e5c070f..37a5f1e 100644
--- a/gcc/c-family/c-common.c
+++ b/gcc/c-family/c-common.c
@@ -255,10 +255,13 @@  int flag_use_repository;
 enum cxx_dialect cxx_dialect = cxx98;
 
 /* Maximum template instantiation depth.  This limit exists to limit the
-   time it takes to notice excessively recursive template instantiations;
-   the default value of 1024 is likely to be in the next C++ standard.  */
+   time it takes to notice excessively recursive template instantiations.
 
-int max_tinst_depth = 1024;
+   The default is lower than the 1024 recommended by the C++0x standard
+   because G++ runs out of stack before 1024 with highly recursive template
+   argument deduction substitution (g++.dg/cpp0x/enum11.C).  */
+
+int max_tinst_depth = 900;
 
 /* The elements of `ridpointers' are identifier nodes for the reserved
    type names and storage classes.  It is indexed by a RID_... value.  */
diff --git a/gcc/cp/error.c b/gcc/cp/error.c
index a40630a..d9652dc 100644
--- a/gcc/cp/error.c
+++ b/gcc/cp/error.c
@@ -2665,6 +2665,32 @@  args_to_string (tree p, int verbose)
   return pp_formatted_text (cxx_pp);
 }
 
+/* Pretty-print a deduction substitution (from deduction_tsubst_fntype).  P
+   is a TREE_LIST with purpose the TEMPLATE_DECL, value the template
+   arguments.  */
+
+static const char *
+subst_to_string (tree p)
+{
+  tree decl = TREE_PURPOSE (p);
+  tree targs = TREE_VALUE (p);
+  tree tparms = DECL_TEMPLATE_PARMS (decl);
+  int flags = TFF_DECL_SPECIFIERS|TFF_TEMPLATE_HEADER;
+
+  if (p == NULL_TREE)
+    return "";
+
+  reinit_cxx_pp ();
+  dump_template_decl (TREE_PURPOSE (p), flags);
+  pp_cxx_whitespace (cxx_pp);
+  pp_cxx_left_bracket (cxx_pp);
+  pp_cxx_ws_string (cxx_pp, M_("with"));
+  pp_cxx_whitespace (cxx_pp);
+  dump_template_bindings (tparms, targs, NULL);
+  pp_cxx_right_bracket (cxx_pp);
+  return pp_formatted_text (cxx_pp);
+}
+
 static const char *
 cv_to_string (tree p, int v)
 {
@@ -2888,38 +2914,34 @@  print_instantiation_partial_context_line (diagnostic_context *context,
   expanded_location xloc;
   xloc = expand_location (loc);
 
-  if (t != NULL) 
+  if (context->show_column)
+    pp_verbatim (context->printer, _("%s:%d:%d:   "),
+		 xloc.file, xloc.line, xloc.column);
+  else
+    pp_verbatim (context->printer, _("%s:%d:   "),
+		 xloc.file, xloc.line);
+
+  if (t != NULL)
     {
-      const char *str;
-      str = decl_as_string_translate (t->decl,
-				      TFF_DECL_SPECIFIERS | TFF_RETURN_TYPE);
-      if (context->show_column)
+      if (TREE_CODE (t->decl) == TREE_LIST)
 	pp_verbatim (context->printer,
 		     recursive_p
-		     ? _("%s:%d:%d:   recursively instantiated from %qs\n")
-		     : _("%s:%d:%d:   instantiated from %qs\n"),
-		     xloc.file, xloc.line, xloc.column, str);
+		     ? _("recursively required by substitution of %qS\n")
+		     : _("required by substitution of %qS\n"),
+		     t->decl);
       else
 	pp_verbatim (context->printer,
 		     recursive_p
-		     ? _("%s:%d:   recursively instantiated from %qs\n")
-		     : _("%s:%d:   recursively instantiated from %qs\n"),
-		     xloc.file, xloc.line, str);
+		     ? _("recursively required from %q#D\n")
+		     : _("required from %q#D\n"),
+		     t->decl);
     }
   else
     {
-      if (context->show_column)
-	pp_verbatim (context->printer, 
-		     recursive_p
-		     ? _("%s:%d:%d:   recursively instantiated from here")
-		     : _("%s:%d:%d:   instantiated from here"),
-		     xloc.file, xloc.line, xloc.column);
-      else
-	pp_verbatim (context->printer,
-		     recursive_p
-		     ? _("%s:%d:   recursively instantiated from here")
-		     : _("%s:%d:   instantiated from here"),
-		     xloc.file, xloc.line);
+      pp_verbatim (context->printer,
+		   recursive_p
+		   ? _("recursively required from here")
+		   : _("required from here"));
     }
 }
 
@@ -3093,6 +3115,7 @@  cp_printer (pretty_printer *pp, text_info *text, const char *spec,
     case 'O': result = op_to_string (next_tcode);		break;
     case 'P': result = parm_to_string (next_int);		break;
     case 'Q': result = assop_to_string (next_tcode);		break;
+    case 'S': result = subst_to_string (next_tree);		break;
     case 'T': result = type_to_string (next_tree, verbose);	break;
     case 'V': result = cv_to_string (next_tree, verbose);	break;
 
diff --git a/gcc/cp/pt.c b/gcc/cp/pt.c
index ce43d8a..f93fa7f 100644
--- a/gcc/cp/pt.c
+++ b/gcc/cp/pt.c
@@ -7490,16 +7490,15 @@  push_tinst_level (tree d)
 
   if (tinst_depth >= max_tinst_depth)
     {
-      /* If the instantiation in question still has unbound template parms,
-	 we don't really care if we can't instantiate it, so just return.
-	 This happens with base instantiation for implicit `typename'.  */
-      if (uses_template_parms (d))
-	return 0;
-
       last_template_error_tick = tinst_level_tick;
-      error ("template instantiation depth exceeds maximum of %d (use "
-	     "-ftemplate-depth= to increase the maximum) instantiating %qD",
-	     max_tinst_depth, d);
+      if (TREE_CODE (d) == TREE_LIST)
+	error ("template instantiation depth exceeds maximum of %d (use "
+	       "-ftemplate-depth= to increase the maximum) substituting %qS",
+	       max_tinst_depth, d);
+      else
+	error ("template instantiation depth exceeds maximum of %d (use "
+	       "-ftemplate-depth= to increase the maximum) instantiating %qD",
+	       max_tinst_depth, d);
 
       print_instantiation_context ();
 
@@ -13594,11 +13593,6 @@  check_instantiated_args (tree tmpl, tree args, tsubst_flags_t complain)
   return result;
 }
 
-DEF_VEC_O (spec_entry);
-DEF_VEC_ALLOC_O (spec_entry,gc);
-static GTY(()) VEC(spec_entry,gc) *current_deduction_vec;
-static GTY((param_is (spec_entry))) htab_t current_deduction_htab;
-
 /* In C++0x, it's possible to have a function template whose type depends
    on itself recursively.  This is most obvious with decltype, but can also
    occur with enumeration scope (c++/48969).  So we need to catch infinite
@@ -13609,133 +13603,48 @@  static GTY((param_is (spec_entry))) htab_t current_deduction_htab;
    f<N-1> across all integers, and returns error_mark_node for all the
    substitutions back up to the initial one.
 
-   This is, of course, not reentrant.
-
-   Use of a VEC here is O(n^2) in the depth of function template argument
-   deduction substitution, but using a hash table creates a lot of constant
-   overhead for the typical case of very low depth.  So to make the typical
-   case fast we start out with a VEC and switch to a hash table only if
-   depth gets to be significant; in one metaprogramming testcase, even at
-   depth 80 the overhead of the VEC relative to a hash table was only about
-   0.5% of compile time.  */
+   This is, of course, not reentrant.  */
 
 static tree
 deduction_tsubst_fntype (tree fn, tree targs)
 {
   static bool excessive_deduction_depth;
-
-  unsigned i;
-  spec_entry **slot;
-  spec_entry *p;
-  spec_entry elt;
-  tree r;
-  hashval_t hash;
+  static int deduction_depth;
+  location_t save_loc = input_location;
 
   tree fntype = TREE_TYPE (fn);
+  tree tinst;
+  tree r;
 
-  /* We don't need to worry about this in C++98.  */
-  if (cxx_dialect < cxx0x)
-    {
-      push_deduction_access_scope (fn);
-      r = tsubst (fntype, targs, tf_none, NULL_TREE);
-      pop_deduction_access_scope (fn);
-      return r;
-    }
-
-  /* If we're seeing a lot of recursion, switch over to a hash table.  The
-     constant 40 is fairly arbitrary.  */
-  if (!current_deduction_htab
-      && VEC_length (spec_entry, current_deduction_vec) > 40)
-    {
-      current_deduction_htab = htab_create_ggc (40*2, hash_specialization,
-						eq_specializations, ggc_free);
-      FOR_EACH_VEC_ELT (spec_entry, current_deduction_vec, i, p)
-	{
-	  slot = (spec_entry **) htab_find_slot (current_deduction_htab,
-						 p, INSERT);
-	  *slot = ggc_alloc_spec_entry ();
-	  **slot = *p;
-	}
-      VEC_free (spec_entry, gc, current_deduction_vec);
-    }
+  if (excessive_deduction_depth)
+    return error_mark_node;
 
-  /* Now check everything in the vector, if any.  */
-  FOR_EACH_VEC_ELT (spec_entry, current_deduction_vec, i, p)
-    if (p->tmpl == fn && comp_template_args (p->args, targs))
-      {
-	p->spec = error_mark_node;
-	return error_mark_node;
-      }
-
-  elt.tmpl = fn;
-  elt.args = targs;
-  elt.spec = NULL_TREE;
-
-  /* If we've created a hash table, look there.  */
-  if (current_deduction_htab)
-    {
-      if (htab_elements (current_deduction_htab)
-	  > (unsigned) max_tinst_depth)
-	{
-	  /* Trying to recurse across all integers or some such.  */
-	  excessive_deduction_depth = true;
-	  return error_mark_node;
-	}
-
-      hash = hash_specialization (&elt);
-      slot = (spec_entry **)
-	htab_find_slot_with_hash (current_deduction_htab, &elt, hash, INSERT);
-      if (*slot)
-	{
-	  /* We already have an entry for this.  */
-	  (*slot)->spec = error_mark_node;
-	  return error_mark_node;
-	}
-      else
-	{
-	  /* Create a new entry.  */
-	  *slot = ggc_alloc_spec_entry ();
-	  **slot = elt;
-	}
-    }
-  else
+  tinst = build_tree_list (fn, targs);
+  if (!push_tinst_level (tinst))
     {
-      /* No hash table, so add it to the VEC.  */
-      hash = 0;
-      VEC_safe_push (spec_entry, gc, current_deduction_vec, &elt);
+      excessive_deduction_depth = true;
+      ggc_free (tinst);
+      return error_mark_node;
     }
 
+  input_location = DECL_SOURCE_LOCATION (fn);
+  ++deduction_depth;
   push_deduction_access_scope (fn);
   r = tsubst (fntype, targs, tf_none, NULL_TREE);
   pop_deduction_access_scope (fn);
+  --deduction_depth;
+  input_location = save_loc;
 
-  /* After doing the substitution, make sure we didn't hit it again.  Note
-     that we might have switched to a hash table during tsubst.  */
-  if (current_deduction_htab)
-    {
-      if (hash == 0)
-	hash = hash_specialization (&elt);
-      slot = (spec_entry **)
-	htab_find_slot_with_hash (current_deduction_htab, &elt, hash,
-				  NO_INSERT);
-      if ((*slot)->spec == error_mark_node)
-	r = error_mark_node;
-      htab_clear_slot (current_deduction_htab, (void**)slot);
-    }
-  else
-    {
-      if (VEC_last (spec_entry, current_deduction_vec)->spec
-	  == error_mark_node)
-	r = error_mark_node;
-      VEC_pop (spec_entry, current_deduction_vec);
-    }
   if (excessive_deduction_depth)
     {
       r = error_mark_node;
-      if (htab_elements (current_deduction_htab) == 0)
+      if (deduction_depth == 0)
 	/* Reset once we're all the way out.  */
 	excessive_deduction_depth = false;
     }
+
+  pop_tinst_level ();
+  ggc_free (tinst);
   return r;
 }
 
@@ -19562,11 +19471,6 @@  print_template_statistics (void)
 	   "%f collisions\n", (long) htab_size (type_specializations),
 	   (long) htab_elements (type_specializations),
 	   htab_collisions (type_specializations));
-  if (current_deduction_htab)
-    fprintf (stderr, "current_deduction_htab: size %ld, %ld elements, "
-	     "%f collisions\n", (long) htab_size (current_deduction_htab),
-	     (long) htab_elements (current_deduction_htab),
-	     htab_collisions (current_deduction_htab));
 }
 
 #include "gt-cp-pt.h"
diff --git a/gcc/doc/invoke.texi b/gcc/doc/invoke.texi
index a069042..54ab324 100644
--- a/gcc/doc/invoke.texi
+++ b/gcc/doc/invoke.texi
@@ -2069,7 +2069,8 @@  Set the maximum instantiation depth for template classes to @var{n}.
 A limit on the template instantiation depth is needed to detect
 endless recursions during template class instantiation.  ANSI/ISO C++
 conforming programs must not rely on a maximum depth greater than 17
-(changed to 1024 in C++0x).
+(changed to 1024 in C++0x).  The default value is 900, as the compiler
+can run out of stack space before hitting 1024 in some situations.
 
 @item -fno-threadsafe-statics
 @opindex fno-threadsafe-statics
diff --git a/gcc/testsuite/g++.dg/abi/mangle11.C b/gcc/testsuite/g++.dg/abi/mangle11.C
index 3152c25..722d43c 100644
--- a/gcc/testsuite/g++.dg/abi/mangle11.C
+++ b/gcc/testsuite/g++.dg/abi/mangle11.C
@@ -7,4 +7,4 @@  struct S {
   typedef int X;
 };
 
-template void f<S> (int); // { dg-message "instantiated" }
+template void f<S> (int); // { dg-message "required" }
diff --git a/gcc/testsuite/g++.dg/abi/mangle12.C b/gcc/testsuite/g++.dg/abi/mangle12.C
index 3910cfc..92f49c2 100644
--- a/gcc/testsuite/g++.dg/abi/mangle12.C
+++ b/gcc/testsuite/g++.dg/abi/mangle12.C
@@ -8,4 +8,4 @@  struct S {
   typedef int X;
 };
 
-template void f<S> (int);  // { dg-message "instantiated" }
+template void f<S> (int);  // { dg-message "required" }
diff --git a/gcc/testsuite/g++.dg/abi/mangle17.C b/gcc/testsuite/g++.dg/abi/mangle17.C
index 57f1a04..f98e271 100644
--- a/gcc/testsuite/g++.dg/abi/mangle17.C
+++ b/gcc/testsuite/g++.dg/abi/mangle17.C
@@ -5,7 +5,7 @@  enum E { e = 3 };
 template <int I> struct S {};
 
 template <int I> void f (S<I + e + int (3.7)>) {} // { dg-warning "mangle" }
-template void f<7>(S<7 + e + int (3.7)>); // { dg-message "instantiated" }
+template void f<7>(S<7 + e + int (3.7)>); // { dg-message "required" }
 
 template <int I> void g (S<I + e + int (3.7)>) {} // { dg-warning "mangle" }
-template void g<7>(S<7 + e + int (3.7)>); // { dg-message "instantiated" }
+template void g<7>(S<7 + e + int (3.7)>); // { dg-message "required" }
diff --git a/gcc/testsuite/g++.dg/abi/mangle20-2.C b/gcc/testsuite/g++.dg/abi/mangle20-2.C
index b244e2e..5ba6bac 100644
--- a/gcc/testsuite/g++.dg/abi/mangle20-2.C
+++ b/gcc/testsuite/g++.dg/abi/mangle20-2.C
@@ -10,7 +10,7 @@ 
 template <int I> void f(int (*)[2]) {} // { dg-warning "mangled name" }
 template <int I> void g(int (*)[I+2]) {}
 
-template void f<1>(int (*)[2]);  // { dg-message "instantiated" }
+template void f<1>(int (*)[2]);  // { dg-message "required" }
 //  { dg-final { scan-assembler "\n_?_Z1fILi1EEvPALi2E_i\[: \t\n\]" } }
 template void g<1>(int (*)[3]);
 //  { dg-final { scan-assembler "\n_?_Z1gILi1EEvPAplT_Li2E_i\[: \t\n\]" } }
diff --git a/gcc/testsuite/g++.dg/abi/pragma-pack1.C b/gcc/testsuite/g++.dg/abi/pragma-pack1.C
index d90fc20..9b76071 100644
--- a/gcc/testsuite/g++.dg/abi/pragma-pack1.C
+++ b/gcc/testsuite/g++.dg/abi/pragma-pack1.C
@@ -23,7 +23,7 @@  template struct T<int>;   /* T<int> is instantiated here */
 template int f<int>();
 
 #pragma pack(4)
-template struct T<float>; /* T<float> is instantiated here */
+template struct T<float>; /* T<float> is required here */
 template int f<double>();
 
 int main()
diff --git a/gcc/testsuite/g++.dg/cpp0x/decltype26.C b/gcc/testsuite/g++.dg/cpp0x/decltype26.C
index 9eb9411..a81d411 100644
--- a/gcc/testsuite/g++.dg/cpp0x/decltype26.C
+++ b/gcc/testsuite/g++.dg/cpp0x/decltype26.C
@@ -3,7 +3,7 @@ 
 struct A { };
 
 template <class T>
-decltype(f(T())) f(T t)
+decltype(f(T())) f(T t)		// { dg-error "depth" }
 {
   return f(t);
 }
diff --git a/gcc/testsuite/g++.dg/cpp0x/decltype28.C b/gcc/testsuite/g++.dg/cpp0x/decltype28.C
index 0ab8932..c97fd20 100644
--- a/gcc/testsuite/g++.dg/cpp0x/decltype28.C
+++ b/gcc/testsuite/g++.dg/cpp0x/decltype28.C
@@ -9,8 +9,8 @@  void ft (F f, typename enable_if<N!=0, int>::type) {}
 
 template< class F, int N >
 decltype(ft<F, N-1> (F(), 0))
-ft (F f, typename enable_if<N==0, int>::type) {}
+ft (F f, typename enable_if<N==0, int>::type) {} // { dg-error "depth" }
 
 int main() {
-  ft<struct a*, 2> (0, 0);
+  ft<struct a*, 2> (0, 0);	// { dg-message "from here" }
 }
diff --git a/gcc/testsuite/g++.dg/cpp0x/decltype29.C b/gcc/testsuite/g++.dg/cpp0x/decltype29.C
index 1dd5a5f..2bb79d0 100644
--- a/gcc/testsuite/g++.dg/cpp0x/decltype29.C
+++ b/gcc/testsuite/g++.dg/cpp0x/decltype29.C
@@ -10,7 +10,7 @@  ft() {}
 
 template<class F, int N>
 decltype (ft<F> (F()))
-ft() {}
+ft() {}				// { dg-error "depth" }
 
 int main() {
     ft<struct a*, 0>();		// { dg-error "no match" }
diff --git a/gcc/testsuite/g++.dg/cpp0x/enum11.C b/gcc/testsuite/g++.dg/cpp0x/enum11.C
index 98b6b00..156c765 100644
--- a/gcc/testsuite/g++.dg/cpp0x/enum11.C
+++ b/gcc/testsuite/g++.dg/cpp0x/enum11.C
@@ -1,10 +1,14 @@ 
 // PR c++/48969
-// { dg-options -std=c++0x }
+// { dg-options "-std=c++0x -ftemplate-depth=10" }
 
 template<unsigned int N> struct Pair { };
 struct Foo { enum { Mask = 1 }; } foo;
 template<typename A, typename B> class Pair<A::Mask | B::Mask>
-operator|(const A &, const B &)
+operator|(const A &, const B &)	// { dg-message "substitution" }
 { }
 
-Pair<Foo::Mask> f = foo|foo;
+Pair<Foo::Mask> f = foo|foo;	// { dg-message "no match" }
+
+// { dg-prune-output "note" }
+// { dg-prune-output "here" }
+// { dg-prune-output "instantiation depth" }
diff --git a/gcc/testsuite/g++.dg/cpp0x/forw_enum8.C b/gcc/testsuite/g++.dg/cpp0x/forw_enum8.C
index c87aa5b..69e7311 100644
--- a/gcc/testsuite/g++.dg/cpp0x/forw_enum8.C
+++ b/gcc/testsuite/g++.dg/cpp0x/forw_enum8.C
@@ -15,7 +15,7 @@  template<typename T> struct S2
     enum E : int;   // { dg-error "previous definition" }
     enum E : T;     // { dg-error "different underlying type" }
 };
-template struct S2<short>; // { dg-message "instantiated from here" }
+template struct S2<short>; // { dg-message "required from here" }
 
 //This error is diagnosed at compilation time
 template<typename T> struct S3
diff --git a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-errloc2.C b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-errloc2.C
index dab53f1..f94d64e 100644
--- a/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-errloc2.C
+++ b/gcc/testsuite/g++.dg/cpp0x/lambda/lambda-errloc2.C
@@ -15,5 +15,5 @@  void f()
 
 int main()
 {
-  f<A>();			// { dg-message "instantiated" }
+  f<A>();			// { dg-message "required" }
 }
diff --git a/gcc/testsuite/g++.dg/cpp0x/pr47416.C b/gcc/testsuite/g++.dg/cpp0x/pr47416.C
index a11368a..55426c1 100644
--- a/gcc/testsuite/g++.dg/cpp0x/pr47416.C
+++ b/gcc/testsuite/g++.dg/cpp0x/pr47416.C
@@ -210,7 +210,7 @@  namespace boost
   private:table table_;
   public: unordered_map (size_type n = boost::unordered_detail::default_bucket_count,
 			 hasher hf = hasher (), key_equal eql = key_equal (),
-			 allocator_type a = allocator_type ()):table_ (n, hf, eql, a)	// { dg-message "instantiated" }
+			 allocator_type a = allocator_type ()):table_ (n, hf, eql, a)	// { dg-message "required" }
     {
     }
   };
@@ -220,6 +220,6 @@  void
 foo (const int &a)
 {
   typedef boost::unordered_map < std::string, int >Name2Port;
-  Name2Port b;			// { dg-message "instantiated" }
+  Name2Port b;			// { dg-message "required" }
   std::make_pair (a, b);
 }
diff --git a/gcc/testsuite/g++.dg/ext/case-range2.C b/gcc/testsuite/g++.dg/ext/case-range2.C
index de1f2a7..985ded3 100644
--- a/gcc/testsuite/g++.dg/ext/case-range2.C
+++ b/gcc/testsuite/g++.dg/ext/case-range2.C
@@ -22,6 +22,6 @@  int f (int i)
   switch (i) {
     case 1 ... 10: return i + 1;       // { dg-error "first entry" }
     case 3 ... 5 : return i + 3;       // { dg-error "duplicate" }
-    default: return f2 (i);            // { dg-message "instantiated" }
+    default: return f2 (i);            // { dg-message "required" }
   }
 }
diff --git a/gcc/testsuite/g++.dg/ext/case-range3.C b/gcc/testsuite/g++.dg/ext/case-range3.C
index 5a09c12..0b0c1fc 100644
--- a/gcc/testsuite/g++.dg/ext/case-range3.C
+++ b/gcc/testsuite/g++.dg/ext/case-range3.C
@@ -18,6 +18,6 @@  int f (int i)
 {
   switch (i) {
     case 1 ... 10: return i + 1;      // { dg-warning "non-standard" }
-    default: return f2 (i);           // { dg-message "instantiated" }
+    default: return f2 (i);           // { dg-message "required" }
   }
 }
diff --git a/gcc/testsuite/g++.dg/gomp/for-19.C b/gcc/testsuite/g++.dg/gomp/for-19.C
index 1929e45..7c56719 100644
--- a/gcc/testsuite/g++.dg/gomp/for-19.C
+++ b/gcc/testsuite/g++.dg/gomp/for-19.C
@@ -34,8 +34,8 @@  f3 (void)
 int
 main (void)
 {
-  f1 <int> ();		// { dg-message "instantiated from here" }
+  f1 <int> ();		// { dg-message "required from here" }
   f2 <int> ();
   f3 <const char *> ();
-  f3 <void *> ();	// { dg-message "instantiated from here" }
+  f3 <void *> ();	// { dg-message "required from here" }
 }
diff --git a/gcc/testsuite/g++.dg/gomp/pr37533.C b/gcc/testsuite/g++.dg/gomp/pr37533.C
index 7bf6194..4cbf256 100644
--- a/gcc/testsuite/g++.dg/gomp/pr37533.C
+++ b/gcc/testsuite/g++.dg/gomp/pr37533.C
@@ -43,8 +43,8 @@  f4 ()
 void
 bar ()
 {
-  f1<0> ();			// { dg-message "instantiated from here" }
-  f2<1> ();			// { dg-message "instantiated from here" }
-  f3<int> ();			// { dg-message "instantiated from here" }
-  f4<int> ();			// { dg-message "instantiated from here" }
+  f1<0> ();			// { dg-message "required from here" }
+  f2<1> ();			// { dg-message "required from here" }
+  f3<int> ();			// { dg-message "required from here" }
+  f4<int> ();			// { dg-message "required from here" }
 }
diff --git a/gcc/testsuite/g++.dg/gomp/pr38639.C b/gcc/testsuite/g++.dg/gomp/pr38639.C
index 1da3cec..e7145ff 100644
--- a/gcc/testsuite/g++.dg/gomp/pr38639.C
+++ b/gcc/testsuite/g++.dg/gomp/pr38639.C
@@ -13,5 +13,5 @@  foo ()
 void
 bar ()
 {
-  foo<0> ();				// { dg-message "instantiated from here" }
+  foo<0> ();				// { dg-message "required from here" }
 }
diff --git a/gcc/testsuite/g++.dg/gomp/tpl-parallel-2.C b/gcc/testsuite/g++.dg/gomp/tpl-parallel-2.C
index 2dceb09..93e0760 100644
--- a/gcc/testsuite/g++.dg/gomp/tpl-parallel-2.C
+++ b/gcc/testsuite/g++.dg/gomp/tpl-parallel-2.C
@@ -17,4 +17,4 @@  void S<T>::test()
 
 template struct S<int>;
 template struct S<long>;
-template struct S<float>;	// { dg-message "instantiated from here" }
+template struct S<float>;	// { dg-message "required from here" }
diff --git a/gcc/testsuite/g++.dg/inherit/base3.C b/gcc/testsuite/g++.dg/inherit/base3.C
index 866b290..313d042 100644
--- a/gcc/testsuite/g++.dg/inherit/base3.C
+++ b/gcc/testsuite/g++.dg/inherit/base3.C
@@ -5,4 +5,4 @@  template<typename T> struct A : T {};  // { dg-error "struct or class type" }
 
 struct B;
 
-A<void (B::*)()> a;  // { dg-message "instantiated" }
+A<void (B::*)()> a;  // { dg-message "required" }
diff --git a/gcc/testsuite/g++.dg/inherit/using6.C b/gcc/testsuite/g++.dg/inherit/using6.C
index 7bdfc340..1877d67 100644
--- a/gcc/testsuite/g++.dg/inherit/using6.C
+++ b/gcc/testsuite/g++.dg/inherit/using6.C
@@ -12,4 +12,4 @@  template <typename T> struct TPL : A
 };
 
 TPL<int> i;
-TPL<float> j; // { dg-message "instantiated" }
+TPL<float> j; // { dg-message "required" }
diff --git a/gcc/testsuite/g++.dg/init/placement4.C b/gcc/testsuite/g++.dg/init/placement4.C
index 9c61eca..3cfe27d 100644
--- a/gcc/testsuite/g++.dg/init/placement4.C
+++ b/gcc/testsuite/g++.dg/init/placement4.C
@@ -27,6 +27,6 @@  void operator delete(void *p,Pool<T>& pool)
 int main ()
 {
   Pool<int> pool;
-  new (pool) A();		// { dg-message "instantiated" }
+  new (pool) A();		// { dg-message "required" }
   return 0;
 }
diff --git a/gcc/testsuite/g++.dg/init/reference3.C b/gcc/testsuite/g++.dg/init/reference3.C
index 344e94e..8cc5afd 100644
--- a/gcc/testsuite/g++.dg/init/reference3.C
+++ b/gcc/testsuite/g++.dg/init/reference3.C
@@ -9,5 +9,5 @@  T f()
   T a = T();  // { dg-error "value-initialization of reference" }
 }
 
-int &a = f<int&>(); // { dg-message "instantiated from here" }
+int &a = f<int&>(); // { dg-message "required from here" }
 
diff --git a/gcc/testsuite/g++.dg/lookup/scoped6.C b/gcc/testsuite/g++.dg/lookup/scoped6.C
index b83b08f..5139396 100644
--- a/gcc/testsuite/g++.dg/lookup/scoped6.C
+++ b/gcc/testsuite/g++.dg/lookup/scoped6.C
@@ -10,7 +10,7 @@  public:
 class Bar {
   Foo<int> foo_;
 public:
-  Bar() {}  // { dg-message "instantiated" }
+  Bar() {}  // { dg-message "required" }
 };
 
 template class Foo<int>;
diff --git a/gcc/testsuite/g++.dg/lookup/using7.C b/gcc/testsuite/g++.dg/lookup/using7.C
index 69e27da..0c75a2d 100644
--- a/gcc/testsuite/g++.dg/lookup/using7.C
+++ b/gcc/testsuite/g++.dg/lookup/using7.C
@@ -9,4 +9,4 @@  template <typename T> struct B : A<T> // { dg-error "incomplete" }
                  // { dg-error "using" "using" { target *-*-* } 8 }
 };
 
-B<void> b; // { dg-message "instantiated" }
+B<void> b; // { dg-message "required" }
diff --git a/gcc/testsuite/g++.dg/other/abstract1.C b/gcc/testsuite/g++.dg/other/abstract1.C
index 8406f8a..53d767a 100644
--- a/gcc/testsuite/g++.dg/other/abstract1.C
+++ b/gcc/testsuite/g++.dg/other/abstract1.C
@@ -35,7 +35,7 @@  template <class T> struct K {
   T (*a)[2];   // { dg-error "abstract class type" }
 };
 
-template struct K<Abstract>;  // { dg-message "instantiated" }
+template struct K<Abstract>;  // { dg-message "required" }
 
 
 
diff --git a/gcc/testsuite/g++.dg/other/error10.C b/gcc/testsuite/g++.dg/other/error10.C
index 26f7ca5..5c17277 100644
--- a/gcc/testsuite/g++.dg/other/error10.C
+++ b/gcc/testsuite/g++.dg/other/error10.C
@@ -10,6 +10,6 @@  void foo(const A<N> &a)
 
 void bar()
 {
-    foo(A<0>()); // { dg-message "instantiated from here" "" }
+    foo(A<0>()); // { dg-message "required from here" "" }
 }
 
diff --git a/gcc/testsuite/g++.dg/other/error5.C b/gcc/testsuite/g++.dg/other/error5.C
index c7a142f..44c4a47 100644
--- a/gcc/testsuite/g++.dg/other/error5.C
+++ b/gcc/testsuite/g++.dg/other/error5.C
@@ -10,4 +10,4 @@  template <typename T> struct S2 : S<T> {
     using S<T>::operator typename S<T>::I*; // { dg-error "operator S\\<int\\>" "" }
 };
 
-template struct S2<int>;  // { dg-message "instantiated" "" }
+template struct S2<int>;  // { dg-message "required" "" }
diff --git a/gcc/testsuite/g++.dg/other/field1.C b/gcc/testsuite/g++.dg/other/field1.C
index 61a9df6..a719135 100644
--- a/gcc/testsuite/g++.dg/other/field1.C
+++ b/gcc/testsuite/g++.dg/other/field1.C
@@ -22,4 +22,4 @@  template <> struct X<int> {
   X();
 };
 
-X<float> i; // { dg-message "instantiated from" "" }
+X<float> i; // { dg-message "required from" "" }
diff --git a/gcc/testsuite/g++.dg/other/offsetof5.C b/gcc/testsuite/g++.dg/other/offsetof5.C
index 3c48433..b53b06f 100644
--- a/gcc/testsuite/g++.dg/other/offsetof5.C
+++ b/gcc/testsuite/g++.dg/other/offsetof5.C
@@ -19,4 +19,4 @@  struct S
   static const int j = offsetof (S, i);	// { dg-warning "invalid access|offsetof" }
 };
 
-int k = S<int>::j;			// { dg-message "instantiated from here" }
+int k = S<int>::j;			// { dg-message "required from here" }
diff --git a/gcc/testsuite/g++.dg/parse/bitfield2.C b/gcc/testsuite/g++.dg/parse/bitfield2.C
index a04d2ad..f84cc67 100644
--- a/gcc/testsuite/g++.dg/parse/bitfield2.C
+++ b/gcc/testsuite/g++.dg/parse/bitfield2.C
@@ -22,7 +22,7 @@  struct D
   T t : 3;              // { dg-error "non-integral type" }
 };
 
-D<double> d;            // { dg-message "instantiated" }
+D<double> d;            // { dg-message "required" }
 
 template <typename T>
 struct E
diff --git a/gcc/testsuite/g++.dg/parse/constant4.C b/gcc/testsuite/g++.dg/parse/constant4.C
index a1be5dd..626dd9e 100644
--- a/gcc/testsuite/g++.dg/parse/constant4.C
+++ b/gcc/testsuite/g++.dg/parse/constant4.C
@@ -34,7 +34,7 @@  template <typename> struct X
 
 void Baz ()
 {
-  Foo<int> (); // { dg-message "instantiated" "" }
+  Foo<int> (); // { dg-message "required" "" }
 }
 
   
diff --git a/gcc/testsuite/g++.dg/parse/crash20.C b/gcc/testsuite/g++.dg/parse/crash20.C
index d04869f..b601408 100644
--- a/gcc/testsuite/g++.dg/parse/crash20.C
+++ b/gcc/testsuite/g++.dg/parse/crash20.C
@@ -11,4 +11,4 @@  template<typename T> struct A
   typedef typename T::X Y; // { dg-error "not a class" "" }
 };
 
-A<int>::Y y; // { dg-message "instantiated from here" "" }
+A<int>::Y y; // { dg-message "required from here" "" }
diff --git a/gcc/testsuite/g++.dg/parse/invalid-op1.C b/gcc/testsuite/g++.dg/parse/invalid-op1.C
index 0b75d07..8d745c1 100644
--- a/gcc/testsuite/g++.dg/parse/invalid-op1.C
+++ b/gcc/testsuite/g++.dg/parse/invalid-op1.C
@@ -11,4 +11,4 @@  template <int I> struct A
     };
 };
 
-A<0>::B<0> a; // { dg-message "instantiated" }
+A<0>::B<0> a; // { dg-message "required" }
diff --git a/gcc/testsuite/g++.dg/parse/non-dependent2.C b/gcc/testsuite/g++.dg/parse/non-dependent2.C
index 4df2da7..fee66d4 100644
--- a/gcc/testsuite/g++.dg/parse/non-dependent2.C
+++ b/gcc/testsuite/g++.dg/parse/non-dependent2.C
@@ -31,7 +31,7 @@  int main()
   Bar<int> bar;
 
   bar.baz ();
-  bar.foo (); // { dg-message "instantiated" "" }
+  bar.foo (); // { dg-message "required" "" }
   
   return 0;
 }
diff --git a/gcc/testsuite/g++.dg/parse/template18.C b/gcc/testsuite/g++.dg/parse/template18.C
index 98209b2..4c2d2e7 100644
--- a/gcc/testsuite/g++.dg/parse/template18.C
+++ b/gcc/testsuite/g++.dg/parse/template18.C
@@ -49,4 +49,4 @@  template<int I> void f2()
   A::template B<I>::template b2<double>(0);
 }
 
-template void f2<0>(); // { dg-message "instantiated" }
+template void f2<0>(); // { dg-message "required" }
diff --git a/gcc/testsuite/g++.dg/tc1/dr152.C b/gcc/testsuite/g++.dg/tc1/dr152.C
index f930d2e..bf742ee9 100644
--- a/gcc/testsuite/g++.dg/tc1/dr152.C
+++ b/gcc/testsuite/g++.dg/tc1/dr152.C
@@ -34,5 +34,5 @@  namespace N2 {
     // { dg-message "candidate" "candidate note" { target *-*-* } 33 }
   }
 
-  template int foo<float>();  // { dg-message "instantiated from here" }
+  template int foo<float>();  // { dg-message "required from here" }
 }
diff --git a/gcc/testsuite/g++.dg/tc1/dr166.C b/gcc/testsuite/g++.dg/tc1/dr166.C
index 8c14290..7ca275e 100644
--- a/gcc/testsuite/g++.dg/tc1/dr166.C
+++ b/gcc/testsuite/g++.dg/tc1/dr166.C
@@ -32,7 +32,7 @@  namespace N {
     template <> void f<double>(double )
     { 
       M::B::x = 0; 
-      M::f<long>(0);   // { dg-message "instantiated" }
+      M::f<long>(0);   // { dg-message "required" }
     }
 
     void g(void)
@@ -47,7 +47,7 @@  namespace N {
 
   template <> void f<int>(int )
   { 
-    N::f<long>(0);        // { dg-message "instantiated" }
+    N::f<long>(0);        // { dg-message "required" }
     M::A::x = 0; 
     M::B::x = 0;       // { dg-error "within this context" }
   }
diff --git a/gcc/testsuite/g++.dg/tc1/dr176.C b/gcc/testsuite/g++.dg/tc1/dr176.C
index 2879ac4..7f4d830 100644
--- a/gcc/testsuite/g++.dg/tc1/dr176.C
+++ b/gcc/testsuite/g++.dg/tc1/dr176.C
@@ -15,7 +15,7 @@  namespace N1 {
     typename Derived::Base* p3;   // { dg-bogus "" "injected class name in derived classes" }
   };
 
-  template struct Derived<void>;  // { dg-bogus "instantiated from here" "everything should be looked up at parsing time (after DR224)" }
+  template struct Derived<void>;  // { dg-bogus "required from here" "everything should be looked up at parsing time (after DR224)" }
 }
 
 
diff --git a/gcc/testsuite/g++.dg/tc1/dr213.C b/gcc/testsuite/g++.dg/tc1/dr213.C
index b616ff9..1543851 100644
--- a/gcc/testsuite/g++.dg/tc1/dr213.C
+++ b/gcc/testsuite/g++.dg/tc1/dr213.C
@@ -23,5 +23,5 @@  int main()
 {
   A<B> ab;
   B b;
-  ab.h(b);   // { dg-message "instantiated" }
+  ab.h(b);   // { dg-message "required" }
 }
diff --git a/gcc/testsuite/g++.dg/template/access11.C b/gcc/testsuite/g++.dg/template/access11.C
index c9364a8..73e2caa 100644
--- a/gcc/testsuite/g++.dg/template/access11.C
+++ b/gcc/testsuite/g++.dg/template/access11.C
@@ -21,4 +21,4 @@  template <typename T> struct X::Y {
   typename T::X x;		// { dg-error "this context" }
 };
 
-template struct X::Y<A>;	// { dg-message "instantiated from here" }
+template struct X::Y<A>;	// { dg-message "required from here" }
diff --git a/gcc/testsuite/g++.dg/template/access2.C b/gcc/testsuite/g++.dg/template/access2.C
index c5e3f11..0b4657d 100644
--- a/gcc/testsuite/g++.dg/template/access2.C
+++ b/gcc/testsuite/g++.dg/template/access2.C
@@ -15,6 +15,6 @@  class B {
 
 int main()
 {
-  A<B> ab;				// { dg-message "instantiated" }
-  ab.f();				// { dg-message "instantiated" }
+  A<B> ab;				// { dg-message "required" }
+  ab.f();				// { dg-message "required" }
 }
diff --git a/gcc/testsuite/g++.dg/template/access3.C b/gcc/testsuite/g++.dg/template/access3.C
index c7a155e..ab56620 100644
--- a/gcc/testsuite/g++.dg/template/access3.C
+++ b/gcc/testsuite/g++.dg/template/access3.C
@@ -13,5 +13,5 @@  class B {
 
 int main()
 {
-  A<B> ab;				// { dg-message "instantiated" }
+  A<B> ab;				// { dg-message "required" }
 }
diff --git a/gcc/testsuite/g++.dg/template/access7.C b/gcc/testsuite/g++.dg/template/access7.C
index 412ad00..bd38e4e 100644
--- a/gcc/testsuite/g++.dg/template/access7.C
+++ b/gcc/testsuite/g++.dg/template/access7.C
@@ -14,5 +14,5 @@  typename A::T* f (A) {			// { dg-error "this context" }
 }
 
 void g () {
-  f (S<int> ());			// { dg-message "instantiated" }
+  f (S<int> ());			// { dg-message "required" }
 }
diff --git a/gcc/testsuite/g++.dg/template/arg7.C b/gcc/testsuite/g++.dg/template/arg7.C
index a9333b2..dfd26bd 100644
--- a/gcc/testsuite/g++.dg/template/arg7.C
+++ b/gcc/testsuite/g++.dg/template/arg7.C
@@ -8,4 +8,4 @@  template<typename T> struct A
   B<C> b;
 };
 
-A<void> a;			// { dg-message "instantiated" }
+A<void> a;			// { dg-message "required" }
diff --git a/gcc/testsuite/g++.dg/template/cond2.C b/gcc/testsuite/g++.dg/template/cond2.C
index cf8df8c..fad86be 100644
--- a/gcc/testsuite/g++.dg/template/cond2.C
+++ b/gcc/testsuite/g++.dg/template/cond2.C
@@ -6,5 +6,5 @@  template<int X> class c;
 template<int X, int Y> int test(c<X ? : Y>&); // { dg-error "omitted" }
 
 void test(c<2>*c2) {
-	test<0, 2>(*c2); // { dg-message "instantiated" }	
+	test<0, 2>(*c2); // { dg-message "required" }
 }
diff --git a/gcc/testsuite/g++.dg/template/crash13.C b/gcc/testsuite/g++.dg/template/crash13.C
index 0518666..917ddf0 100644
--- a/gcc/testsuite/g++.dg/template/crash13.C
+++ b/gcc/testsuite/g++.dg/template/crash13.C
@@ -15,4 +15,4 @@  template <typename T> struct C
     X::Y;			// { dg-error "not a base type" }
 };
 
-C<void> c;			// { dg-message "instantiated" }
+C<void> c;			// { dg-message "required" }
diff --git a/gcc/testsuite/g++.dg/template/crash40.C b/gcc/testsuite/g++.dg/template/crash40.C
index 45123dd..d720fe8 100644
--- a/gcc/testsuite/g++.dg/template/crash40.C
+++ b/gcc/testsuite/g++.dg/template/crash40.C
@@ -7,4 +7,4 @@  template<typename T> void foo()
   T::~T(); // { dg-error "member" }
 }
 
-template void foo<A>(); // { dg-message "instantiated" }
+template void foo<A>(); // { dg-message "required" }
diff --git a/gcc/testsuite/g++.dg/template/crash7.C b/gcc/testsuite/g++.dg/template/crash7.C
index 7fda9a9..88d3af8 100644
--- a/gcc/testsuite/g++.dg/template/crash7.C
+++ b/gcc/testsuite/g++.dg/template/crash7.C
@@ -10,5 +10,5 @@  template <typename> struct A	// { dg-message "A.void.::A.const A" }
     template <typename> A(typename A::X) {} // { dg-error "no type" }
 };
 
-A<void> a;	// { dg-error "instantiated|no match" }
+A<void> a;	// { dg-error "required|no match" }
 // { dg-prune-output "note" }
diff --git a/gcc/testsuite/g++.dg/template/crash84.C b/gcc/testsuite/g++.dg/template/crash84.C
index f622aaa..c42f85c 100644
--- a/gcc/testsuite/g++.dg/template/crash84.C
+++ b/gcc/testsuite/g++.dg/template/crash84.C
@@ -13,7 +13,7 @@  template<typename T> struct a
 void
 foo ()
 {
-    a<int> v; // { dg-message "instantiated from here" }
+    a<int> v; // { dg-message "required from here" }
 }
 
 
diff --git a/gcc/testsuite/g++.dg/template/ctor5.C b/gcc/testsuite/g++.dg/template/ctor5.C
index 6938b36..047543c 100644
--- a/gcc/testsuite/g++.dg/template/ctor5.C
+++ b/gcc/testsuite/g++.dg/template/ctor5.C
@@ -5,4 +5,4 @@  template<typename T> struct A
   A() : T(0) {} // { dg-error "base" }
 };
 
-A<int*> a; // { dg-message "instantiated" }
+A<int*> a; // { dg-message "required" }
diff --git a/gcc/testsuite/g++.dg/template/defarg13.C b/gcc/testsuite/g++.dg/template/defarg13.C
index ba2980b..1d51534 100644
--- a/gcc/testsuite/g++.dg/template/defarg13.C
+++ b/gcc/testsuite/g++.dg/template/defarg13.C
@@ -16,4 +16,4 @@  struct C
   typename T::F f;		// { dg-error "no type" }
 };
 
-C<B, B> c;			// { dg-message "instantiated" }
+C<B, B> c;			// { dg-message "required" }
diff --git a/gcc/testsuite/g++.dg/template/defarg14.C b/gcc/testsuite/g++.dg/template/defarg14.C
index 1fe87e3..352ccc4 100644
--- a/gcc/testsuite/g++.dg/template/defarg14.C
+++ b/gcc/testsuite/g++.dg/template/defarg14.C
@@ -1,5 +1,5 @@ 
 // PR c++/46129
-// The default argument for A<int>::B::operator() should not be instantiated
+// The default argument for A<int>::B::operator() should not be required
 
 template <class T>
 struct A {
diff --git a/gcc/testsuite/g++.dg/template/dtor7.C b/gcc/testsuite/g++.dg/template/dtor7.C
index 186b561..a963320 100644
--- a/gcc/testsuite/g++.dg/template/dtor7.C
+++ b/gcc/testsuite/g++.dg/template/dtor7.C
@@ -18,5 +18,5 @@  foo (T t)
 void
 bar ()
 {
-  foo (B ());	// { dg-bogus "instantiated from here" "" { xfail *-*-* } }
+  foo (B ());	// { dg-bogus "required from here" "" { xfail *-*-* } }
 }
diff --git a/gcc/testsuite/g++.dg/template/eh2.C b/gcc/testsuite/g++.dg/template/eh2.C
index d2c049c..9559b4e 100644
--- a/gcc/testsuite/g++.dg/template/eh2.C
+++ b/gcc/testsuite/g++.dg/template/eh2.C
@@ -7,4 +7,4 @@  template<typename T> struct A
     void foo() throw(typename T::X);  // { dg-error "not a class" }
 };
 
-A<void> a;                            // { dg-message "instantiated" }
+A<void> a;                            // { dg-message "required" }
diff --git a/gcc/testsuite/g++.dg/template/error2.C b/gcc/testsuite/g++.dg/template/error2.C
index 5bd9b87..96f0bca 100644
--- a/gcc/testsuite/g++.dg/template/error2.C
+++ b/gcc/testsuite/g++.dg/template/error2.C
@@ -3,7 +3,7 @@ 
 // Copyright (C) 2003 Free Software Foundation, Inc.
 // Contributed by Nathan Sidwell 14 Aug 2003 <nathan@codesourcery.com>
 
-// instantiated from did not indicate the nested class
+// required from did not indicate the nested class
 
 template<class T> struct X
 {
@@ -15,16 +15,16 @@  template<class T> struct X
 template<class T >
 struct Derived
 {
-  class Nested : public X<T> // { dg-message "instantiated" "" }
+  class Nested : public X<T> // { dg-message "required" "" }
   {
   };
   
-  Nested m; // { dg-message "instantiated" "" }
+  Nested m; // { dg-message "required" "" }
   
   void Foo ();
 };
 
 void Foo (Derived<void> &x)
 {
-  x.Foo (); // { dg-message "instantiated" "" }
+  x.Foo (); // { dg-message "required" "" }
 }
diff --git a/gcc/testsuite/g++.dg/template/error43.C b/gcc/testsuite/g++.dg/template/error43.C
index 876e018..03f29d1 100644
--- a/gcc/testsuite/g++.dg/template/error43.C
+++ b/gcc/testsuite/g++.dg/template/error43.C
@@ -6,4 +6,4 @@  template<int> void foo()
   struct A {} a;
 }
 
-template void foo<0>();		// { dg-message "instantiated" }
+template void foo<0>();		// { dg-message "required" }
diff --git a/gcc/testsuite/g++.dg/template/friend32.C b/gcc/testsuite/g++.dg/template/friend32.C
index 81e6390..d5b78e0 100644
--- a/gcc/testsuite/g++.dg/template/friend32.C
+++ b/gcc/testsuite/g++.dg/template/friend32.C
@@ -17,5 +17,5 @@  template<class T> class B
 
 int f ()
 {
-  B<int> b;			// { dg-message "instantiated" }
+  B<int> b;			// { dg-message "required" }
 }
diff --git a/gcc/testsuite/g++.dg/template/injected1.C b/gcc/testsuite/g++.dg/template/injected1.C
index 81873b4..58b8656 100644
--- a/gcc/testsuite/g++.dg/template/injected1.C
+++ b/gcc/testsuite/g++.dg/template/injected1.C
@@ -30,4 +30,4 @@  struct D4: Base<T>, Base<T*> {
   typename D4::Base* p1;	// { dg-error "" }
   typename D4::template Base<double>* p2;
 };
-template struct D4<void>;	// { dg-message "instantiated" }
+template struct D4<void>;	// { dg-message "required" }
diff --git a/gcc/testsuite/g++.dg/template/instantiate1.C b/gcc/testsuite/g++.dg/template/instantiate1.C
index 828f2e9..dd50168 100644
--- a/gcc/testsuite/g++.dg/template/instantiate1.C
+++ b/gcc/testsuite/g++.dg/template/instantiate1.C
@@ -9,11 +9,11 @@  template <class T> struct X {
 };
 
 template <class T> struct Y {
-  X<T> x;			// { dg-message "instantiated" }
+  X<T> x;			// { dg-message "required" }
 };
 
 template <class T> struct Z {	// { dg-error "declaration" }
-  Y<Z<T> > y;			// { dg-message "instantiated" }
+  Y<Z<T> > y;			// { dg-message "required" }
 };
 
 struct ZZ : Z<int>
diff --git a/gcc/testsuite/g++.dg/template/instantiate3.C b/gcc/testsuite/g++.dg/template/instantiate3.C
index de3d3a0..0e9fd70 100644
--- a/gcc/testsuite/g++.dg/template/instantiate3.C
+++ b/gcc/testsuite/g++.dg/template/instantiate3.C
@@ -14,4 +14,4 @@  struct ACE_Cleanup_Adapter
   TYPE object_;		// { dg-error "incomplete type" }
 };
 
-template class ACE_Cleanup_Adapter<ACE_Null_Mutex>; // { dg-message "instantiated from here" }
+template class ACE_Cleanup_Adapter<ACE_Null_Mutex>; // { dg-message "required from here" }
diff --git a/gcc/testsuite/g++.dg/template/instantiate5.C b/gcc/testsuite/g++.dg/template/instantiate5.C
index e592c65..2198087 100644
--- a/gcc/testsuite/g++.dg/template/instantiate5.C
+++ b/gcc/testsuite/g++.dg/template/instantiate5.C
@@ -22,4 +22,4 @@  template <typename T> struct C
   // { dg-message "candidate" "candidate note" { target *-*-* } 21 }
 };
 
-C<B> c;				// { dg-message "instantiated" }
+C<B> c;				// { dg-message "required" }
diff --git a/gcc/testsuite/g++.dg/template/instantiate7.C b/gcc/testsuite/g++.dg/template/instantiate7.C
index 2e54106..8ddbdb1 100644
--- a/gcc/testsuite/g++.dg/template/instantiate7.C
+++ b/gcc/testsuite/g++.dg/template/instantiate7.C
@@ -7,4 +7,4 @@  template<typename T> struct A
     template<T&> struct B;  // { dg-error "reference to void" }
 };
 
-A<void> a;                  // { dg-message "instantiated" }
+A<void> a;                  // { dg-message "required" }
diff --git a/gcc/testsuite/g++.dg/template/local6.C b/gcc/testsuite/g++.dg/template/local6.C
index 4a87177..777349a 100644
--- a/gcc/testsuite/g++.dg/template/local6.C
+++ b/gcc/testsuite/g++.dg/template/local6.C
@@ -16,5 +16,5 @@  void findIntersection( PCVector2<double>& p0, PCVector2<double>& p1);
 
 void findIntersection( PCVector2<double>& p0, PCVector2<double>& p1)
 {
-    PCVector2<double> e = p1 - p0;	// { dg-message "instantiated" }
+    PCVector2<double> e = p1 - p0;	// { dg-message "required" }
 }
diff --git a/gcc/testsuite/g++.dg/template/lookup2.C b/gcc/testsuite/g++.dg/template/lookup2.C
index 15ab352..de4e1d9 100644
--- a/gcc/testsuite/g++.dg/template/lookup2.C
+++ b/gcc/testsuite/g++.dg/template/lookup2.C
@@ -14,5 +14,5 @@  template <typename T> void Bar ()
 
 void Foo ()
 {
-  Bar<B> (); // { dg-message "instantiated" "" }
+  Bar<B> (); // { dg-message "required" "" }
 }
diff --git a/gcc/testsuite/g++.dg/template/member5.C b/gcc/testsuite/g++.dg/template/member5.C
index ba6a970..0cdd52a 100644
--- a/gcc/testsuite/g++.dg/template/member5.C
+++ b/gcc/testsuite/g++.dg/template/member5.C
@@ -28,6 +28,6 @@  struct S {
 template< typename _A > void S::foo() {} 
 
 template void S::foo< 0 >();    // { dg-error "no definition available" "no def" }
-				// { dg-message "instantiated" "instantiated" { target *-*-* } 30 }
+				// { dg-message "required" "instantiated" { target *-*-* } 30 }
 
 }
diff --git a/gcc/testsuite/g++.dg/template/memfriend15.C b/gcc/testsuite/g++.dg/template/memfriend15.C
index c12ec4b..a620c3b 100644
--- a/gcc/testsuite/g++.dg/template/memfriend15.C
+++ b/gcc/testsuite/g++.dg/template/memfriend15.C
@@ -30,5 +30,5 @@  template<class T> void A<T>::B2::f()
 int main()
 {
   A<int>::B2 b1;
-  b1.f();	// { dg-message "instantiated" }
+  b1.f();	// { dg-message "required" }
 }
diff --git a/gcc/testsuite/g++.dg/template/memfriend16.C b/gcc/testsuite/g++.dg/template/memfriend16.C
index 2827ef3..1276970 100644
--- a/gcc/testsuite/g++.dg/template/memfriend16.C
+++ b/gcc/testsuite/g++.dg/template/memfriend16.C
@@ -30,5 +30,5 @@  template<class T> template <class U> void A<T>::B2<U>::f()
 int main()
 {
   A<int>::B2<int> b1;
-  b1.f();	// { dg-message "instantiated" }
+  b1.f();	// { dg-message "required" }
 }
diff --git a/gcc/testsuite/g++.dg/template/memfriend17.C b/gcc/testsuite/g++.dg/template/memfriend17.C
index 5e163fa..5f4b8e7 100644
--- a/gcc/testsuite/g++.dg/template/memfriend17.C
+++ b/gcc/testsuite/g++.dg/template/memfriend17.C
@@ -43,4 +43,4 @@  void A<T>::B::func2(void)
     (void)F2<T*>::foo;
 }
 
-template class A<int>;	// { dg-message "instantiated" }
+template class A<int>;	// { dg-message "required" }
diff --git a/gcc/testsuite/g++.dg/template/memfriend7.C b/gcc/testsuite/g++.dg/template/memfriend7.C
index 1583646..26ca6d8 100644
--- a/gcc/testsuite/g++.dg/template/memfriend7.C
+++ b/gcc/testsuite/g++.dg/template/memfriend7.C
@@ -116,18 +116,18 @@  template <> void A<char>::j<0>()
 int main()
 {
   A<int *> a1;
-  a1.f(0);				// { dg-message "instantiated" }
-  a1.g<char>();				// { dg-message "instantiated" }
-  a1.g<int>();				// { dg-message "instantiated" }
-  a1.h();				// { dg-message "instantiated" }
-  a1.i('a');				// { dg-message "instantiated" }
-  a1.j<1>();				// { dg-message "instantiated" }
+  a1.f(0);				// { dg-message "required" }
+  a1.g<char>();				// { dg-message "required" }
+  a1.g<int>();				// { dg-message "required" }
+  a1.h();				// { dg-message "required" }
+  a1.i('a');				// { dg-message "required" }
+  a1.j<1>();				// { dg-message "required" }
   A<char> a2;
   a2.f(0);
-  a2.g<char>();				// { dg-message "instantiated" }
+  a2.g<char>();				// { dg-message "required" }
   a2.g<int>();
   a2.h();
   a2.i('a');
-  a2.j<1>();				// { dg-message "instantiated" }
+  a2.j<1>();				// { dg-message "required" }
   a2.j<0>();
 }
diff --git a/gcc/testsuite/g++.dg/template/meminit1.C b/gcc/testsuite/g++.dg/template/meminit1.C
index 6fd024a..b1c4d42 100644
--- a/gcc/testsuite/g++.dg/template/meminit1.C
+++ b/gcc/testsuite/g++.dg/template/meminit1.C
@@ -5,4 +5,4 @@  struct S
   S() : S() {} // { dg-error "base" }
 };
 
-S<int> s; // { dg-message "instantiated" }
+S<int> s; // { dg-message "required" }
diff --git a/gcc/testsuite/g++.dg/template/nested3.C b/gcc/testsuite/g++.dg/template/nested3.C
index 5652e17..4544cc9 100644
--- a/gcc/testsuite/g++.dg/template/nested3.C
+++ b/gcc/testsuite/g++.dg/template/nested3.C
@@ -24,7 +24,7 @@  class B {
 
 
 int main() {
-  B<char> objB; // { dg-message "instantiated" }
+  B<char> objB; // { dg-message "required" }
 
   return 0;
 }
diff --git a/gcc/testsuite/g++.dg/template/non-type-template-argument-1.C b/gcc/testsuite/g++.dg/template/non-type-template-argument-1.C
index 4124364..99b00cc 100644
--- a/gcc/testsuite/g++.dg/template/non-type-template-argument-1.C
+++ b/gcc/testsuite/g++.dg/template/non-type-template-argument-1.C
@@ -9,4 +9,4 @@  template <typename T> struct D
    C<T::X> c;                   // { dg-error "parsed as a non-type|if a type is meant" }
 };
 
-D<B> d;                         // { dg-message "instantiated from here" }
+D<B> d;                         // { dg-message "required from here" }
diff --git a/gcc/testsuite/g++.dg/template/nontype12.C b/gcc/testsuite/g++.dg/template/nontype12.C
index a290ec3..b4bb41d 100644
--- a/gcc/testsuite/g++.dg/template/nontype12.C
+++ b/gcc/testsuite/g++.dg/template/nontype12.C
@@ -9,7 +9,7 @@  template<typename T> struct A
 };
 
 A<char>   a1;
-A<double> a2;                                   // { dg-message "instantiated" }
+A<double> a2;                                   // { dg-message "required" }
 
 template<typename T> struct B
 {
@@ -27,9 +27,9 @@  template<typename T> struct C
   template<T> int foo();                        // { dg-error "double" }
 };
 
-template<typename T> int baz(T) { C<T> c; }     // { dg-message "instantiated" }
+template<typename T> int baz(T) { C<T> c; }     // { dg-message "required" }
 
 void foobar()
 {
-  baz(1.2);                                     // { dg-message "instantiated" }
+  baz(1.2);                                     // { dg-message "required" }
 }
diff --git a/gcc/testsuite/g++.dg/template/nontype13.C b/gcc/testsuite/g++.dg/template/nontype13.C
index 6fffb8d8..4b3e862 100644
--- a/gcc/testsuite/g++.dg/template/nontype13.C
+++ b/gcc/testsuite/g++.dg/template/nontype13.C
@@ -24,6 +24,6 @@  struct Dummy
 int main()
 {
   Dummy<int> d;
-  d.tester<true> (); // { dg-message "instantiated" }
+  d.tester<true> (); // { dg-message "required" }
 }
 
diff --git a/gcc/testsuite/g++.dg/template/nontype6.C b/gcc/testsuite/g++.dg/template/nontype6.C
index 97b093a..b51474f 100644
--- a/gcc/testsuite/g++.dg/template/nontype6.C
+++ b/gcc/testsuite/g++.dg/template/nontype6.C
@@ -16,4 +16,4 @@  void func(void)
 // { dg-message "if a type" "note" { target *-*-* } 15 }
 }
 
-template void func<float>(void);    // { dg-message "instantiated from here" }
+template void func<float>(void);    // { dg-message "required from here" }
diff --git a/gcc/testsuite/g++.dg/template/pr23510.C b/gcc/testsuite/g++.dg/template/pr23510.C
index 1c3180f..86310d3 100644
--- a/gcc/testsuite/g++.dg/template/pr23510.C
+++ b/gcc/testsuite/g++.dg/template/pr23510.C
@@ -4,7 +4,7 @@  template<unsigned int nFactor>
 struct Factorial
 {
   enum { nValue = nFactor * Factorial<nFactor - 1>::nValue }; // { dg-error "depth exceeds maximum" } 
-  // { dg-message "recursively instantiated" "" { target *-*-* } 6 } 
+  // { dg-message "recursively required" "" { target *-*-* } 6 }
   // { dg-error "incomplete type" "" { target *-*-* } 6 } 
 } // { dg-error "expected ';' after" }
 
diff --git a/gcc/testsuite/g++.dg/template/pr35240.C b/gcc/testsuite/g++.dg/template/pr35240.C
index 47455b6..88e2505 100644
--- a/gcc/testsuite/g++.dg/template/pr35240.C
+++ b/gcc/testsuite/g++.dg/template/pr35240.C
@@ -8,5 +8,5 @@  template<int N> A<sizeof(new int[N][N])> foo(); // { dg-message "unimplemented"
 
 void bar()
 {
-  foo<1>(); // { dg-message "instantiated" }
+  foo<1>(); // { dg-message "required" }
 }
diff --git a/gcc/testsuite/g++.dg/template/ptrmem15.C b/gcc/testsuite/g++.dg/template/ptrmem15.C
index b52ff89..3055641 100644
--- a/gcc/testsuite/g++.dg/template/ptrmem15.C
+++ b/gcc/testsuite/g++.dg/template/ptrmem15.C
@@ -6,4 +6,4 @@  template<typename T> struct A
     T A::* p;  // { dg-error "void" }
 };
 
-A<void> a;     // { dg-message "instantiated" }
+A<void> a;     // { dg-message "required" }
diff --git a/gcc/testsuite/g++.dg/template/ptrmem6.C b/gcc/testsuite/g++.dg/template/ptrmem6.C
index a355cfe..21475c6 100644
--- a/gcc/testsuite/g++.dg/template/ptrmem6.C
+++ b/gcc/testsuite/g++.dg/template/ptrmem6.C
@@ -7,4 +7,4 @@  void f (int T::* volatile *p) {
   g(p); // { dg-error "conversion" }
 }
 
-template void f(int S::* volatile *); // { dg-message "instantiated" }
+template void f(int S::* volatile *); // { dg-message "required" }
diff --git a/gcc/testsuite/g++.dg/template/qualified-id1.C b/gcc/testsuite/g++.dg/template/qualified-id1.C
index 602be5b..c46a6a4 100644
--- a/gcc/testsuite/g++.dg/template/qualified-id1.C
+++ b/gcc/testsuite/g++.dg/template/qualified-id1.C
@@ -23,5 +23,5 @@  template <typename T> void foo()
 
 void bar()
 {
-  foo<A>(); // { dg-message "instantiated" }
+  foo<A>(); // { dg-message "required" }
 }
diff --git a/gcc/testsuite/g++.dg/template/qualttp20.C b/gcc/testsuite/g++.dg/template/qualttp20.C
index f42981b..8073fe3 100644
--- a/gcc/testsuite/g++.dg/template/qualttp20.C
+++ b/gcc/testsuite/g++.dg/template/qualttp20.C
@@ -32,5 +32,5 @@  template <typename T> struct B2 : T
   myconst b;
 };
 
-B1<AS> b1;	// { dg-message "instantiated" "" }
+B1<AS> b1;	// { dg-message "required" "" }
 B2<AS> b2;
diff --git a/gcc/testsuite/g++.dg/template/qualttp3.C b/gcc/testsuite/g++.dg/template/qualttp3.C
index 4b9ffe3..61141b3 100644
--- a/gcc/testsuite/g++.dg/template/qualttp3.C
+++ b/gcc/testsuite/g++.dg/template/qualttp3.C
@@ -19,5 +19,5 @@  template <class T> struct C
 
 int main()
 {
-	C<A> c; // { dg-message "instantiated" }
+	C<A> c; // { dg-message "required" }
 }
diff --git a/gcc/testsuite/g++.dg/template/qualttp4.C b/gcc/testsuite/g++.dg/template/qualttp4.C
index c55ce2d..0f45c8c 100644
--- a/gcc/testsuite/g++.dg/template/qualttp4.C
+++ b/gcc/testsuite/g++.dg/template/qualttp4.C
@@ -20,5 +20,5 @@  template <class T> struct C
 
 int main()
 {
-	C<A> c; // { dg-message "instantiated" }
+	C<A> c; // { dg-message "required" }
 }
diff --git a/gcc/testsuite/g++.dg/template/qualttp5.C b/gcc/testsuite/g++.dg/template/qualttp5.C
index 8bca7f6..8ac1952 100644
--- a/gcc/testsuite/g++.dg/template/qualttp5.C
+++ b/gcc/testsuite/g++.dg/template/qualttp5.C
@@ -16,11 +16,11 @@  template <template <class> class TT> void f()
 
 template <class T> struct C
 {
-	void g() { f<A<T>::template B>(); } // { dg-message "instantiated" }
+	void g() { f<A<T>::template B>(); } // { dg-message "required" }
 };
 
 int main()
 {
 	C<int> c;
-	c.g(); // { dg-message "instantiated" }
+	c.g(); // { dg-message "required" }
 }
diff --git a/gcc/testsuite/g++.dg/template/qualttp6.C b/gcc/testsuite/g++.dg/template/qualttp6.C
index aa1a467..7bd3c24 100644
--- a/gcc/testsuite/g++.dg/template/qualttp6.C
+++ b/gcc/testsuite/g++.dg/template/qualttp6.C
@@ -12,4 +12,4 @@  template <class T> struct D {
 struct E {
 };
 
-D<E> d; // { dg-message "instantiated" }
+D<E> d; // { dg-message "required" }
diff --git a/gcc/testsuite/g++.dg/template/qualttp7.C b/gcc/testsuite/g++.dg/template/qualttp7.C
index f37123e..e922f1d 100644
--- a/gcc/testsuite/g++.dg/template/qualttp7.C
+++ b/gcc/testsuite/g++.dg/template/qualttp7.C
@@ -9,4 +9,4 @@  template <class T> struct D {
 	C<T::template B> c; // { dg-error "no class template" }
 };
 
-D<int> d; // { dg-message "instantiated" }
+D<int> d; // { dg-message "required" }
diff --git a/gcc/testsuite/g++.dg/template/qualttp8.C b/gcc/testsuite/g++.dg/template/qualttp8.C
index 5f55e60..c1396db 100644
--- a/gcc/testsuite/g++.dg/template/qualttp8.C
+++ b/gcc/testsuite/g++.dg/template/qualttp8.C
@@ -14,4 +14,4 @@  struct E {
 	template <class T> class B {}; // { dg-error "private" }
 };
 
-D<E> d; // { dg-message "instantiated" }
+D<E> d; // { dg-message "required" }
diff --git a/gcc/testsuite/g++.dg/template/recurse.C b/gcc/testsuite/g++.dg/template/recurse.C
index 448c347..94b56f6 100644
--- a/gcc/testsuite/g++.dg/template/recurse.C
+++ b/gcc/testsuite/g++.dg/template/recurse.C
@@ -8,7 +8,7 @@  template <int I> struct F
       F<I+1> f;			// { dg-error "incomplete type" "incomplete" }
 				// { dg-bogus "exceeds maximum.*exceeds maximum" "exceeds" { xfail *-*-* } 8 }
                                 // { dg-error "exceeds maximum" "exceeds" { xfail *-*-* } 8 }
-      return f()*I;             // { dg-message "recursively instantiated" "recurse" }
+      return f()*I;             // { dg-message "recursively" "recurse" }
     }
 };
 
@@ -20,8 +20,8 @@  template <> struct F<52>
 int main ()
 {
   F<1> f;
-  return f();		// { dg-message "instantiated from here" "excessive recursion" }
+  return f();		// { dg-message "from here" "excessive recursion" }
 }
 
 // Ignore excess messages from recursion.
-// { dg-prune-output "instantiated from 'int" }
+// { dg-prune-output "from 'int" }
diff --git a/gcc/testsuite/g++.dg/template/recurse2.C b/gcc/testsuite/g++.dg/template/recurse2.C
index b9767df..eae411b 100644
--- a/gcc/testsuite/g++.dg/template/recurse2.C
+++ b/gcc/testsuite/g++.dg/template/recurse2.C
@@ -3,6 +3,6 @@ 
 
 template <int N> struct X {
     static const int value = X<N-1>::value; // { dg-error "instantiation|incomplete" }
-  // { dg-message "recursively instantiated" "" { target *-*-* } 5 }
+  // { dg-message "recursively required" "" { target *-*-* } 5 }
 };
 template struct X<1000>;
diff --git a/gcc/testsuite/g++.dg/template/ref5.C b/gcc/testsuite/g++.dg/template/ref5.C
index efefbef..69c2d69 100644
--- a/gcc/testsuite/g++.dg/template/ref5.C
+++ b/gcc/testsuite/g++.dg/template/ref5.C
@@ -8,4 +8,4 @@  template<typename T> struct B
   A<t> a;			// { dg-error "reference variable" }
 };
 
-B<int&> b;			// { dg-message "instantiated" }
+B<int&> b;			// { dg-message "required" }
diff --git a/gcc/testsuite/g++.dg/template/scope2.C b/gcc/testsuite/g++.dg/template/scope2.C
index 79b520c..ad9bf8e 100644
--- a/gcc/testsuite/g++.dg/template/scope2.C
+++ b/gcc/testsuite/g++.dg/template/scope2.C
@@ -3,7 +3,7 @@ 
 // Copyright (C) 2003 Free Software Foundation, Inc.
 // Contributed by Nathan Sidwell 15 Aug 2003 <nathan@codesourcery.com>
 
-// checked instantiated bases in wrong scope.
+// checked required bases in wrong scope.
 
 class Helper {};
 
diff --git a/gcc/testsuite/g++.dg/template/sfinae10.C b/gcc/testsuite/g++.dg/template/sfinae10.C
index f44c445..c6cb12f 100644
--- a/gcc/testsuite/g++.dg/template/sfinae10.C
+++ b/gcc/testsuite/g++.dg/template/sfinae10.C
@@ -169,13 +169,13 @@  STATIC_ASSERT((has_postdecrement<X>::value));
 STATIC_ASSERT((!has_postdecrement<Y>::value));
 
 // Check for private members
-STATIC_ASSERT((has_unary_plus<Z>::value)); // { dg-message "instantiated from here" }
-STATIC_ASSERT((is_negatable<Z>::value)); // { dg-message "instantiated from here" }
-STATIC_ASSERT((is_dereferenceable<Z>::value)); // { dg-message "instantiated from here" }
-STATIC_ASSERT((has_bitwise_not<Z>::value)); // { dg-message "instantiated from here" }
-STATIC_ASSERT((has_truth_not<Z>::value)); // { dg-message "instantiated from here" }
-STATIC_ASSERT((has_preincrement<Z>::value)); // { dg-message "instantiated from here" }
-STATIC_ASSERT((has_predecrement<Z>::value)); // { dg-message "instantiated from here" }
-STATIC_ASSERT((has_postincrement<Z>::value)); // { dg-message "instantiated from here" }
-STATIC_ASSERT((has_postdecrement<Z>::value)); // { dg-message "instantiated from here" }
+STATIC_ASSERT((has_unary_plus<Z>::value)); // { dg-message "required from here" }
+STATIC_ASSERT((is_negatable<Z>::value)); // { dg-message "required from here" }
+STATIC_ASSERT((is_dereferenceable<Z>::value)); // { dg-message "required from here" }
+STATIC_ASSERT((has_bitwise_not<Z>::value)); // { dg-message "required from here" }
+STATIC_ASSERT((has_truth_not<Z>::value)); // { dg-message "required from here" }
+STATIC_ASSERT((has_preincrement<Z>::value)); // { dg-message "required from here" }
+STATIC_ASSERT((has_predecrement<Z>::value)); // { dg-message "required from here" }
+STATIC_ASSERT((has_postincrement<Z>::value)); // { dg-message "required from here" }
+STATIC_ASSERT((has_postdecrement<Z>::value)); // { dg-message "required from here" }
 
diff --git a/gcc/testsuite/g++.dg/template/sfinae3.C b/gcc/testsuite/g++.dg/template/sfinae3.C
index 349463d..b08d201 100644
--- a/gcc/testsuite/g++.dg/template/sfinae3.C
+++ b/gcc/testsuite/g++.dg/template/sfinae3.C
@@ -14,4 +14,4 @@  template<typename> struct B
   template<typename T> B(T, Y);
 };
 
-B<int> b(0,0); // { dg-message "instantiated from here" }
+B<int> b(0,0); // { dg-message "required from here" }
diff --git a/gcc/testsuite/g++.dg/template/sizeof3.C b/gcc/testsuite/g++.dg/template/sizeof3.C
index a98bbc3..7c9d0d2 100644
--- a/gcc/testsuite/g++.dg/template/sizeof3.C
+++ b/gcc/testsuite/g++.dg/template/sizeof3.C
@@ -1,5 +1,5 @@ 
 // The call to f is not potentially evaluated (3.2), so f<int> is not used,
-// so it should not be instantiated.
+// so it should not be required.
 
 template <class T>
 T f (T)
diff --git a/gcc/testsuite/g++.dg/template/static9.C b/gcc/testsuite/g++.dg/template/static9.C
index ab70101..058d4de 100644
--- a/gcc/testsuite/g++.dg/template/static9.C
+++ b/gcc/testsuite/g++.dg/template/static9.C
@@ -5,4 +5,4 @@  template<typename T> struct A
   static const T i = 0; // { dg-error "declared void" "void" }
 };
 
-A<void> a; // { dg-message "instantiated" }
+A<void> a; // { dg-message "required" }
diff --git a/gcc/testsuite/g++.dg/template/template-id-2.C b/gcc/testsuite/g++.dg/template/template-id-2.C
index 6d37350..333e33d 100644
--- a/gcc/testsuite/g++.dg/template/template-id-2.C
+++ b/gcc/testsuite/g++.dg/template/template-id-2.C
@@ -18,5 +18,5 @@  template<> struct A<void>
 void bar()
 {
     A<void> a;
-    a.foo<int>();		// { dg-message "instantiated" }
+    a.foo<int>();		// { dg-message "required" }
 }
diff --git a/gcc/testsuite/g++.dg/template/typedef13.C b/gcc/testsuite/g++.dg/template/typedef13.C
index a22e1cb..5d40e63 100644
--- a/gcc/testsuite/g++.dg/template/typedef13.C
+++ b/gcc/testsuite/g++.dg/template/typedef13.C
@@ -12,5 +12,5 @@  template <class T> class B : public A
   mytype mem; // { dg-error "within this context"  }
 };
 
-B<int> b; // { dg-message "instantiated from here" }
+B<int> b; // { dg-message "required from here" }
 
diff --git a/gcc/testsuite/g++.dg/template/typename4.C b/gcc/testsuite/g++.dg/template/typename4.C
index 18cdd1a..56b5051 100644
--- a/gcc/testsuite/g++.dg/template/typename4.C
+++ b/gcc/testsuite/g++.dg/template/typename4.C
@@ -1,3 +1,3 @@ 
 struct B { template <typename U> struct C; };
 template <typename T> struct A { typedef typename T::C V; }; // { dg-error "not a type" }
-void f () { A<B>::V p; } // { dg-message "instantiated" }
+void f () { A<B>::V p; } // { dg-message "required" }
diff --git a/gcc/testsuite/g++.dg/template/using14.C b/gcc/testsuite/g++.dg/template/using14.C
index ebb4e09..276c40b 100644
--- a/gcc/testsuite/g++.dg/template/using14.C
+++ b/gcc/testsuite/g++.dg/template/using14.C
@@ -17,5 +17,5 @@  template <class T> struct C : public B1<T>, public B2
 int main()
 {
   C<int> c;
-  c.f();			// { dg-message "instantiated" }
+  c.f();			// { dg-message "required" }
 }
diff --git a/gcc/testsuite/g++.dg/template/using2.C b/gcc/testsuite/g++.dg/template/using2.C
index 5d21f57..6dd9ef4 100644
--- a/gcc/testsuite/g++.dg/template/using2.C
+++ b/gcc/testsuite/g++.dg/template/using2.C
@@ -25,6 +25,6 @@  struct Bar : public Foo<T>, Baz {
 
 void foo (Bar<int> &bar)
 {
-  bar.foo(); // { dg-message "instantiated" }
+  bar.foo(); // { dg-message "required" }
 }
 
diff --git a/gcc/testsuite/g++.dg/template/warn1.C b/gcc/testsuite/g++.dg/template/warn1.C
index 2b804f7..5067d76 100644
--- a/gcc/testsuite/g++.dg/template/warn1.C
+++ b/gcc/testsuite/g++.dg/template/warn1.C
@@ -17,7 +17,7 @@  template <class T>  void Foo(T i)
  
 void Bar ()
 { 
-  Foo (1);  // { dg-message "instantiated" }
+  Foo (1);  // { dg-message "required" }
 }
 
 struct M {};
diff --git a/gcc/testsuite/g++.dg/warn/Wparentheses-13.C b/gcc/testsuite/g++.dg/warn/Wparentheses-13.C
index ebe8f42..22a139f 100644
--- a/gcc/testsuite/g++.dg/warn/Wparentheses-13.C
+++ b/gcc/testsuite/g++.dg/warn/Wparentheses-13.C
@@ -66,4 +66,4 @@  bar (T)
   foo (27);
 }
 
-template void bar<int> (int); // { dg-message "instantiated" }
+template void bar<int> (int); // { dg-message "required" }
diff --git a/gcc/testsuite/g++.dg/warn/Wparentheses-15.C b/gcc/testsuite/g++.dg/warn/Wparentheses-15.C
index db73d43..c088b76 100644
--- a/gcc/testsuite/g++.dg/warn/Wparentheses-15.C
+++ b/gcc/testsuite/g++.dg/warn/Wparentheses-15.C
@@ -65,4 +65,4 @@  bar (T a, T b, T c)
   foo (1 != (2 != 3));
 }
 
-template void bar<int> (int, int, int); // { dg-message "instantiated" }
+template void bar<int> (int, int, int); // { dg-message "required" }
diff --git a/gcc/testsuite/g++.dg/warn/Wparentheses-16.C b/gcc/testsuite/g++.dg/warn/Wparentheses-16.C
index 6381552..0f80cb9 100644
--- a/gcc/testsuite/g++.dg/warn/Wparentheses-16.C
+++ b/gcc/testsuite/g++.dg/warn/Wparentheses-16.C
@@ -83,4 +83,4 @@  bar (T a, T b, T c)
   foo (6 >> (5 - 4));
 }
 
-template void bar<int> (int, int, int); // { dg-message "instantiated" }
+template void bar<int> (int, int, int); // { dg-message "required" }
diff --git a/gcc/testsuite/g++.dg/warn/Wparentheses-17.C b/gcc/testsuite/g++.dg/warn/Wparentheses-17.C
index 1af1e2e..b7c28e0 100644
--- a/gcc/testsuite/g++.dg/warn/Wparentheses-17.C
+++ b/gcc/testsuite/g++.dg/warn/Wparentheses-17.C
@@ -29,4 +29,4 @@  bar (T a, T b, T c)
   foo (1 || (2 && 3));
 }
 
-template void bar<int> (int, int, int); // { dg-message "instantiated" }
+template void bar<int> (int, int, int); // { dg-message "required" }
diff --git a/gcc/testsuite/g++.dg/warn/Wparentheses-18.C b/gcc/testsuite/g++.dg/warn/Wparentheses-18.C
index d562315..83efaff 100644
--- a/gcc/testsuite/g++.dg/warn/Wparentheses-18.C
+++ b/gcc/testsuite/g++.dg/warn/Wparentheses-18.C
@@ -119,4 +119,4 @@  bar (T a, T b, T c)
   foo (1 | (2 <= 3));
 }
 
-template void bar<int> (int, int, int); // { dg-message "instantiated" }
+template void bar<int> (int, int, int); // { dg-message "required" }
diff --git a/gcc/testsuite/g++.dg/warn/Wparentheses-19.C b/gcc/testsuite/g++.dg/warn/Wparentheses-19.C
index e3dfc5d..f0e2b80 100644
--- a/gcc/testsuite/g++.dg/warn/Wparentheses-19.C
+++ b/gcc/testsuite/g++.dg/warn/Wparentheses-19.C
@@ -119,4 +119,4 @@  bar (T a, T b, T c)
   foo (1 ^ (2 < 3));
 }
 
-template void bar<int> (int, int, int); // { dg-message "instantiated" }
+template void bar<int> (int, int, int); // { dg-message "required" }
diff --git a/gcc/testsuite/g++.dg/warn/Wparentheses-20.C b/gcc/testsuite/g++.dg/warn/Wparentheses-20.C
index a1ba89d..746a310 100644
--- a/gcc/testsuite/g++.dg/warn/Wparentheses-20.C
+++ b/gcc/testsuite/g++.dg/warn/Wparentheses-20.C
@@ -101,4 +101,4 @@  bar (T a, T b, T c)
   foo (1 & (2 != 3));
 }
 
-template void bar<int> (int, int, int); // { dg-message "instantiated" }
+template void bar<int> (int, int, int); // { dg-message "required" }
diff --git a/gcc/testsuite/g++.dg/warn/Wparentheses-23.C b/gcc/testsuite/g++.dg/warn/Wparentheses-23.C
index cadc287..f1749c2 100644
--- a/gcc/testsuite/g++.dg/warn/Wparentheses-23.C
+++ b/gcc/testsuite/g++.dg/warn/Wparentheses-23.C
@@ -114,8 +114,8 @@  bar4 (T)
   return (a = a);
 }
 
-template void bar<int> (int); // { dg-message "instantiated" }
-template bool bar1<int> (int); // { dg-message "instantiated" }
+template void bar<int> (int); // { dg-message "required" }
+template bool bar1<int> (int); // { dg-message "required" }
 template bool bar2<int> (int);
-template bool bar3<int> (int); // { dg-message "instantiated" }
+template bool bar3<int> (int); // { dg-message "required" }
 template bool bar4<int> (int);
diff --git a/gcc/testsuite/g++.dg/warn/Wstrict-aliasing-3.C b/gcc/testsuite/g++.dg/warn/Wstrict-aliasing-3.C
index 94c2f47..408de0e 100644
--- a/gcc/testsuite/g++.dg/warn/Wstrict-aliasing-3.C
+++ b/gcc/testsuite/g++.dg/warn/Wstrict-aliasing-3.C
@@ -9,6 +9,6 @@  T *foo(void)
   return (T *)&x; /* { dg-warning "strict-aliasing" } */
 }
 
-template int *foo<int>(void); /* { dg-message "instantiated from here" } */
-template char *foo<char>(void); /* { dg-bogus "instantiated from here" } */
+template int *foo<int>(void); /* { dg-message "required from here" } */
+template char *foo<char>(void); /* { dg-bogus "required from here" } */
 
diff --git a/gcc/testsuite/g++.dg/warn/noeffect2.C b/gcc/testsuite/g++.dg/warn/noeffect2.C
index 451e038..8b012c8 100644
--- a/gcc/testsuite/g++.dg/warn/noeffect2.C
+++ b/gcc/testsuite/g++.dg/warn/noeffect2.C
@@ -12,9 +12,9 @@  extern "C" void FormatDisk();
   struct C {
     C(){ FormatDisk(), 0; }  // { dg-warning "right operand of comma" "" }
   };
-  template struct C<int>; // { dg-message "instantiated" }
+  template struct C<int>; // { dg-message "required" }
   template <class T>
   void f() { FormatDisk(), 0; } // { dg-warning "right operand of comma" "" }
-  template void f<int> (); // { dg-message "instantiated" }
+  template void f<int> (); // { dg-message "required" }
 void g() { FormatDisk(), 0; } // { dg-warning "right operand of comma" "" }
 
diff --git a/gcc/testsuite/g++.dg/warn/noeffect4.C b/gcc/testsuite/g++.dg/warn/noeffect4.C
index 966716b..612db48 100644
--- a/gcc/testsuite/g++.dg/warn/noeffect4.C
+++ b/gcc/testsuite/g++.dg/warn/noeffect4.C
@@ -85,4 +85,4 @@  template<int I> void Foo (X &x)
   __alignof__ (x++);           // { dg-warning "no effect" "" }
 }
 
-template void Foo<4> (X&);     // { dg-message "instantiated" }
+template void Foo<4> (X&);     // { dg-message "required" }
diff --git a/gcc/testsuite/g++.dg/warn/pr8570.C b/gcc/testsuite/g++.dg/warn/pr8570.C
index 608f4d6..4c34c6c 100644
--- a/gcc/testsuite/g++.dg/warn/pr8570.C
+++ b/gcc/testsuite/g++.dg/warn/pr8570.C
@@ -10,4 +10,4 @@  private:
   template <typename U> friend class X; // { dg-error "redeclared with 1 template parameter" }
 };
 
-X<int, int> i;		// { dg-message "instantiated" }
+X<int, int> i;		// { dg-message "required" }
diff --git a/gcc/testsuite/g++.old-deja/g++.brendan/init2.C b/gcc/testsuite/g++.old-deja/g++.brendan/init2.C
index 8f4c2d4..0bf0aba 100644
--- a/gcc/testsuite/g++.old-deja/g++.brendan/init2.C
+++ b/gcc/testsuite/g++.old-deja/g++.brendan/init2.C
@@ -1,5 +1,5 @@ 
 // { dg-do assemble  }
 // GROUPS passed initialization
-// this should give an error in require_instantiated_type about not
+// this should give an error in require_required_type about not
 // being allowed to have an initializer list in an argument list.
 int f(int a = {1});// { dg-error "" } .*
diff --git a/gcc/testsuite/g++.old-deja/g++.eh/spec6.C b/gcc/testsuite/g++.old-deja/g++.eh/spec6.C
index 015bbef..7780c4a 100644
--- a/gcc/testsuite/g++.old-deja/g++.eh/spec6.C
+++ b/gcc/testsuite/g++.old-deja/g++.eh/spec6.C
@@ -25,7 +25,7 @@  template<class T> void fnx(T *) throw(T){}  // { dg-error "" } invalid use of vo
 void fx()
 {
   fnx((int *)0);
-  fnx((void *)0);		// { dg-message "instantiated from here" }
+  fnx((void *)0);		// { dg-message "required from here" }
 }
 
 // [except.spec] 2, exception specifiers must be the same set of types (but
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/crash10.C b/gcc/testsuite/g++.old-deja/g++.pt/crash10.C
index 86f3861..2f785b4 100644
--- a/gcc/testsuite/g++.old-deja/g++.pt/crash10.C
+++ b/gcc/testsuite/g++.old-deja/g++.pt/crash10.C
@@ -9,5 +9,5 @@  public:
 };
 
 int main() {
-  GCD< 1, 0 >::val; // { dg-message "instantiated" }
+  GCD< 1, 0 >::val; // { dg-message "required" }
 }
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/crash36.C b/gcc/testsuite/g++.old-deja/g++.pt/crash36.C
index fa9401b..22687c7 100644
--- a/gcc/testsuite/g++.old-deja/g++.pt/crash36.C
+++ b/gcc/testsuite/g++.old-deja/g++.pt/crash36.C
@@ -13,7 +13,7 @@  struct iterator {
 
 
 template <class Iterator>
-struct reverse_iterator : public // { dg-message "instantiated" } no type iterator_category
+struct reverse_iterator : public // { dg-message "required" } no type iterator_category
 iterator<typename iterator_traits<Iterator>::iterator_category> {
   protected:
   Iterator current;
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/derived3.C b/gcc/testsuite/g++.old-deja/g++.pt/derived3.C
index b0d1d3b..41e03b2 100644
--- a/gcc/testsuite/g++.old-deja/g++.pt/derived3.C
+++ b/gcc/testsuite/g++.old-deja/g++.pt/derived3.C
@@ -8,9 +8,9 @@  class X {
 	class Y : public T	// { dg-error "base type .* fails to be" }
 	{
 	};
-	Y y;			// { dg-message "instantiated" }
+	Y y;			// { dg-message "required" }
 };
 int main() {
-	X<int> x;		// { dg-message "instantiated" }
+	X<int> x;		// { dg-message "required" }
 }
 
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/error2.C b/gcc/testsuite/g++.old-deja/g++.pt/error2.C
index 6cb67dd..2e65718 100644
--- a/gcc/testsuite/g++.old-deja/g++.pt/error2.C
+++ b/gcc/testsuite/g++.old-deja/g++.pt/error2.C
@@ -9,7 +9,7 @@  public:
 
 void f ()
 {
-  Test<void> c; // { dg-message "instantiated" }
+  Test<void> c; // { dg-message "required" }
 }
 
 
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/explicit70.C b/gcc/testsuite/g++.old-deja/g++.pt/explicit70.C
index 5724f6d..dc9c6c9 100644
--- a/gcc/testsuite/g++.old-deja/g++.pt/explicit70.C
+++ b/gcc/testsuite/g++.old-deja/g++.pt/explicit70.C
@@ -41,4 +41,4 @@  template <class T>
 void g(T);
 
 template void g(int); // { dg-error "no definition available" "no def" }
-// { dg-message "instantiated" "inst" { target *-*-* } 43 }
+// { dg-message "required" "inst" { target *-*-* } 43 }
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/infinite1.C b/gcc/testsuite/g++.old-deja/g++.pt/infinite1.C
index 919445b..1e2a9f0 100644
--- a/gcc/testsuite/g++.old-deja/g++.pt/infinite1.C
+++ b/gcc/testsuite/g++.old-deja/g++.pt/infinite1.C
@@ -19,3 +19,5 @@  int main()
 {
   f<0>();
 }
+
+// { dg-prune-output "note" }
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/memtemp89.C b/gcc/testsuite/g++.old-deja/g++.pt/memtemp89.C
index d4d560e..1a1b5ea 100644
--- a/gcc/testsuite/g++.old-deja/g++.pt/memtemp89.C
+++ b/gcc/testsuite/g++.old-deja/g++.pt/memtemp89.C
@@ -12,4 +12,4 @@  template<template<class> class XX>
 class Y {
 	XX<int> x_;
 };
-Y<Q::X> y;			// { dg-error "" } instantiated from here
+Y<Q::X> y;			// { dg-error "" } required from here
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/overload7.C b/gcc/testsuite/g++.old-deja/g++.pt/overload7.C
index 6f5dff0..c41beb0 100644
--- a/gcc/testsuite/g++.old-deja/g++.pt/overload7.C
+++ b/gcc/testsuite/g++.old-deja/g++.pt/overload7.C
@@ -17,5 +17,5 @@  template<class T> void foo(moo_t<T>) {
 
 int main() {
   moo_t<int> x;
-  foo(x); // { dg-bogus "" "" { xfail *-*-* } }  - instantiated from here - 
+  foo(x); // { dg-bogus "" "" { xfail *-*-* } }  - required from here -
 }
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/vaarg3.C b/gcc/testsuite/g++.old-deja/g++.pt/vaarg3.C
index 07fb18d..e880119 100644
--- a/gcc/testsuite/g++.old-deja/g++.pt/vaarg3.C
+++ b/gcc/testsuite/g++.old-deja/g++.pt/vaarg3.C
@@ -22,6 +22,6 @@  int main (void)
 {
 A dummy;
 PrintArgs (dummy, dummy); // { dg-error "cannot pass" } cannot pass non-POD
-// { dg-message "instantiated" "inst" { target *-*-* } 24 }
+// { dg-message "required" "inst" { target *-*-* } 24 }
 return 0;
 }
diff --git a/gcc/testsuite/lib/prune.exp b/gcc/testsuite/lib/prune.exp
index 29d69b9..58b59a4 100644
--- a/gcc/testsuite/lib/prune.exp
+++ b/gcc/testsuite/lib/prune.exp
@@ -22,7 +22,7 @@  proc prune_gcc_output { text } {
 
     regsub -all "(^|\n)(\[^\n\]*: )?In ((static member |lambda )?function|member|method|(copy )?constructor|destructor|instantiation|program|subroutine|block-data)\[^\n\]*" $text "" text
     regsub -all "(^|\n)\[^\n\]*(: )?At (top level|global scope):\[^\n\]*" $text "" text
-    regsub -all "(^|\n)\[^\n\]*:   (recursively )?instantiated from \[^\n\]*" $text "" text
+    regsub -all "(^|\n)\[^\n\]*:   (recursively )?required \[^\n\]*" $text "" text
     regsub -all "(^|\n)\[^\n\]*:   . skipping \[0-9\]* instantiation contexts \[^\n\]*" $text "" text
     regsub -all "(^|\n)    inlined from \[^\n\]*" $text "" text
     regsub -all "(^|\n)collect2: error: ld returned \[^\n\]*" $text "" text
diff --git a/libstdc++-v3/testsuite/20_util/declval/requirements/1_neg.cc b/libstdc++-v3/testsuite/20_util/declval/requirements/1_neg.cc
index 8fcdab4..a5f4b28 100644
--- a/libstdc++-v3/testsuite/20_util/declval/requirements/1_neg.cc
+++ b/libstdc++-v3/testsuite/20_util/declval/requirements/1_neg.cc
@@ -25,5 +25,5 @@ 
 
 void test01()
 {
-  std::declval<int>();		// { dg-error "instantiated from here" }
+  std::declval<int>();		// { dg-error "required from here" }
 }
diff --git a/libstdc++-v3/testsuite/20_util/duration/requirements/typedefs_neg1.cc b/libstdc++-v3/testsuite/20_util/duration/requirements/typedefs_neg1.cc
index 5965f03..1e9c69e 100644
--- a/libstdc++-v3/testsuite/20_util/duration/requirements/typedefs_neg1.cc
+++ b/libstdc++-v3/testsuite/20_util/duration/requirements/typedefs_neg1.cc
@@ -32,4 +32,4 @@  void test01()
 }
 
 // { dg-error "rep cannot be a duration" "" { target *-*-* } 226 }
-// { dg-error "instantiated from here" "" { target *-*-* } 31 }
+// { dg-error "required from here" "" { target *-*-* } 31 }
diff --git a/libstdc++-v3/testsuite/20_util/duration/requirements/typedefs_neg2.cc b/libstdc++-v3/testsuite/20_util/duration/requirements/typedefs_neg2.cc
index d84ab9e..c30d94c 100644
--- a/libstdc++-v3/testsuite/20_util/duration/requirements/typedefs_neg2.cc
+++ b/libstdc++-v3/testsuite/20_util/duration/requirements/typedefs_neg2.cc
@@ -33,5 +33,5 @@  void test01()
 }
 
 // { dg-error "must be a specialization of ratio" "" { target *-*-* } 227 }
-// { dg-error "instantiated from here" "" { target *-*-* } 32 }
+// { dg-error "required from here" "" { target *-*-* } 32 }
 // { dg-excess-errors "In instantiation of" }
diff --git a/libstdc++-v3/testsuite/20_util/duration/requirements/typedefs_neg3.cc b/libstdc++-v3/testsuite/20_util/duration/requirements/typedefs_neg3.cc
index 7c73bf9..940af7f 100644
--- a/libstdc++-v3/testsuite/20_util/duration/requirements/typedefs_neg3.cc
+++ b/libstdc++-v3/testsuite/20_util/duration/requirements/typedefs_neg3.cc
@@ -34,4 +34,4 @@  void test01()
 }
 
 // { dg-error "period must be positive" "" { target *-*-* } 229 }
-// { dg-error "instantiated from here" "" { target *-*-* } 33 }
+// { dg-error "required from here" "" { target *-*-* } 33 }
diff --git a/libstdc++-v3/testsuite/20_util/forward/1_neg.cc b/libstdc++-v3/testsuite/20_util/forward/1_neg.cc
index 6c007be..978ea52 100644
--- a/libstdc++-v3/testsuite/20_util/forward/1_neg.cc
+++ b/libstdc++-v3/testsuite/20_util/forward/1_neg.cc
@@ -38,7 +38,7 @@  struct A
 
 void g()
 {
-  std::shared_ptr<A> sp1 = factory<A>(2, 1.414); // { dg-error "instantiated from here" }
+  std::shared_ptr<A> sp1 = factory<A>(2, 1.414); // { dg-error "required from here" }
 }
 
 // { dg-excess-errors "" }
diff --git a/libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs_neg.cc b/libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs_neg.cc
index 77328d8..f37d4fb 100644
--- a/libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs_neg.cc
+++ b/libstdc++-v3/testsuite/20_util/make_signed/requirements/typedefs_neg.cc
@@ -43,10 +43,10 @@  void test01()
 }
 
 // { dg-error "does not name a type" "" { target *-*-* } 33 }
-// { dg-error "instantiated from here" "" { target *-*-* } 35 }
-// { dg-error "instantiated from here" "" { target *-*-* } 37 }
-// { dg-error "instantiated from here" "" { target *-*-* } 40 }
-// { dg-error "instantiated from here" "" { target *-*-* } 42 }
+// { dg-error "required from here" "" { target *-*-* } 35 }
+// { dg-error "required from here" "" { target *-*-* } 37 }
+// { dg-error "required from here" "" { target *-*-* } 40 }
+// { dg-error "required from here" "" { target *-*-* } 42 }
 
 // { dg-error "invalid use of incomplete type" "" { target *-*-* } 1511 }
 // { dg-error "declaration of" "" { target *-*-* } 1475 }
diff --git a/libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc b/libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc
index 572953e..497f170 100644
--- a/libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc
+++ b/libstdc++-v3/testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc
@@ -43,10 +43,10 @@  void test01()
 }
 
 // { dg-error "does not name a type" "" { target *-*-* } 33 }
-// { dg-error "instantiated from here" "" { target *-*-* } 35 }
-// { dg-error "instantiated from here" "" { target *-*-* } 37 }
-// { dg-error "instantiated from here" "" { target *-*-* } 40 }
-// { dg-error "instantiated from here" "" { target *-*-* } 42 }
+// { dg-error "required from here" "" { target *-*-* } 35 }
+// { dg-error "required from here" "" { target *-*-* } 37 }
+// { dg-error "required from here" "" { target *-*-* } 40 }
+// { dg-error "required from here" "" { target *-*-* } 42 }
 
 // { dg-error "invalid use of incomplete type" "" { target *-*-* } 1435 }
 // { dg-error "declaration of" "" { target *-*-* } 1399 }
diff --git a/libstdc++-v3/testsuite/20_util/ratio/cons/cons_overflow_neg.cc b/libstdc++-v3/testsuite/20_util/ratio/cons/cons_overflow_neg.cc
index e6a71c3..83f5ce1 100644
--- a/libstdc++-v3/testsuite/20_util/ratio/cons/cons_overflow_neg.cc
+++ b/libstdc++-v3/testsuite/20_util/ratio/cons/cons_overflow_neg.cc
@@ -46,9 +46,9 @@  test04()
   std::ratio<1,0> r1 __attribute__((unused));
 }
 
-// { dg-error "instantiated from here" "" { target *-*-* } 34 }
-// { dg-error "instantiated from here" "" { target *-*-* } 40 }
-// { dg-error "instantiated from here" "" { target *-*-* } 46 }
+// { dg-error "required from here" "" { target *-*-* } 34 }
+// { dg-error "required from here" "" { target *-*-* } 40 }
+// { dg-error "required from here" "" { target *-*-* } 46 }
 // { dg-error "denominator cannot be zero" "" { target *-*-* } 268 }
 // { dg-error "out of range" "" { target *-*-* } 269 }
 // { dg-error "overflow in constant expression" "" { target *-*-* } 109 }
diff --git a/libstdc++-v3/testsuite/20_util/ratio/operations/ops_overflow_neg.cc b/libstdc++-v3/testsuite/20_util/ratio/operations/ops_overflow_neg.cc
index f1da219..07b1a56 100644
--- a/libstdc++-v3/testsuite/20_util/ratio/operations/ops_overflow_neg.cc
+++ b/libstdc++-v3/testsuite/20_util/ratio/operations/ops_overflow_neg.cc
@@ -36,9 +36,9 @@  test02()
   std::ratio_multiply<std::ratio<INTMAX_MAX>, std::ratio<INTMAX_MAX>>::type r2;
 }
 
-// { dg-error "instantiated from here" "" { target *-*-* } 29 }
-// { dg-error "instantiated from here" "" { target *-*-* } 35 }
-// { dg-error "instantiated from here" "" { target *-*-* } 36 }
+// { dg-error "required from here" "" { target *-*-* } 29 }
+// { dg-error "required from here" "" { target *-*-* } 35 }
+// { dg-error "required from here" "" { target *-*-* } 36 }
 // { dg-error "overflow in addition" "" { target *-*-* } 432 }
 // { dg-error "overflow in multiplication" "" { target *-*-* } 104 }
 // { dg-error "overflow in multiplication" "" { target *-*-* } 100 }
diff --git a/libstdc++-v3/testsuite/20_util/shared_ptr/assign/shared_ptr_neg.cc b/libstdc++-v3/testsuite/20_util/shared_ptr/assign/shared_ptr_neg.cc
index e0d09de..a56148a 100644
--- a/libstdc++-v3/testsuite/20_util/shared_ptr/assign/shared_ptr_neg.cc
+++ b/libstdc++-v3/testsuite/20_util/shared_ptr/assign/shared_ptr_neg.cc
@@ -49,4 +49,4 @@  main()
 }
 // { dg-error "In member function" "" { target *-*-* } 0 }
 // { dg-error "cannot convert" "" { target *-*-* } 0 }
-// { dg-error "instantiated from" "" { target *-*-* } 0 }
+// { dg-error "required from" "" { target *-*-* } 0 }
diff --git a/libstdc++-v3/testsuite/ext/ext_pointer/1_neg.cc b/libstdc++-v3/testsuite/ext/ext_pointer/1_neg.cc
index 0ceb9a6..c87e35d 100644
--- a/libstdc++-v3/testsuite/ext/ext_pointer/1_neg.cc
+++ b/libstdc++-v3/testsuite/ext/ext_pointer/1_neg.cc
@@ -54,16 +54,16 @@  void test01(void) {
   A_pointer aptr( &a );
 
   // Can't implicitly cast from A* to B*
-  B_pointer bptr1(aptr); // { dg-error "instantiated from here" 31 }
-  B_pointer bptr2(&a); // { dg-error "instantiated from here" 32 }
+  B_pointer bptr1(aptr); // { dg-error "required from here" 31 }
+  B_pointer bptr2(&a); // { dg-error "required from here" 32 }
 
   // but explicit cast/conversion is OK.
   B_pointer bptr3(__static_pointer_cast<B_pointer>(aptr)); // ok
   B_pointer bptr4(__static_pointer_cast<B_pointer>(&a)); // ok
 
   // Can't implicitly cast from A* to B*
-  bptr1 = aptr; // { dg-error "instantiated from here" 39 }
-  bptr1 = &a; // { dg-error "instantiated from here" 40 }
+  bptr1 = aptr; // { dg-error "required from here" 39 }
+  bptr1 = &a; // { dg-error "required from here" 40 }
 
   // but explicit cast/conversion is OK.
   bptr1 = __static_pointer_cast<B_pointer>(aptr); // ok
@@ -71,21 +71,21 @@  void test01(void) {
 
   // Similarly, can't shed constness via implicit cast
   const_A_pointer captr(&a);
-  A_pointer aptr2(captr); // { dg-error "instantiated from here" 48 }
+  A_pointer aptr2(captr); // { dg-error "required from here" 48 }
 
   // but explicit cast/conversion is OK.
   A_pointer aptr3(__const_pointer_cast<A_pointer>(captr)); // ok
 
   // Similarly, can't shed constness via implicit cast
-  aptr2 = captr; // { dg-error "instantiated from here" 54 }
+  aptr2 = captr; // { dg-error "required from here" 54 }
 
   // but explicit cast/conversion is OK.
   aptr3 = __const_pointer_cast<A_pointer>(captr); // ok
 
   // Combine explicit const cast with implicit downcast.
   const_B_pointer cbptr(&b);
-  A_pointer aptr4(cbptr); // { dg-error "instantiated from here" 61 }
-  aptr4 = cbptr; // { dg-error "instantiated from here" 62 }
+  A_pointer aptr4(cbptr); // { dg-error "required from here" 61 }
+  aptr4 = cbptr; // { dg-error "required from here" 62 }
 
   A_pointer aptr5(__const_pointer_cast<B_pointer>(cbptr)); // ok
   aptr5 = __const_pointer_cast<B_pointer>(cbptr);  // ok
diff --git a/libstdc++-v3/testsuite/ext/pb_ds/example/hash_resize_neg.cc b/libstdc++-v3/testsuite/ext/pb_ds/example/hash_resize_neg.cc
index 9577dfb..c5b2bd2 100644
--- a/libstdc++-v3/testsuite/ext/pb_ds/example/hash_resize_neg.cc
+++ b/libstdc++-v3/testsuite/ext/pb_ds/example/hash_resize_neg.cc
@@ -57,7 +57,7 @@  int main()
   // The following line won't compile. The resize policy needs to be
   // configured to allow external resize (by default, this is not
   // available).
-  h.resize(20); // { dg-error "instantiated from" }
+  h.resize(20); // { dg-error "required from" }
 }
 
 // { dg-error "invalid" "" { target *-*-* } 187 } 
diff --git a/libstdc++-v3/testsuite/ext/type_traits/add_unsigned_floating_neg.cc b/libstdc++-v3/testsuite/ext/type_traits/add_unsigned_floating_neg.cc
index 98202bd..fbd5f1d 100644
--- a/libstdc++-v3/testsuite/ext/type_traits/add_unsigned_floating_neg.cc
+++ b/libstdc++-v3/testsuite/ext/type_traits/add_unsigned_floating_neg.cc
@@ -30,9 +30,9 @@  template<typename T>
 
 int main()
 {
-  check_add_unsigned<float>();  // { dg-error "instantiated from" }
+  check_add_unsigned<float>();  // { dg-error "required from" }
   return 0;
 }
 
-// { dg-error "instantiated from" "" { target *-*-* } 28 } 
+// { dg-error "required from" "" { target *-*-* } 28 }
 // { dg-error "no type" "" { target *-*-* } 69 } 
diff --git a/libstdc++-v3/testsuite/ext/type_traits/add_unsigned_integer_neg.cc b/libstdc++-v3/testsuite/ext/type_traits/add_unsigned_integer_neg.cc
index f08c879..b976de0 100644
--- a/libstdc++-v3/testsuite/ext/type_traits/add_unsigned_integer_neg.cc
+++ b/libstdc++-v3/testsuite/ext/type_traits/add_unsigned_integer_neg.cc
@@ -30,8 +30,8 @@  template<typename T>
 
 int main()
 {
-  check_add_unsigned<bool>();  // { dg-error "instantiated from" }
-  check_add_unsigned<wchar_t>();  // { dg-error "instantiated from" }
+  check_add_unsigned<bool>();  // { dg-error "required from" }
+  check_add_unsigned<wchar_t>();  // { dg-error "required from" }
   return 0;
 }
 
diff --git a/libstdc++-v3/testsuite/ext/type_traits/remove_unsigned_floating_neg.cc b/libstdc++-v3/testsuite/ext/type_traits/remove_unsigned_floating_neg.cc
index 486baad..2e04046 100644
--- a/libstdc++-v3/testsuite/ext/type_traits/remove_unsigned_floating_neg.cc
+++ b/libstdc++-v3/testsuite/ext/type_traits/remove_unsigned_floating_neg.cc
@@ -30,9 +30,9 @@  template<typename T>
 
 int main()
 {
-  check_remove_unsigned<float>();  // { dg-error "instantiated from" }
+  check_remove_unsigned<float>();  // { dg-error "required from" }
   return 0;
 }
 
-// { dg-error "instantiated from" "" { target *-*-* } 28 }
+// { dg-error "required from" "" { target *-*-* } 28 }
 // { dg-error "no type" "" { target *-*-* } 112 }
diff --git a/libstdc++-v3/testsuite/ext/type_traits/remove_unsigned_integer_neg.cc b/libstdc++-v3/testsuite/ext/type_traits/remove_unsigned_integer_neg.cc
index 1ad1d93..bd5c423 100644
--- a/libstdc++-v3/testsuite/ext/type_traits/remove_unsigned_integer_neg.cc
+++ b/libstdc++-v3/testsuite/ext/type_traits/remove_unsigned_integer_neg.cc
@@ -30,8 +30,8 @@  template<typename T>
 
 int main()
 {
-  check_remove_unsigned<bool>();  // { dg-error "instantiated from" }
-  check_remove_unsigned<wchar_t>();  // { dg-error "instantiated from" }
+  check_remove_unsigned<bool>();  // { dg-error "required from" }
+  check_remove_unsigned<wchar_t>();  // { dg-error "required from" }
   return 0;
 }
 
diff --git a/libstdc++-v3/testsuite/lib/prune.exp b/libstdc++-v3/testsuite/lib/prune.exp
index cdbcd31..e7d6a5a 100644
--- a/libstdc++-v3/testsuite/lib/prune.exp
+++ b/libstdc++-v3/testsuite/lib/prune.exp
@@ -39,7 +39,7 @@  proc libstdc++-dg-prune { system text } {
     # definitions, etc as these confuse dejagnu
     regsub -all "(^|\n)(\[^\n\]*: )?In ((static member |lambda )?function|member|method|(copy )?constructor|destructor|instantiation|program|subroutine|block-data)\[^\n\]*" $text "" text
     regsub -all "(^|\n)\[^\n\]*(: )?At (top level|global scope):\[^\n\]*" $text "" text
-    regsub -all "(^|\n)\[^\n\]*:   (recursively )?instantiated from \[^\n\]*" $text "" text
+    regsub -all "(^|\n)\[^\n\]*:   (recursively )?required \[^\n\]*" $text "" text
     regsub -all "(^|\n)\[^\n\]*:   . skipping \[0-9\]* instantiation contexts \[^\n\]*" $text "" text
     regsub -all "(^|\n)    inlined from \[^\n\]*" $text "" text
     # Why doesn't GCC need these to strip header context?
diff --git a/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/assign/shared_ptr_neg.cc b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/assign/shared_ptr_neg.cc
index 490cfc4..8114531 100644
--- a/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/assign/shared_ptr_neg.cc
+++ b/libstdc++-v3/testsuite/tr1/2_general_utilities/shared_ptr/assign/shared_ptr_neg.cc
@@ -48,4 +48,4 @@  main()
 }
 // { dg-error "In member function" "" { target *-*-* } 0 }
 // { dg-error "cannot convert" "" { target *-*-* } 0 }
-// { dg-error "instantiated from" "" { target *-*-* } 0 }
+// { dg-error "required from" "" { target *-*-* } 0 }