2011-06-07 Jason Merrill <jason@redhat.com>
+ * 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 <rguenther@suse.de>
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. */
2011-06-07 Jason Merrill <jason@redhat.com>
+ 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.
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)
{
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"));
}
}
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;
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 ();
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
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);
- }
-
- /* 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;
}
"%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"
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
+2011-06-07 Jason Merrill <jason@redhat.com>
+
+ * 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 <nicola.pero@meta-innovation.com>
Iain Sandoe <iains@gcc.gnu.org>
typedef int X;
};
-template void f<S> (int); // { dg-message "instantiated" }
+template void f<S> (int); // { dg-message "required" }
typedef int X;
};
-template void f<S> (int); // { dg-message "instantiated" }
+template void f<S> (int); // { dg-message "required" }
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" }
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\]" } }
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()
struct A { };
template <class T>
-decltype(f(T())) f(T t)
+decltype(f(T())) f(T t) // { dg-error "depth" }
{
return f(t);
}
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" }
}
template<class F, int N>
decltype (ft<F> (F()))
-ft() {}
+ft() {} // { dg-error "depth" }
int main() {
ft<struct a*, 0>(); // { dg-error "no match" }
// 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" }
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
int main()
{
- f<A>(); // { dg-message "instantiated" }
+ f<A>(); // { dg-message "required" }
}
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" }
{
}
};
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);
}
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" }
}
}
{
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" }
}
}
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" }
}
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" }
}
void
bar ()
{
- foo<0> (); // { dg-message "instantiated from here" }
+ foo<0> (); // { dg-message "required from here" }
}
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" }
struct B;
-A<void (B::*)()> a; // { dg-message "instantiated" }
+A<void (B::*)()> a; // { dg-message "required" }
};
TPL<int> i;
-TPL<float> j; // { dg-message "instantiated" }
+TPL<float> j; // { dg-message "required" }
int main ()
{
Pool<int> pool;
- new (pool) A(); // { dg-message "instantiated" }
+ new (pool) A(); // { dg-message "required" }
return 0;
}
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" }
class Bar {
Foo<int> foo_;
public:
- Bar() {} // { dg-message "instantiated" }
+ Bar() {} // { dg-message "required" }
};
template class Foo<int>;
// { dg-error "using" "using" { target *-*-* } 8 }
};
-B<void> b; // { dg-message "instantiated" }
+B<void> b; // { dg-message "required" }
T (*a)[2]; // { dg-error "abstract class type" }
};
-template struct K<Abstract>; // { dg-message "instantiated" }
+template struct K<Abstract>; // { dg-message "required" }
void bar()
{
- foo(A<0>()); // { dg-message "instantiated from here" "" }
+ foo(A<0>()); // { dg-message "required from here" "" }
}
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" "" }
X();
};
-X<float> i; // { dg-message "instantiated from" "" }
+X<float> i; // { dg-message "required from" "" }
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" }
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
void Baz ()
{
- Foo<int> (); // { dg-message "instantiated" "" }
+ Foo<int> (); // { dg-message "required" "" }
}
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" "" }
};
};
-A<0>::B<0> a; // { dg-message "instantiated" }
+A<0>::B<0> a; // { dg-message "required" }
Bar<int> bar;
bar.baz ();
- bar.foo (); // { dg-message "instantiated" "" }
+ bar.foo (); // { dg-message "required" "" }
return 0;
}
A::template B<I>::template b2<double>(0);
}
-template void f2<0>(); // { dg-message "instantiated" }
+template void f2<0>(); // { dg-message "required" }
// { 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" }
}
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)
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" }
}
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)" }
}
{
A<B> ab;
B b;
- ab.h(b); // { dg-message "instantiated" }
+ ab.h(b); // { dg-message "required" }
}
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" }
int main()
{
- A<B> ab; // { dg-message "instantiated" }
- ab.f(); // { dg-message "instantiated" }
+ A<B> ab; // { dg-message "required" }
+ ab.f(); // { dg-message "required" }
}
int main()
{
- A<B> ab; // { dg-message "instantiated" }
+ A<B> ab; // { dg-message "required" }
}
}
void g () {
- f (S<int> ()); // { dg-message "instantiated" }
+ f (S<int> ()); // { dg-message "required" }
}
B<C> b;
};
-A<void> a; // { dg-message "instantiated" }
+A<void> a; // { dg-message "required" }
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" }
}
X::Y; // { dg-error "not a base type" }
};
-C<void> c; // { dg-message "instantiated" }
+C<void> c; // { dg-message "required" }
T::~T(); // { dg-error "member" }
}
-template void foo<A>(); // { dg-message "instantiated" }
+template void foo<A>(); // { dg-message "required" }
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" }
void
foo ()
{
- a<int> v; // { dg-message "instantiated from here" }
+ a<int> v; // { dg-message "required from here" }
}
A() : T(0) {} // { dg-error "base" }
};
-A<int*> a; // { dg-message "instantiated" }
+A<int*> a; // { dg-message "required" }
typename T::F f; // { dg-error "no type" }
};
-C<B, B> c; // { dg-message "instantiated" }
+C<B, B> c; // { dg-message "required" }
// 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 {
void
bar ()
{
- foo (B ()); // { dg-bogus "instantiated from here" "" { xfail *-*-* } }
+ foo (B ()); // { dg-bogus "required from here" "" { xfail *-*-* } }
}
void foo() throw(typename T::X); // { dg-error "not a class" }
};
-A<void> a; // { dg-message "instantiated" }
+A<void> a; // { dg-message "required" }
// 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
{
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" "" }
}
struct A {} a;
}
-template void foo<0>(); // { dg-message "instantiated" }
+template void foo<0>(); // { dg-message "required" }
int f ()
{
- B<int> b; // { dg-message "instantiated" }
+ B<int> b; // { dg-message "required" }
}
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" }
};
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>
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" }
// { dg-message "candidate" "candidate note" { target *-*-* } 21 }
};
-C<B> c; // { dg-message "instantiated" }
+C<B> c; // { dg-message "required" }
template<T&> struct B; // { dg-error "reference to void" }
};
-A<void> a; // { dg-message "instantiated" }
+A<void> a; // { dg-message "required" }
void findIntersection( PCVector2<double>& p0, PCVector2<double>& p1)
{
- PCVector2<double> e = p1 - p0; // { dg-message "instantiated" }
+ PCVector2<double> e = p1 - p0; // { dg-message "required" }
}
void Foo ()
{
- Bar<B> (); // { dg-message "instantiated" "" }
+ Bar<B> (); // { dg-message "required" "" }
}
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 }
}
int main()
{
A<int>::B2 b1;
- b1.f(); // { dg-message "instantiated" }
+ b1.f(); // { dg-message "required" }
}
int main()
{
A<int>::B2<int> b1;
- b1.f(); // { dg-message "instantiated" }
+ b1.f(); // { dg-message "required" }
}
(void)F2<T*>::foo;
}
-template class A<int>; // { dg-message "instantiated" }
+template class A<int>; // { dg-message "required" }
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>();
}
S() : S() {} // { dg-error "base" }
};
-S<int> s; // { dg-message "instantiated" }
+S<int> s; // { dg-message "required" }
int main() {
- B<char> objB; // { dg-message "instantiated" }
+ B<char> objB; // { dg-message "required" }
return 0;
}
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" }
};
A<char> a1;
-A<double> a2; // { dg-message "instantiated" }
+A<double> a2; // { dg-message "required" }
template<typename T> struct B
{
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" }
}
int main()
{
Dummy<int> d;
- d.tester<true> (); // { dg-message "instantiated" }
+ d.tester<true> (); // { dg-message "required" }
}
// { 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" }
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" }
void bar()
{
- foo<1>(); // { dg-message "instantiated" }
+ foo<1>(); // { dg-message "required" }
}
T A::* p; // { dg-error "void" }
};
-A<void> a; // { dg-message "instantiated" }
+A<void> a; // { dg-message "required" }
g(p); // { dg-error "conversion" }
}
-template void f(int S::* volatile *); // { dg-message "instantiated" }
+template void f(int S::* volatile *); // { dg-message "required" }
void bar()
{
- foo<A>(); // { dg-message "instantiated" }
+ foo<A>(); // { dg-message "required" }
}
myconst b;
};
-B1<AS> b1; // { dg-message "instantiated" "" }
+B1<AS> b1; // { dg-message "required" "" }
B2<AS> b2;
int main()
{
- C<A> c; // { dg-message "instantiated" }
+ C<A> c; // { dg-message "required" }
}
int main()
{
- C<A> c; // { dg-message "instantiated" }
+ C<A> c; // { dg-message "required" }
}
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" }
}
struct E {
};
-D<E> d; // { dg-message "instantiated" }
+D<E> d; // { dg-message "required" }
C<T::template B> c; // { dg-error "no class template" }
};
-D<int> d; // { dg-message "instantiated" }
+D<int> d; // { dg-message "required" }
template <class T> class B {}; // { dg-error "private" }
};
-D<E> d; // { dg-message "instantiated" }
+D<E> d; // { dg-message "required" }
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" }
}
};
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" }
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>;
A<t> a; // { dg-error "reference variable" }
};
-B<int&> b; // { dg-message "instantiated" }
+B<int&> b; // { dg-message "required" }
// 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 {};
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" }
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" }
// 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)
static const T i = 0; // { dg-error "declared void" "void" }
};
-A<void> a; // { dg-message "instantiated" }
+A<void> a; // { dg-message "required" }
void bar()
{
A<void> a;
- a.foo<int>(); // { dg-message "instantiated" }
+ a.foo<int>(); // { dg-message "required" }
}
mytype mem; // { dg-error "within this context" }
};
-B<int> b; // { dg-message "instantiated from here" }
+B<int> b; // { dg-message "required from here" }
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" }
int main()
{
C<int> c;
- c.f(); // { dg-message "instantiated" }
+ c.f(); // { dg-message "required" }
}
void foo (Bar<int> &bar)
{
- bar.foo(); // { dg-message "instantiated" }
+ bar.foo(); // { dg-message "required" }
}
void Bar ()
{
- Foo (1); // { dg-message "instantiated" }
+ Foo (1); // { dg-message "required" }
}
struct M {};
foo (27);
}
-template void bar<int> (int); // { dg-message "instantiated" }
+template void bar<int> (int); // { dg-message "required" }
foo (1 != (2 != 3));
}
-template void bar<int> (int, int, int); // { dg-message "instantiated" }
+template void bar<int> (int, int, int); // { dg-message "required" }
foo (6 >> (5 - 4));
}
-template void bar<int> (int, int, int); // { dg-message "instantiated" }
+template void bar<int> (int, int, int); // { dg-message "required" }
foo (1 || (2 && 3));
}
-template void bar<int> (int, int, int); // { dg-message "instantiated" }
+template void bar<int> (int, int, int); // { dg-message "required" }
foo (1 | (2 <= 3));
}
-template void bar<int> (int, int, int); // { dg-message "instantiated" }
+template void bar<int> (int, int, int); // { dg-message "required" }
foo (1 ^ (2 < 3));
}
-template void bar<int> (int, int, int); // { dg-message "instantiated" }
+template void bar<int> (int, int, int); // { dg-message "required" }
foo (1 & (2 != 3));
}
-template void bar<int> (int, int, int); // { dg-message "instantiated" }
+template void bar<int> (int, int, int); // { dg-message "required" }
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);
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" } */
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" "" }
__alignof__ (x++); // { dg-warning "no effect" "" }
}
-template void Foo<4> (X&); // { dg-message "instantiated" }
+template void Foo<4> (X&); // { dg-message "required" }
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" }
// { 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 "" } .*
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
};
int main() {
- GCD< 1, 0 >::val; // { dg-message "instantiated" }
+ GCD< 1, 0 >::val; // { dg-message "required" }
}
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;
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" }
}
void f ()
{
- Test<void> c; // { dg-message "instantiated" }
+ Test<void> c; // { dg-message "required" }
}
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 }
{
f<0>();
}
+
+// { dg-prune-output "note" }
class Y {
XX<int> x_;
};
-Y<Q::X> y; // { dg-error "" } instantiated from here
+Y<Q::X> y; // { dg-error "" } required from here
int main() {
moo_t<int> x;
- foo(x); // { dg-bogus "" "" { xfail *-*-* } } - instantiated from here -
+ foo(x); // { dg-bogus "" "" { xfail *-*-* } } - required from here -
}
{
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;
}
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
+2011-06-07 Jason Merrill <jason@redhat.com>
+
+ * testsuite/lib/prune.exp: s/required/instantiated/.
+ * testsuite/20_util/declval/requirements/1_neg.cc: Likewise.
+ * testsuite/20_util/duration/requirements/typedefs_neg1.cc: Likewise.
+ * testsuite/20_util/duration/requirements/typedefs_neg2.cc: Likewise.
+ * testsuite/20_util/duration/requirements/typedefs_neg3.cc: Likewise.
+ * testsuite/20_util/forward/1_neg.cc: Likewise.
+ * testsuite/20_util/make_signed/requirements/typedefs_neg.cc: Likewise.
+ * testsuite/20_util/make_unsigned/requirements/typedefs_neg.cc: Likewise.
+ * testsuite/20_util/ratio/cons/cons_overflow_neg.cc: Likewise.
+ * testsuite/20_util/ratio/operations/ops_overflow_neg.cc: Likewise.
+ * testsuite/20_util/shared_ptr/assign/shared_ptr_neg.cc: Likewise.
+ * testsuite/ext/ext_pointer/1_neg.cc: Likewise.
+ * testsuite/ext/pb_ds/example/hash_resize_neg.cc: Likewise.
+ * testsuite/ext/type_traits/add_unsigned_floating_neg.cc: Likewise.
+ * testsuite/ext/type_traits/add_unsigned_integer_neg.cc: Likewise.
+ * testsuite/ext/type_traits/remove_unsigned_floating_neg.cc: Likewise.
+ * testsuite/ext/type_traits/remove_unsigned_integer_neg.cc: Likewise.
+ * testsuite/tr1/2_general_utilities/shared_ptr/assign/shared_ptr_neg.cc: Likewise.
+
2011-06-07 Paolo Carlini <paolo.carlini@oracle.com>
* include/bits/move.h (struct __move_if_noexcept_cond): Add.
void test01()
{
- std::declval<int>(); // { dg-error "instantiated from here" }
+ std::declval<int>(); // { dg-error "required from here" }
}
}
// { dg-error "rep cannot be a duration" "" { target *-*-* } 226 }
-// { dg-error "instantiated from here" "" { target *-*-* } 31 }
+// { dg-error "required from here" "" { target *-*-* } 31 }
}
// { 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" }
}
// { dg-error "period must be positive" "" { target *-*-* } 229 }
-// { dg-error "instantiated from here" "" { target *-*-* } 33 }
+// { dg-error "required from here" "" { target *-*-* } 33 }
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 "" }
}
// { 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 }
}
// { 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 }
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 }
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 }
}
// { 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 }
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
// 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
// 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 }
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 }
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;
}
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 }
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;
}
# 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?
}
// { 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 }