From: Jason Merrill Date: Tue, 7 Jun 2011 21:54:07 +0000 (-0400) Subject: re PR c++/48969 (ICE with -std=c++0x) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=3ff609751050030ea83a7ff58eca5c07a3adcdfc;p=gcc.git re PR c++/48969 (ICE with -std=c++0x) PR c++/48969 PR c++/44175 gcc/c-family/ * c-common.c (max_tinst_depth): Lower default to 900. gcc/cp/ * 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. From-SVN: r174772 --- diff --git a/gcc/c-family/ChangeLog b/gcc/c-family/ChangeLog index 0e71e376d5e..97913c477ff 100644 --- a/gcc/c-family/ChangeLog +++ b/gcc/c-family/ChangeLog @@ -1,5 +1,7 @@ 2011-06-07 Jason Merrill + * c-common.c (max_tinst_depth): Lower default to 900. + * c-format.c (gcc_cxxdiag_char_table): Add 'S' format. 2011-06-07 Richard Guenther diff --git a/gcc/c-family/c-common.c b/gcc/c-family/c-common.c index e5c070f940b..37a5f1e45d4 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/ChangeLog b/gcc/cp/ChangeLog index 641bf73bd05..5b47f21d262 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,5 +1,14 @@ 2011-06-07 Jason Merrill + PR c++/48969 + PR c++/44175 + * 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. + * pt.c (deduction_tsubst_fntype): Use push_deduction_access_scope. (fn_type_unification): Don't call push_deduction_access_scope here. diff --git a/gcc/cp/error.c b/gcc/cp/error.c index a40630ac9c3..d9652dc10ef 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 ce43d8a669e..f93fa7fd6cc 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 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); - } - - /* 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; - } + if (excessive_deduction_depth) + 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 5f4c66a1dc1..ab0cf0a9b7e 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/ChangeLog b/gcc/testsuite/ChangeLog index 3b5ebcf1cea..b9f3aa3313b 100644 --- a/gcc/testsuite/ChangeLog +++ b/gcc/testsuite/ChangeLog @@ -1,3 +1,131 @@ +2011-06-07 Jason Merrill + + * lib/prune.exp: Look for "required" rather than "instantiated". + * g++.dg/abi/mangle11.C: Likewise. + * g++.dg/abi/mangle12.C: Likewise. + * g++.dg/abi/mangle17.C: Likewise. + * g++.dg/abi/mangle20-2.C: Likewise. + * g++.dg/abi/pragma-pack1.C: Likewise. + * g++.dg/cpp0x/decltype26.C: Likewise. + * g++.dg/cpp0x/decltype28.C: Likewise. + * g++.dg/cpp0x/decltype29.C: Likewise. + * g++.dg/cpp0x/enum11.C: Likewise. + * g++.dg/cpp0x/forw_enum8.C: Likewise. + * g++.dg/cpp0x/lambda/lambda-errloc2.C: Likewise. + * g++.dg/cpp0x/pr47416.C: Likewise. + * g++.dg/ext/case-range2.C: Likewise. + * g++.dg/ext/case-range3.C: Likewise. + * g++.dg/gomp/for-19.C: Likewise. + * g++.dg/gomp/pr37533.C: Likewise. + * g++.dg/gomp/pr38639.C: Likewise. + * g++.dg/gomp/tpl-parallel-2.C: Likewise. + * g++.dg/inherit/base3.C: Likewise. + * g++.dg/inherit/using6.C: Likewise. + * g++.dg/init/placement4.C: Likewise. + * g++.dg/init/reference3.C: Likewise. + * g++.dg/lookup/scoped6.C: Likewise. + * g++.dg/lookup/using7.C: Likewise. + * g++.dg/other/abstract1.C: Likewise. + * g++.dg/other/error10.C: Likewise. + * g++.dg/other/error5.C: Likewise. + * g++.dg/other/field1.C: Likewise. + * g++.dg/other/offsetof5.C: Likewise. + * g++.dg/parse/bitfield2.C: Likewise. + * g++.dg/parse/constant4.C: Likewise. + * g++.dg/parse/crash20.C: Likewise. + * g++.dg/parse/invalid-op1.C: Likewise. + * g++.dg/parse/non-dependent2.C: Likewise. + * g++.dg/parse/template18.C: Likewise. + * g++.dg/tc1/dr152.C: Likewise. + * g++.dg/tc1/dr166.C: Likewise. + * g++.dg/tc1/dr176.C: Likewise. + * g++.dg/tc1/dr213.C: Likewise. + * g++.dg/template/access11.C: Likewise. + * g++.dg/template/access2.C: Likewise. + * g++.dg/template/access3.C: Likewise. + * g++.dg/template/access7.C: Likewise. + * g++.dg/template/arg7.C: Likewise. + * g++.dg/template/cond2.C: Likewise. + * g++.dg/template/crash13.C: Likewise. + * g++.dg/template/crash40.C: Likewise. + * g++.dg/template/crash7.C: Likewise. + * g++.dg/template/crash84.C: Likewise. + * g++.dg/template/ctor5.C: Likewise. + * g++.dg/template/defarg13.C: Likewise. + * g++.dg/template/defarg14.C: Likewise. + * g++.dg/template/dtor7.C: Likewise. + * g++.dg/template/eh2.C: Likewise. + * g++.dg/template/error2.C: Likewise. + * g++.dg/template/error43.C: Likewise. + * g++.dg/template/friend32.C: Likewise. + * g++.dg/template/injected1.C: Likewise. + * g++.dg/template/instantiate1.C: Likewise. + * g++.dg/template/instantiate3.C: Likewise. + * g++.dg/template/instantiate5.C: Likewise. + * g++.dg/template/instantiate7.C: Likewise. + * g++.dg/template/local6.C: Likewise. + * g++.dg/template/lookup2.C: Likewise. + * g++.dg/template/member5.C: Likewise. + * g++.dg/template/memfriend15.C: Likewise. + * g++.dg/template/memfriend16.C: Likewise. + * g++.dg/template/memfriend17.C: Likewise. + * g++.dg/template/memfriend7.C: Likewise. + * g++.dg/template/meminit1.C: Likewise. + * g++.dg/template/nested3.C: Likewise. + * g++.dg/template/non-type-template-argument-1.C: Likewise. + * g++.dg/template/nontype12.C: Likewise. + * g++.dg/template/nontype13.C: Likewise. + * g++.dg/template/nontype6.C: Likewise. + * g++.dg/template/pr23510.C: Likewise. + * g++.dg/template/pr35240.C: Likewise. + * g++.dg/template/ptrmem15.C: Likewise. + * g++.dg/template/ptrmem6.C: Likewise. + * g++.dg/template/qualified-id1.C: Likewise. + * g++.dg/template/qualttp20.C: Likewise. + * g++.dg/template/qualttp3.C: Likewise. + * g++.dg/template/qualttp4.C: Likewise. + * g++.dg/template/qualttp5.C: Likewise. + * g++.dg/template/qualttp6.C: Likewise. + * g++.dg/template/qualttp7.C: Likewise. + * g++.dg/template/qualttp8.C: Likewise. + * g++.dg/template/recurse.C: Likewise. + * g++.dg/template/recurse2.C: Likewise. + * g++.dg/template/ref5.C: Likewise. + * g++.dg/template/scope2.C: Likewise. + * g++.dg/template/sfinae10.C: Likewise. + * g++.dg/template/sfinae3.C: Likewise. + * g++.dg/template/sizeof3.C: Likewise. + * g++.dg/template/static9.C: Likewise. + * g++.dg/template/template-id-2.C: Likewise. + * g++.dg/template/typedef13.C: Likewise. + * g++.dg/template/typename4.C: Likewise. + * g++.dg/template/using14.C: Likewise. + * g++.dg/template/using2.C: Likewise. + * g++.dg/template/warn1.C: Likewise. + * g++.dg/warn/Wparentheses-13.C: Likewise. + * g++.dg/warn/Wparentheses-15.C: Likewise. + * g++.dg/warn/Wparentheses-16.C: Likewise. + * g++.dg/warn/Wparentheses-17.C: Likewise. + * g++.dg/warn/Wparentheses-18.C: Likewise. + * g++.dg/warn/Wparentheses-19.C: Likewise. + * g++.dg/warn/Wparentheses-20.C: Likewise. + * g++.dg/warn/Wparentheses-23.C: Likewise. + * g++.dg/warn/Wstrict-aliasing-3.C: Likewise. + * g++.dg/warn/noeffect2.C: Likewise. + * g++.dg/warn/noeffect4.C: Likewise. + * g++.dg/warn/pr8570.C: Likewise. + * g++.old-deja/g++.brendan/init2.C: Likewise. + * g++.old-deja/g++.eh/spec6.C: Likewise. + * g++.old-deja/g++.pt/crash10.C: Likewise. + * g++.old-deja/g++.pt/crash36.C: Likewise. + * g++.old-deja/g++.pt/derived3.C: Likewise. + * g++.old-deja/g++.pt/error2.C: Likewise. + * g++.old-deja/g++.pt/explicit70.C: Likewise. + * g++.old-deja/g++.pt/infinite1.C: Likewise. + * g++.old-deja/g++.pt/memtemp89.C: Likewise. + * g++.old-deja/g++.pt/overload7.C: Likewise. + * g++.old-deja/g++.pt/vaarg3.C: Likewise. + 2011-06-07 Nicola Pero Iain Sandoe diff --git a/gcc/testsuite/g++.dg/abi/mangle11.C b/gcc/testsuite/g++.dg/abi/mangle11.C index 3152c256f1c..722d43c85a8 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 (int); // { dg-message "instantiated" } +template void f (int); // { dg-message "required" } diff --git a/gcc/testsuite/g++.dg/abi/mangle12.C b/gcc/testsuite/g++.dg/abi/mangle12.C index 3910cfc93eb..92f49c22fdf 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 (int); // { dg-message "instantiated" } +template void f (int); // { dg-message "required" } diff --git a/gcc/testsuite/g++.dg/abi/mangle17.C b/gcc/testsuite/g++.dg/abi/mangle17.C index 57f1a045c82..f98e2717d84 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 struct S {}; template void f (S) {} // { 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 void g (S) {} // { 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 b244e2e794e..5ba6bac03a6 100644 --- a/gcc/testsuite/g++.dg/abi/mangle20-2.C +++ b/gcc/testsuite/g++.dg/abi/mangle20-2.C @@ -10,7 +10,7 @@ template void f(int (*)[2]) {} // { dg-warning "mangled name" } template 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 d90fc200cbf..9b76071c9d8 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; /* T is instantiated here */ template int f(); #pragma pack(4) -template struct T; /* T is instantiated here */ +template struct T; /* T is required here */ template int f(); int main() diff --git a/gcc/testsuite/g++.dg/cpp0x/decltype26.C b/gcc/testsuite/g++.dg/cpp0x/decltype26.C index 9eb94116a6d..a81d411558c 100644 --- a/gcc/testsuite/g++.dg/cpp0x/decltype26.C +++ b/gcc/testsuite/g++.dg/cpp0x/decltype26.C @@ -3,7 +3,7 @@ struct A { }; template -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 0ab8932d7f8..c97fd202c1d 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::type) {} template< class F, int N > decltype(ft (F(), 0)) -ft (F f, typename enable_if::type) {} +ft (F f, typename enable_if::type) {} // { dg-error "depth" } int main() { - ft (0, 0); + ft (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 1dd5a5f9bf7..2bb79d07e78 100644 --- a/gcc/testsuite/g++.dg/cpp0x/decltype29.C +++ b/gcc/testsuite/g++.dg/cpp0x/decltype29.C @@ -10,7 +10,7 @@ ft() {} template decltype (ft (F())) -ft() {} +ft() {} // { dg-error "depth" } int main() { ft(); // { dg-error "no match" } diff --git a/gcc/testsuite/g++.dg/cpp0x/enum11.C b/gcc/testsuite/g++.dg/cpp0x/enum11.C index 98b6b00c6b4..156c765beaf 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 struct Pair { }; struct Foo { enum { Mask = 1 }; } foo; template class Pair -operator|(const A &, const B &) +operator|(const A &, const B &) // { dg-message "substitution" } { } -Pair f = foo|foo; +Pair 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 c87aa5bf652..69e73119e0c 100644 --- a/gcc/testsuite/g++.dg/cpp0x/forw_enum8.C +++ b/gcc/testsuite/g++.dg/cpp0x/forw_enum8.C @@ -15,7 +15,7 @@ template struct S2 enum E : int; // { dg-error "previous definition" } enum E : T; // { dg-error "different underlying type" } }; -template struct S2; // { dg-message "instantiated from here" } +template struct S2; // { dg-message "required from here" } //This error is diagnosed at compilation time template 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 dab53f1276e..f94d64ec0ea 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(); // { dg-message "instantiated" } + f(); // { dg-message "required" } } diff --git a/gcc/testsuite/g++.dg/cpp0x/pr47416.C b/gcc/testsuite/g++.dg/cpp0x/pr47416.C index a11368a50f0..55426c1f81d 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 de1f2a7e763..985ded3362e 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 5a09c12d61d..0b0c1fc69a8 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 1929e45f884..7c56719cc16 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 (); // { dg-message "instantiated from here" } + f1 (); // { dg-message "required from here" } f2 (); f3 (); - f3 (); // { dg-message "instantiated from here" } + f3 (); // { dg-message "required from here" } } diff --git a/gcc/testsuite/g++.dg/gomp/pr37533.C b/gcc/testsuite/g++.dg/gomp/pr37533.C index 7bf61945b2e..4cbf256200b 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 (); // { dg-message "instantiated from here" } - f4 (); // { dg-message "instantiated from here" } + f1<0> (); // { dg-message "required from here" } + f2<1> (); // { dg-message "required from here" } + f3 (); // { dg-message "required from here" } + f4 (); // { dg-message "required from here" } } diff --git a/gcc/testsuite/g++.dg/gomp/pr38639.C b/gcc/testsuite/g++.dg/gomp/pr38639.C index 1da3cecdf07..e7145ffbeb9 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 2dceb093287..93e076047e7 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::test() template struct S; template struct S; -template struct S; // { dg-message "instantiated from here" } +template struct S; // { dg-message "required from here" } diff --git a/gcc/testsuite/g++.dg/inherit/base3.C b/gcc/testsuite/g++.dg/inherit/base3.C index 866b2906c4f..313d0424291 100644 --- a/gcc/testsuite/g++.dg/inherit/base3.C +++ b/gcc/testsuite/g++.dg/inherit/base3.C @@ -5,4 +5,4 @@ template struct A : T {}; // { dg-error "struct or class type" } struct B; -A a; // { dg-message "instantiated" } +A a; // { dg-message "required" } diff --git a/gcc/testsuite/g++.dg/inherit/using6.C b/gcc/testsuite/g++.dg/inherit/using6.C index 7bdfc3405c1..1877d671ae1 100644 --- a/gcc/testsuite/g++.dg/inherit/using6.C +++ b/gcc/testsuite/g++.dg/inherit/using6.C @@ -12,4 +12,4 @@ template struct TPL : A }; TPL i; -TPL j; // { dg-message "instantiated" } +TPL j; // { dg-message "required" } diff --git a/gcc/testsuite/g++.dg/init/placement4.C b/gcc/testsuite/g++.dg/init/placement4.C index 9c61eca2b04..3cfe27d63e6 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& pool) int main () { Pool 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 344e94e101e..8cc5afd6f4c 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(); // { dg-message "instantiated from here" } +int &a = f(); // { dg-message "required from here" } diff --git a/gcc/testsuite/g++.dg/lookup/scoped6.C b/gcc/testsuite/g++.dg/lookup/scoped6.C index b83b08fe94f..51393961ab2 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 foo_; public: - Bar() {} // { dg-message "instantiated" } + Bar() {} // { dg-message "required" } }; template class Foo; diff --git a/gcc/testsuite/g++.dg/lookup/using7.C b/gcc/testsuite/g++.dg/lookup/using7.C index 69e27da4700..0c75a2df6ba 100644 --- a/gcc/testsuite/g++.dg/lookup/using7.C +++ b/gcc/testsuite/g++.dg/lookup/using7.C @@ -9,4 +9,4 @@ template struct B : A // { dg-error "incomplete" } // { dg-error "using" "using" { target *-*-* } 8 } }; -B b; // { dg-message "instantiated" } +B b; // { dg-message "required" } diff --git a/gcc/testsuite/g++.dg/other/abstract1.C b/gcc/testsuite/g++.dg/other/abstract1.C index 8406f8a25d7..53d767acd45 100644 --- a/gcc/testsuite/g++.dg/other/abstract1.C +++ b/gcc/testsuite/g++.dg/other/abstract1.C @@ -35,7 +35,7 @@ template struct K { T (*a)[2]; // { dg-error "abstract class type" } }; -template struct K; // { dg-message "instantiated" } +template struct K; // { dg-message "required" } diff --git a/gcc/testsuite/g++.dg/other/error10.C b/gcc/testsuite/g++.dg/other/error10.C index 26f7ca53f29..5c17277abbf 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 &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 c7a142fb57d..44c4a4747a6 100644 --- a/gcc/testsuite/g++.dg/other/error5.C +++ b/gcc/testsuite/g++.dg/other/error5.C @@ -10,4 +10,4 @@ template struct S2 : S { using S::operator typename S::I*; // { dg-error "operator S\\" "" } }; -template struct S2; // { dg-message "instantiated" "" } +template struct S2; // { dg-message "required" "" } diff --git a/gcc/testsuite/g++.dg/other/field1.C b/gcc/testsuite/g++.dg/other/field1.C index 61a9df69563..a719135e3f9 100644 --- a/gcc/testsuite/g++.dg/other/field1.C +++ b/gcc/testsuite/g++.dg/other/field1.C @@ -22,4 +22,4 @@ template <> struct X { X(); }; -X i; // { dg-message "instantiated from" "" } +X i; // { dg-message "required from" "" } diff --git a/gcc/testsuite/g++.dg/other/offsetof5.C b/gcc/testsuite/g++.dg/other/offsetof5.C index 3c484338055..b53b06ffb52 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::j; // { dg-message "instantiated from here" } +int k = S::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 a04d2adf8f3..f84cc673e57 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 d; // { dg-message "instantiated" } +D d; // { dg-message "required" } template struct E diff --git a/gcc/testsuite/g++.dg/parse/constant4.C b/gcc/testsuite/g++.dg/parse/constant4.C index a1be5dd0260..626dd9e2e05 100644 --- a/gcc/testsuite/g++.dg/parse/constant4.C +++ b/gcc/testsuite/g++.dg/parse/constant4.C @@ -34,7 +34,7 @@ template struct X void Baz () { - Foo (); // { dg-message "instantiated" "" } + Foo (); // { dg-message "required" "" } } diff --git a/gcc/testsuite/g++.dg/parse/crash20.C b/gcc/testsuite/g++.dg/parse/crash20.C index d04869fa7af..b601408a581 100644 --- a/gcc/testsuite/g++.dg/parse/crash20.C +++ b/gcc/testsuite/g++.dg/parse/crash20.C @@ -11,4 +11,4 @@ template struct A typedef typename T::X Y; // { dg-error "not a class" "" } }; -A::Y y; // { dg-message "instantiated from here" "" } +A::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 0b75d079135..8d745c1a61d 100644 --- a/gcc/testsuite/g++.dg/parse/invalid-op1.C +++ b/gcc/testsuite/g++.dg/parse/invalid-op1.C @@ -11,4 +11,4 @@ template 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 4df2da7faf4..fee66d495a4 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 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 98209b2449c..4c2d2e7fb7b 100644 --- a/gcc/testsuite/g++.dg/parse/template18.C +++ b/gcc/testsuite/g++.dg/parse/template18.C @@ -49,4 +49,4 @@ template void f2() A::template B::template b2(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 f930d2e28ea..bf742ee9b8a 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(); // { dg-message "instantiated from here" } + template int foo(); // { dg-message "required from here" } } diff --git a/gcc/testsuite/g++.dg/tc1/dr166.C b/gcc/testsuite/g++.dg/tc1/dr166.C index 8c142906a56..7ca275ed92d 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 ) { M::B::x = 0; - M::f(0); // { dg-message "instantiated" } + M::f(0); // { dg-message "required" } } void g(void) @@ -47,7 +47,7 @@ namespace N { template <> void f(int ) { - N::f(0); // { dg-message "instantiated" } + N::f(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 2879ac4e79a..7f4d83050e2 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; // { dg-bogus "instantiated from here" "everything should be looked up at parsing time (after DR224)" } + template struct Derived; // { 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 b616ff9e11a..15438517be0 100644 --- a/gcc/testsuite/g++.dg/tc1/dr213.C +++ b/gcc/testsuite/g++.dg/tc1/dr213.C @@ -23,5 +23,5 @@ int main() { A 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 c9364a82399..73e2caaf03f 100644 --- a/gcc/testsuite/g++.dg/template/access11.C +++ b/gcc/testsuite/g++.dg/template/access11.C @@ -21,4 +21,4 @@ template struct X::Y { typename T::X x; // { dg-error "this context" } }; -template struct X::Y; // { dg-message "instantiated from here" } +template struct X::Y; // { dg-message "required from here" } diff --git a/gcc/testsuite/g++.dg/template/access2.C b/gcc/testsuite/g++.dg/template/access2.C index c5e3f110395..0b4657d1a8a 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 ab; // { dg-message "instantiated" } - ab.f(); // { dg-message "instantiated" } + A 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 c7a155e8ba6..ab56620772e 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 ab; // { dg-message "instantiated" } + A ab; // { dg-message "required" } } diff --git a/gcc/testsuite/g++.dg/template/access7.C b/gcc/testsuite/g++.dg/template/access7.C index 412ad00c0b7..bd38e4e0f4e 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 ()); // { dg-message "instantiated" } + f (S ()); // { dg-message "required" } } diff --git a/gcc/testsuite/g++.dg/template/arg7.C b/gcc/testsuite/g++.dg/template/arg7.C index a9333b26a21..dfd26bd2d97 100644 --- a/gcc/testsuite/g++.dg/template/arg7.C +++ b/gcc/testsuite/g++.dg/template/arg7.C @@ -8,4 +8,4 @@ template struct A B b; }; -A a; // { dg-message "instantiated" } +A a; // { dg-message "required" } diff --git a/gcc/testsuite/g++.dg/template/cond2.C b/gcc/testsuite/g++.dg/template/cond2.C index cf8df8cd9a7..fad86bebe51 100644 --- a/gcc/testsuite/g++.dg/template/cond2.C +++ b/gcc/testsuite/g++.dg/template/cond2.C @@ -6,5 +6,5 @@ template class c; template int test(c&); // { 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 0518666d1e5..917ddf09f10 100644 --- a/gcc/testsuite/g++.dg/template/crash13.C +++ b/gcc/testsuite/g++.dg/template/crash13.C @@ -15,4 +15,4 @@ template struct C X::Y; // { dg-error "not a base type" } }; -C c; // { dg-message "instantiated" } +C c; // { dg-message "required" } diff --git a/gcc/testsuite/g++.dg/template/crash40.C b/gcc/testsuite/g++.dg/template/crash40.C index 45123dd0d05..d720fe850cc 100644 --- a/gcc/testsuite/g++.dg/template/crash40.C +++ b/gcc/testsuite/g++.dg/template/crash40.C @@ -7,4 +7,4 @@ template void foo() T::~T(); // { dg-error "member" } } -template void foo(); // { dg-message "instantiated" } +template void foo(); // { dg-message "required" } diff --git a/gcc/testsuite/g++.dg/template/crash7.C b/gcc/testsuite/g++.dg/template/crash7.C index 7fda9a9ba19..88d3af86009 100644 --- a/gcc/testsuite/g++.dg/template/crash7.C +++ b/gcc/testsuite/g++.dg/template/crash7.C @@ -10,5 +10,5 @@ template struct A // { dg-message "A.void.::A.const A" } template A(typename A::X) {} // { dg-error "no type" } }; -A a; // { dg-error "instantiated|no match" } +A 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 f622aaa5e10..c42f85ce550 100644 --- a/gcc/testsuite/g++.dg/template/crash84.C +++ b/gcc/testsuite/g++.dg/template/crash84.C @@ -13,7 +13,7 @@ template struct a void foo () { - a v; // { dg-message "instantiated from here" } + a 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 6938b36b62f..047543cf85b 100644 --- a/gcc/testsuite/g++.dg/template/ctor5.C +++ b/gcc/testsuite/g++.dg/template/ctor5.C @@ -5,4 +5,4 @@ template struct A A() : T(0) {} // { dg-error "base" } }; -A a; // { dg-message "instantiated" } +A a; // { dg-message "required" } diff --git a/gcc/testsuite/g++.dg/template/defarg13.C b/gcc/testsuite/g++.dg/template/defarg13.C index ba2980bfaea..1d515343eb1 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 c; // { dg-message "instantiated" } +C c; // { dg-message "required" } diff --git a/gcc/testsuite/g++.dg/template/defarg14.C b/gcc/testsuite/g++.dg/template/defarg14.C index 1fe87e39dc7..352ccc41508 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::B::operator() should not be instantiated +// The default argument for A::B::operator() should not be required template struct A { diff --git a/gcc/testsuite/g++.dg/template/dtor7.C b/gcc/testsuite/g++.dg/template/dtor7.C index 186b561e9c3..a96332047fb 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 d2c049c8a06..9559b4eccc1 100644 --- a/gcc/testsuite/g++.dg/template/eh2.C +++ b/gcc/testsuite/g++.dg/template/eh2.C @@ -7,4 +7,4 @@ template struct A void foo() throw(typename T::X); // { dg-error "not a class" } }; -A a; // { dg-message "instantiated" } +A a; // { dg-message "required" } diff --git a/gcc/testsuite/g++.dg/template/error2.C b/gcc/testsuite/g++.dg/template/error2.C index 5bd9b870e7a..96f0bcae661 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 -// instantiated from did not indicate the nested class +// required from did not indicate the nested class template struct X { @@ -15,16 +15,16 @@ template struct X template struct Derived { - class Nested : public X // { dg-message "instantiated" "" } + class Nested : public X // { dg-message "required" "" } { }; - Nested m; // { dg-message "instantiated" "" } + Nested m; // { dg-message "required" "" } void Foo (); }; void Foo (Derived &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 876e0181a40..03f29d1f14a 100644 --- a/gcc/testsuite/g++.dg/template/error43.C +++ b/gcc/testsuite/g++.dg/template/error43.C @@ -6,4 +6,4 @@ template 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 81e6390d798..d5b78e05807 100644 --- a/gcc/testsuite/g++.dg/template/friend32.C +++ b/gcc/testsuite/g++.dg/template/friend32.C @@ -17,5 +17,5 @@ template class B int f () { - B b; // { dg-message "instantiated" } + B b; // { dg-message "required" } } diff --git a/gcc/testsuite/g++.dg/template/injected1.C b/gcc/testsuite/g++.dg/template/injected1.C index 81873b498f9..58b86569387 100644 --- a/gcc/testsuite/g++.dg/template/injected1.C +++ b/gcc/testsuite/g++.dg/template/injected1.C @@ -30,4 +30,4 @@ struct D4: Base, Base { typename D4::Base* p1; // { dg-error "" } typename D4::template Base* p2; }; -template struct D4; // { dg-message "instantiated" } +template struct D4; // { dg-message "required" } diff --git a/gcc/testsuite/g++.dg/template/instantiate1.C b/gcc/testsuite/g++.dg/template/instantiate1.C index 828f2e9c564..dd501684e63 100644 --- a/gcc/testsuite/g++.dg/template/instantiate1.C +++ b/gcc/testsuite/g++.dg/template/instantiate1.C @@ -9,11 +9,11 @@ template struct X { }; template struct Y { - X x; // { dg-message "instantiated" } + X x; // { dg-message "required" } }; template struct Z { // { dg-error "declaration" } - Y > y; // { dg-message "instantiated" } + Y > y; // { dg-message "required" } }; struct ZZ : Z diff --git a/gcc/testsuite/g++.dg/template/instantiate3.C b/gcc/testsuite/g++.dg/template/instantiate3.C index de3d3a084c9..0e9fd706015 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; // { dg-message "instantiated from here" } +template class ACE_Cleanup_Adapter; // { dg-message "required from here" } diff --git a/gcc/testsuite/g++.dg/template/instantiate5.C b/gcc/testsuite/g++.dg/template/instantiate5.C index e592c65d816..2198087abf9 100644 --- a/gcc/testsuite/g++.dg/template/instantiate5.C +++ b/gcc/testsuite/g++.dg/template/instantiate5.C @@ -22,4 +22,4 @@ template struct C // { dg-message "candidate" "candidate note" { target *-*-* } 21 } }; -C c; // { dg-message "instantiated" } +C c; // { dg-message "required" } diff --git a/gcc/testsuite/g++.dg/template/instantiate7.C b/gcc/testsuite/g++.dg/template/instantiate7.C index 2e54106ffdd..8ddbdb19ab8 100644 --- a/gcc/testsuite/g++.dg/template/instantiate7.C +++ b/gcc/testsuite/g++.dg/template/instantiate7.C @@ -7,4 +7,4 @@ template struct A template struct B; // { dg-error "reference to void" } }; -A a; // { dg-message "instantiated" } +A a; // { dg-message "required" } diff --git a/gcc/testsuite/g++.dg/template/local6.C b/gcc/testsuite/g++.dg/template/local6.C index 4a87177c9a1..777349a1953 100644 --- a/gcc/testsuite/g++.dg/template/local6.C +++ b/gcc/testsuite/g++.dg/template/local6.C @@ -16,5 +16,5 @@ void findIntersection( PCVector2& p0, PCVector2& p1); void findIntersection( PCVector2& p0, PCVector2& p1) { - PCVector2 e = p1 - p0; // { dg-message "instantiated" } + PCVector2 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 15ab352682f..de4e1d9899e 100644 --- a/gcc/testsuite/g++.dg/template/lookup2.C +++ b/gcc/testsuite/g++.dg/template/lookup2.C @@ -14,5 +14,5 @@ template void Bar () void Foo () { - Bar (); // { dg-message "instantiated" "" } + Bar (); // { dg-message "required" "" } } diff --git a/gcc/testsuite/g++.dg/template/member5.C b/gcc/testsuite/g++.dg/template/member5.C index ba6a9705bee..0cdd52aea89 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 c12ec4b5af2..a620c3b15ce 100644 --- a/gcc/testsuite/g++.dg/template/memfriend15.C +++ b/gcc/testsuite/g++.dg/template/memfriend15.C @@ -30,5 +30,5 @@ template void A::B2::f() int main() { A::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 2827ef3f7a1..1276970e344 100644 --- a/gcc/testsuite/g++.dg/template/memfriend16.C +++ b/gcc/testsuite/g++.dg/template/memfriend16.C @@ -30,5 +30,5 @@ template template void A::B2::f() int main() { A::B2 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 5e163fa477a..5f4b8e7b379 100644 --- a/gcc/testsuite/g++.dg/template/memfriend17.C +++ b/gcc/testsuite/g++.dg/template/memfriend17.C @@ -43,4 +43,4 @@ void A::B::func2(void) (void)F2::foo; } -template class A; // { dg-message "instantiated" } +template class A; // { dg-message "required" } diff --git a/gcc/testsuite/g++.dg/template/memfriend7.C b/gcc/testsuite/g++.dg/template/memfriend7.C index 1583646c0df..26ca6d8e9f0 100644 --- a/gcc/testsuite/g++.dg/template/memfriend7.C +++ b/gcc/testsuite/g++.dg/template/memfriend7.C @@ -116,18 +116,18 @@ template <> void A::j<0>() int main() { A a1; - a1.f(0); // { dg-message "instantiated" } - a1.g(); // { dg-message "instantiated" } - a1.g(); // { 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(); // { dg-message "required" } + a1.g(); // { dg-message "required" } + a1.h(); // { dg-message "required" } + a1.i('a'); // { dg-message "required" } + a1.j<1>(); // { dg-message "required" } A a2; a2.f(0); - a2.g(); // { dg-message "instantiated" } + a2.g(); // { dg-message "required" } a2.g(); 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 6fd024a2633..b1c4d424b8a 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 s; // { dg-message "instantiated" } +S s; // { dg-message "required" } diff --git a/gcc/testsuite/g++.dg/template/nested3.C b/gcc/testsuite/g++.dg/template/nested3.C index 5652e178a70..4544cc903b4 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 objB; // { dg-message "instantiated" } + B 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 41243649a11..99b00ccb8e5 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 struct D C c; // { dg-error "parsed as a non-type|if a type is meant" } }; -D d; // { dg-message "instantiated from here" } +D 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 a290ec337ea..b4bb41d109b 100644 --- a/gcc/testsuite/g++.dg/template/nontype12.C +++ b/gcc/testsuite/g++.dg/template/nontype12.C @@ -9,7 +9,7 @@ template struct A }; A a1; -A a2; // { dg-message "instantiated" } +A a2; // { dg-message "required" } template struct B { @@ -27,9 +27,9 @@ template struct C template int foo(); // { dg-error "double" } }; -template int baz(T) { C c; } // { dg-message "instantiated" } +template int baz(T) { C 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 6fffb8d8e53..4b3e862ba80 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 d; - d.tester (); // { dg-message "instantiated" } + d.tester (); // { dg-message "required" } } diff --git a/gcc/testsuite/g++.dg/template/nontype6.C b/gcc/testsuite/g++.dg/template/nontype6.C index 97b093ae551..b51474f83ea 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(void); // { dg-message "instantiated from here" } +template void func(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 1c3180f8331..86310d33b29 100644 --- a/gcc/testsuite/g++.dg/template/pr23510.C +++ b/gcc/testsuite/g++.dg/template/pr23510.C @@ -4,7 +4,7 @@ template struct Factorial { enum { nValue = nFactor * Factorial::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 47455b6583b..88e25050fda 100644 --- a/gcc/testsuite/g++.dg/template/pr35240.C +++ b/gcc/testsuite/g++.dg/template/pr35240.C @@ -8,5 +8,5 @@ template A 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 b52ff89174a..30556414f88 100644 --- a/gcc/testsuite/g++.dg/template/ptrmem15.C +++ b/gcc/testsuite/g++.dg/template/ptrmem15.C @@ -6,4 +6,4 @@ template struct A T A::* p; // { dg-error "void" } }; -A a; // { dg-message "instantiated" } +A a; // { dg-message "required" } diff --git a/gcc/testsuite/g++.dg/template/ptrmem6.C b/gcc/testsuite/g++.dg/template/ptrmem6.C index a355cfe8939..21475c63911 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 602be5bf154..c46a6a4de5d 100644 --- a/gcc/testsuite/g++.dg/template/qualified-id1.C +++ b/gcc/testsuite/g++.dg/template/qualified-id1.C @@ -23,5 +23,5 @@ template void foo() void bar() { - foo(); // { dg-message "instantiated" } + foo(); // { dg-message "required" } } diff --git a/gcc/testsuite/g++.dg/template/qualttp20.C b/gcc/testsuite/g++.dg/template/qualttp20.C index f42981b52b7..8073fe382f4 100644 --- a/gcc/testsuite/g++.dg/template/qualttp20.C +++ b/gcc/testsuite/g++.dg/template/qualttp20.C @@ -32,5 +32,5 @@ template struct B2 : T myconst b; }; -B1 b1; // { dg-message "instantiated" "" } +B1 b1; // { dg-message "required" "" } B2 b2; diff --git a/gcc/testsuite/g++.dg/template/qualttp3.C b/gcc/testsuite/g++.dg/template/qualttp3.C index 4b9ffe34ea6..61141b399fb 100644 --- a/gcc/testsuite/g++.dg/template/qualttp3.C +++ b/gcc/testsuite/g++.dg/template/qualttp3.C @@ -19,5 +19,5 @@ template struct C int main() { - C c; // { dg-message "instantiated" } + C c; // { dg-message "required" } } diff --git a/gcc/testsuite/g++.dg/template/qualttp4.C b/gcc/testsuite/g++.dg/template/qualttp4.C index c55ce2d3750..0f45c8c832e 100644 --- a/gcc/testsuite/g++.dg/template/qualttp4.C +++ b/gcc/testsuite/g++.dg/template/qualttp4.C @@ -20,5 +20,5 @@ template struct C int main() { - C c; // { dg-message "instantiated" } + C c; // { dg-message "required" } } diff --git a/gcc/testsuite/g++.dg/template/qualttp5.C b/gcc/testsuite/g++.dg/template/qualttp5.C index 8bca7f69660..8ac1952f9ab 100644 --- a/gcc/testsuite/g++.dg/template/qualttp5.C +++ b/gcc/testsuite/g++.dg/template/qualttp5.C @@ -16,11 +16,11 @@ template