commit d6f0884d94341406257c525185fbf8faf14cd390
Author: Jason Merrill <jason@redhat.com>
Date: Tue Jun 7 16:06:48 2011 -0400
* error.c (subst_to_string): New.
(cp_printer): Use it for 'S'.
(print_instantiation_partial_context_line): Handle subst context.
* pt.c (push_tinst_level): Handle subst context.
(deduction_tsubst_fntype): Don't track specific substitutions.
Use push_tinst_level.
@@ -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. */
@@ -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;
@@ -7490,16 +7490,15 @@ push_tinst_level (tree d)
if (tinst_depth >= max_tinst_depth)
{
- /* If the instantiation in question still has unbound template parms,
- we don't really care if we can't instantiate it, so just return.
- This happens with base instantiation for implicit `typename'. */
- if (uses_template_parms (d))
- return 0;
-
last_template_error_tick = tinst_level_tick;
- error ("template instantiation depth exceeds maximum of %d (use "
- "-ftemplate-depth= to increase the maximum) instantiating %qD",
- max_tinst_depth, d);
+ if (TREE_CODE (d) == TREE_LIST)
+ error ("template instantiation depth exceeds maximum of %d (use "
+ "-ftemplate-depth= to increase the maximum) substituting %qS",
+ max_tinst_depth, d);
+ else
+ error ("template instantiation depth exceeds maximum of %d (use "
+ "-ftemplate-depth= to increase the maximum) instantiating %qD",
+ max_tinst_depth, d);
print_instantiation_context ();
@@ -13594,11 +13593,6 @@ check_instantiated_args (tree tmpl, tree args, tsubst_flags_t complain)
return result;
}
-DEF_VEC_O (spec_entry);
-DEF_VEC_ALLOC_O (spec_entry,gc);
-static GTY(()) VEC(spec_entry,gc) *current_deduction_vec;
-static GTY((param_is (spec_entry))) htab_t current_deduction_htab;
-
/* In C++0x, it's possible to have a function template whose type depends
on itself recursively. This is most obvious with decltype, but can also
occur with enumeration scope (c++/48969). So we need to catch infinite
@@ -13609,133 +13603,48 @@ static GTY((param_is (spec_entry))) htab_t current_deduction_htab;
f<N-1> across all integers, and returns error_mark_node for all the
substitutions back up to the initial one.
- This is, of course, not reentrant.
-
- Use of a VEC here is O(n^2) in the depth of function template argument
- deduction substitution, but using a hash table creates a lot of constant
- overhead for the typical case of very low depth. So to make the typical
- case fast we start out with a VEC and switch to a hash table only if
- depth gets to be significant; in one metaprogramming testcase, even at
- depth 80 the overhead of the VEC relative to a hash table was only about
- 0.5% of compile time. */
+ This is, of course, not reentrant. */
static tree
deduction_tsubst_fntype (tree fn, tree targs)
{
static bool excessive_deduction_depth;
-
- unsigned i;
- spec_entry **slot;
- spec_entry *p;
- spec_entry elt;
- tree r;
- hashval_t hash;
+ static int deduction_depth;
+ location_t save_loc = input_location;
tree fntype = TREE_TYPE (fn);
+ tree tinst;
+ tree r;
- /* We don't need to worry about this in C++98. */
- if (cxx_dialect < cxx0x)
- {
- push_deduction_access_scope (fn);
- r = tsubst (fntype, targs, tf_none, NULL_TREE);
- pop_deduction_access_scope (fn);
- return r;
- }
-
- /* If we're seeing a lot of recursion, switch over to a hash table. The
- constant 40 is fairly arbitrary. */
- if (!current_deduction_htab
- && VEC_length (spec_entry, current_deduction_vec) > 40)
- {
- current_deduction_htab = htab_create_ggc (40*2, hash_specialization,
- eq_specializations, ggc_free);
- FOR_EACH_VEC_ELT (spec_entry, current_deduction_vec, i, p)
- {
- slot = (spec_entry **) htab_find_slot (current_deduction_htab,
- p, INSERT);
- *slot = ggc_alloc_spec_entry ();
- **slot = *p;
- }
- VEC_free (spec_entry, gc, current_deduction_vec);
- }
+ if (excessive_deduction_depth)
+ return error_mark_node;
- /* Now check everything in the vector, if any. */
- FOR_EACH_VEC_ELT (spec_entry, current_deduction_vec, i, p)
- if (p->tmpl == fn && comp_template_args (p->args, targs))
- {
- p->spec = error_mark_node;
- return error_mark_node;
- }
-
- elt.tmpl = fn;
- elt.args = targs;
- elt.spec = NULL_TREE;
-
- /* If we've created a hash table, look there. */
- if (current_deduction_htab)
- {
- if (htab_elements (current_deduction_htab)
- > (unsigned) max_tinst_depth)
- {
- /* Trying to recurse across all integers or some such. */
- excessive_deduction_depth = true;
- return error_mark_node;
- }
-
- hash = hash_specialization (&elt);
- slot = (spec_entry **)
- htab_find_slot_with_hash (current_deduction_htab, &elt, hash, INSERT);
- if (*slot)
- {
- /* We already have an entry for this. */
- (*slot)->spec = error_mark_node;
- return error_mark_node;
- }
- else
- {
- /* Create a new entry. */
- *slot = ggc_alloc_spec_entry ();
- **slot = elt;
- }
- }
- else
+ tinst = build_tree_list (fn, targs);
+ if (!push_tinst_level (tinst))
{
- /* No hash table, so add it to the VEC. */
- hash = 0;
- VEC_safe_push (spec_entry, gc, current_deduction_vec, &elt);
+ excessive_deduction_depth = true;
+ ggc_free (tinst);
+ return error_mark_node;
}
+ input_location = DECL_SOURCE_LOCATION (fn);
+ ++deduction_depth;
push_deduction_access_scope (fn);
r = tsubst (fntype, targs, tf_none, NULL_TREE);
pop_deduction_access_scope (fn);
+ --deduction_depth;
+ input_location = save_loc;
- /* After doing the substitution, make sure we didn't hit it again. Note
- that we might have switched to a hash table during tsubst. */
- if (current_deduction_htab)
- {
- if (hash == 0)
- hash = hash_specialization (&elt);
- slot = (spec_entry **)
- htab_find_slot_with_hash (current_deduction_htab, &elt, hash,
- NO_INSERT);
- if ((*slot)->spec == error_mark_node)
- r = error_mark_node;
- htab_clear_slot (current_deduction_htab, (void**)slot);
- }
- else
- {
- if (VEC_last (spec_entry, current_deduction_vec)->spec
- == error_mark_node)
- r = error_mark_node;
- VEC_pop (spec_entry, current_deduction_vec);
- }
if (excessive_deduction_depth)
{
r = error_mark_node;
- if (htab_elements (current_deduction_htab) == 0)
+ if (deduction_depth == 0)
/* Reset once we're all the way out. */
excessive_deduction_depth = false;
}
+
+ pop_tinst_level ();
+ ggc_free (tinst);
return r;
}
@@ -19562,11 +19471,6 @@ print_template_statistics (void)
"%f collisions\n", (long) htab_size (type_specializations),
(long) htab_elements (type_specializations),
htab_collisions (type_specializations));
- if (current_deduction_htab)
- fprintf (stderr, "current_deduction_htab: size %ld, %ld elements, "
- "%f collisions\n", (long) htab_size (current_deduction_htab),
- (long) htab_elements (current_deduction_htab),
- htab_collisions (current_deduction_htab));
}
#include "gt-cp-pt.h"
@@ -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
@@ -7,4 +7,4 @@ struct S {
typedef int X;
};
-template void f<S> (int); // { dg-message "instantiated" }
+template void f<S> (int); // { dg-message "required" }
@@ -8,4 +8,4 @@ struct S {
typedef int X;
};
-template void f<S> (int); // { dg-message "instantiated" }
+template void f<S> (int); // { dg-message "required" }
@@ -5,7 +5,7 @@ enum E { e = 3 };
template <int I> struct S {};
template <int I> void f (S<I + e + int (3.7)>) {} // { dg-warning "mangle" }
-template void f<7>(S<7 + e + int (3.7)>); // { dg-message "instantiated" }
+template void f<7>(S<7 + e + int (3.7)>); // { dg-message "required" }
template <int I> void g (S<I + e + int (3.7)>) {} // { dg-warning "mangle" }
-template void g<7>(S<7 + e + int (3.7)>); // { dg-message "instantiated" }
+template void g<7>(S<7 + e + int (3.7)>); // { dg-message "required" }
@@ -10,7 +10,7 @@
template <int I> void f(int (*)[2]) {} // { dg-warning "mangled name" }
template <int I> void g(int (*)[I+2]) {}
-template void f<1>(int (*)[2]); // { dg-message "instantiated" }
+template void f<1>(int (*)[2]); // { dg-message "required" }
// { dg-final { scan-assembler "\n_?_Z1fILi1EEvPALi2E_i\[: \t\n\]" } }
template void g<1>(int (*)[3]);
// { dg-final { scan-assembler "\n_?_Z1gILi1EEvPAplT_Li2E_i\[: \t\n\]" } }
@@ -23,7 +23,7 @@ template struct T<int>; /* T<int> is instantiated here */
template int f<int>();
#pragma pack(4)
-template struct T<float>; /* T<float> is instantiated here */
+template struct T<float>; /* T<float> is required here */
template int f<double>();
int main()
@@ -3,7 +3,7 @@
struct A { };
template <class T>
-decltype(f(T())) f(T t)
+decltype(f(T())) f(T t) // { dg-error "depth" }
{
return f(t);
}
@@ -9,8 +9,8 @@ void ft (F f, typename enable_if<N!=0, int>::type) {}
template< class F, int N >
decltype(ft<F, N-1> (F(), 0))
-ft (F f, typename enable_if<N==0, int>::type) {}
+ft (F f, typename enable_if<N==0, int>::type) {} // { dg-error "depth" }
int main() {
- ft<struct a*, 2> (0, 0);
+ ft<struct a*, 2> (0, 0); // { dg-message "from here" }
}
@@ -10,7 +10,7 @@ ft() {}
template<class F, int N>
decltype (ft<F> (F()))
-ft() {}
+ft() {} // { dg-error "depth" }
int main() {
ft<struct a*, 0>(); // { dg-error "no match" }
@@ -1,10 +1,14 @@
// PR c++/48969
-// { dg-options -std=c++0x }
+// { dg-options "-std=c++0x -ftemplate-depth=10" }
template<unsigned int N> struct Pair { };
struct Foo { enum { Mask = 1 }; } foo;
template<typename A, typename B> class Pair<A::Mask | B::Mask>
-operator|(const A &, const B &)
+operator|(const A &, const B &) // { dg-message "substitution" }
{ }
-Pair<Foo::Mask> f = foo|foo;
+Pair<Foo::Mask> f = foo|foo; // { dg-message "no match" }
+
+// { dg-prune-output "note" }
+// { dg-prune-output "here" }
+// { dg-prune-output "instantiation depth" }
@@ -15,7 +15,7 @@ template<typename T> struct S2
enum E : int; // { dg-error "previous definition" }
enum E : T; // { dg-error "different underlying type" }
};
-template struct S2<short>; // { dg-message "instantiated from here" }
+template struct S2<short>; // { dg-message "required from here" }
//This error is diagnosed at compilation time
template<typename T> struct S3
@@ -15,5 +15,5 @@ void f()
int main()
{
- f<A>(); // { dg-message "instantiated" }
+ f<A>(); // { dg-message "required" }
}
@@ -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);
}
@@ -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" }
}
}
@@ -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" }
}
}
@@ -34,8 +34,8 @@ f3 (void)
int
main (void)
{
- f1 <int> (); // { dg-message "instantiated from here" }
+ f1 <int> (); // { dg-message "required from here" }
f2 <int> ();
f3 <const char *> ();
- f3 <void *> (); // { dg-message "instantiated from here" }
+ f3 <void *> (); // { dg-message "required from here" }
}
@@ -43,8 +43,8 @@ f4 ()
void
bar ()
{
- f1<0> (); // { dg-message "instantiated from here" }
- f2<1> (); // { dg-message "instantiated from here" }
- f3<int> (); // { dg-message "instantiated from here" }
- f4<int> (); // { dg-message "instantiated from here" }
+ f1<0> (); // { dg-message "required from here" }
+ f2<1> (); // { dg-message "required from here" }
+ f3<int> (); // { dg-message "required from here" }
+ f4<int> (); // { dg-message "required from here" }
}
@@ -13,5 +13,5 @@ foo ()
void
bar ()
{
- foo<0> (); // { dg-message "instantiated from here" }
+ foo<0> (); // { dg-message "required from here" }
}
@@ -17,4 +17,4 @@ void S<T>::test()
template struct S<int>;
template struct S<long>;
-template struct S<float>; // { dg-message "instantiated from here" }
+template struct S<float>; // { dg-message "required from here" }
@@ -5,4 +5,4 @@ template<typename T> struct A : T {}; // { dg-error "struct or class type" }
struct B;
-A<void (B::*)()> a; // { dg-message "instantiated" }
+A<void (B::*)()> a; // { dg-message "required" }
@@ -12,4 +12,4 @@ template <typename T> struct TPL : A
};
TPL<int> i;
-TPL<float> j; // { dg-message "instantiated" }
+TPL<float> j; // { dg-message "required" }
@@ -27,6 +27,6 @@ void operator delete(void *p,Pool<T>& pool)
int main ()
{
Pool<int> pool;
- new (pool) A(); // { dg-message "instantiated" }
+ new (pool) A(); // { dg-message "required" }
return 0;
}
@@ -9,5 +9,5 @@ T f()
T a = T(); // { dg-error "value-initialization of reference" }
}
-int &a = f<int&>(); // { dg-message "instantiated from here" }
+int &a = f<int&>(); // { dg-message "required from here" }
@@ -10,7 +10,7 @@ public:
class Bar {
Foo<int> foo_;
public:
- Bar() {} // { dg-message "instantiated" }
+ Bar() {} // { dg-message "required" }
};
template class Foo<int>;
@@ -9,4 +9,4 @@ template <typename T> struct B : A<T> // { dg-error "incomplete" }
// { dg-error "using" "using" { target *-*-* } 8 }
};
-B<void> b; // { dg-message "instantiated" }
+B<void> b; // { dg-message "required" }
@@ -35,7 +35,7 @@ template <class T> struct K {
T (*a)[2]; // { dg-error "abstract class type" }
};
-template struct K<Abstract>; // { dg-message "instantiated" }
+template struct K<Abstract>; // { dg-message "required" }
@@ -10,6 +10,6 @@ void foo(const A<N> &a)
void bar()
{
- foo(A<0>()); // { dg-message "instantiated from here" "" }
+ foo(A<0>()); // { dg-message "required from here" "" }
}
@@ -10,4 +10,4 @@ template <typename T> struct S2 : S<T> {
using S<T>::operator typename S<T>::I*; // { dg-error "operator S\\<int\\>" "" }
};
-template struct S2<int>; // { dg-message "instantiated" "" }
+template struct S2<int>; // { dg-message "required" "" }
@@ -22,4 +22,4 @@ template <> struct X<int> {
X();
};
-X<float> i; // { dg-message "instantiated from" "" }
+X<float> i; // { dg-message "required from" "" }
@@ -19,4 +19,4 @@ struct S
static const int j = offsetof (S, i); // { dg-warning "invalid access|offsetof" }
};
-int k = S<int>::j; // { dg-message "instantiated from here" }
+int k = S<int>::j; // { dg-message "required from here" }
@@ -22,7 +22,7 @@ struct D
T t : 3; // { dg-error "non-integral type" }
};
-D<double> d; // { dg-message "instantiated" }
+D<double> d; // { dg-message "required" }
template <typename T>
struct E
@@ -34,7 +34,7 @@ template <typename> struct X
void Baz ()
{
- Foo<int> (); // { dg-message "instantiated" "" }
+ Foo<int> (); // { dg-message "required" "" }
}
@@ -11,4 +11,4 @@ template<typename T> struct A
typedef typename T::X Y; // { dg-error "not a class" "" }
};
-A<int>::Y y; // { dg-message "instantiated from here" "" }
+A<int>::Y y; // { dg-message "required from here" "" }
@@ -11,4 +11,4 @@ template <int I> struct A
};
};
-A<0>::B<0> a; // { dg-message "instantiated" }
+A<0>::B<0> a; // { dg-message "required" }
@@ -31,7 +31,7 @@ int main()
Bar<int> bar;
bar.baz ();
- bar.foo (); // { dg-message "instantiated" "" }
+ bar.foo (); // { dg-message "required" "" }
return 0;
}
@@ -49,4 +49,4 @@ template<int I> void f2()
A::template B<I>::template b2<double>(0);
}
-template void f2<0>(); // { dg-message "instantiated" }
+template void f2<0>(); // { dg-message "required" }
@@ -34,5 +34,5 @@ namespace N2 {
// { dg-message "candidate" "candidate note" { target *-*-* } 33 }
}
- template int foo<float>(); // { dg-message "instantiated from here" }
+ template int foo<float>(); // { dg-message "required from here" }
}
@@ -32,7 +32,7 @@ namespace N {
template <> void f<double>(double )
{
M::B::x = 0;
- M::f<long>(0); // { dg-message "instantiated" }
+ M::f<long>(0); // { dg-message "required" }
}
void g(void)
@@ -47,7 +47,7 @@ namespace N {
template <> void f<int>(int )
{
- N::f<long>(0); // { dg-message "instantiated" }
+ N::f<long>(0); // { dg-message "required" }
M::A::x = 0;
M::B::x = 0; // { dg-error "within this context" }
}
@@ -15,7 +15,7 @@ namespace N1 {
typename Derived::Base* p3; // { dg-bogus "" "injected class name in derived classes" }
};
- template struct Derived<void>; // { dg-bogus "instantiated from here" "everything should be looked up at parsing time (after DR224)" }
+ template struct Derived<void>; // { dg-bogus "required from here" "everything should be looked up at parsing time (after DR224)" }
}
@@ -23,5 +23,5 @@ int main()
{
A<B> ab;
B b;
- ab.h(b); // { dg-message "instantiated" }
+ ab.h(b); // { dg-message "required" }
}
@@ -21,4 +21,4 @@ template <typename T> struct X::Y {
typename T::X x; // { dg-error "this context" }
};
-template struct X::Y<A>; // { dg-message "instantiated from here" }
+template struct X::Y<A>; // { dg-message "required from here" }
@@ -15,6 +15,6 @@ class B {
int main()
{
- A<B> ab; // { dg-message "instantiated" }
- ab.f(); // { dg-message "instantiated" }
+ A<B> ab; // { dg-message "required" }
+ ab.f(); // { dg-message "required" }
}
@@ -13,5 +13,5 @@ class B {
int main()
{
- A<B> ab; // { dg-message "instantiated" }
+ A<B> ab; // { dg-message "required" }
}
@@ -14,5 +14,5 @@ typename A::T* f (A) { // { dg-error "this context" }
}
void g () {
- f (S<int> ()); // { dg-message "instantiated" }
+ f (S<int> ()); // { dg-message "required" }
}
@@ -8,4 +8,4 @@ template<typename T> struct A
B<C> b;
};
-A<void> a; // { dg-message "instantiated" }
+A<void> a; // { dg-message "required" }
@@ -6,5 +6,5 @@ template<int X> class c;
template<int X, int Y> int test(c<X ? : Y>&); // { dg-error "omitted" }
void test(c<2>*c2) {
- test<0, 2>(*c2); // { dg-message "instantiated" }
+ test<0, 2>(*c2); // { dg-message "required" }
}
@@ -15,4 +15,4 @@ template <typename T> struct C
X::Y; // { dg-error "not a base type" }
};
-C<void> c; // { dg-message "instantiated" }
+C<void> c; // { dg-message "required" }
@@ -7,4 +7,4 @@ template<typename T> void foo()
T::~T(); // { dg-error "member" }
}
-template void foo<A>(); // { dg-message "instantiated" }
+template void foo<A>(); // { dg-message "required" }
@@ -10,5 +10,5 @@ template <typename> struct A // { dg-message "A.void.::A.const A" }
template <typename> A(typename A::X) {} // { dg-error "no type" }
};
-A<void> a; // { dg-error "instantiated|no match" }
+A<void> a; // { dg-error "required|no match" }
// { dg-prune-output "note" }
@@ -13,7 +13,7 @@ template<typename T> struct a
void
foo ()
{
- a<int> v; // { dg-message "instantiated from here" }
+ a<int> v; // { dg-message "required from here" }
}
@@ -5,4 +5,4 @@ template<typename T> struct A
A() : T(0) {} // { dg-error "base" }
};
-A<int*> a; // { dg-message "instantiated" }
+A<int*> a; // { dg-message "required" }
@@ -16,4 +16,4 @@ struct C
typename T::F f; // { dg-error "no type" }
};
-C<B, B> c; // { dg-message "instantiated" }
+C<B, B> c; // { dg-message "required" }
@@ -1,5 +1,5 @@
// PR c++/46129
-// The default argument for A<int>::B::operator() should not be instantiated
+// The default argument for A<int>::B::operator() should not be required
template <class T>
struct A {
@@ -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 *-*-* } }
}
@@ -7,4 +7,4 @@ template<typename T> struct A
void foo() throw(typename T::X); // { dg-error "not a class" }
};
-A<void> a; // { dg-message "instantiated" }
+A<void> a; // { dg-message "required" }
@@ -3,7 +3,7 @@
// Copyright (C) 2003 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 14 Aug 2003 <nathan@codesourcery.com>
-// instantiated from did not indicate the nested class
+// required from did not indicate the nested class
template<class T> struct X
{
@@ -15,16 +15,16 @@ template<class T> struct X
template<class T >
struct Derived
{
- class Nested : public X<T> // { dg-message "instantiated" "" }
+ class Nested : public X<T> // { dg-message "required" "" }
{
};
- Nested m; // { dg-message "instantiated" "" }
+ Nested m; // { dg-message "required" "" }
void Foo ();
};
void Foo (Derived<void> &x)
{
- x.Foo (); // { dg-message "instantiated" "" }
+ x.Foo (); // { dg-message "required" "" }
}
@@ -6,4 +6,4 @@ template<int> void foo()
struct A {} a;
}
-template void foo<0>(); // { dg-message "instantiated" }
+template void foo<0>(); // { dg-message "required" }
@@ -17,5 +17,5 @@ template<class T> class B
int f ()
{
- B<int> b; // { dg-message "instantiated" }
+ B<int> b; // { dg-message "required" }
}
@@ -30,4 +30,4 @@ struct D4: Base<T>, Base<T*> {
typename D4::Base* p1; // { dg-error "" }
typename D4::template Base<double>* p2;
};
-template struct D4<void>; // { dg-message "instantiated" }
+template struct D4<void>; // { dg-message "required" }
@@ -9,11 +9,11 @@ template <class T> struct X {
};
template <class T> struct Y {
- X<T> x; // { dg-message "instantiated" }
+ X<T> x; // { dg-message "required" }
};
template <class T> struct Z { // { dg-error "declaration" }
- Y<Z<T> > y; // { dg-message "instantiated" }
+ Y<Z<T> > y; // { dg-message "required" }
};
struct ZZ : Z<int>
@@ -14,4 +14,4 @@ struct ACE_Cleanup_Adapter
TYPE object_; // { dg-error "incomplete type" }
};
-template class ACE_Cleanup_Adapter<ACE_Null_Mutex>; // { dg-message "instantiated from here" }
+template class ACE_Cleanup_Adapter<ACE_Null_Mutex>; // { dg-message "required from here" }
@@ -22,4 +22,4 @@ template <typename T> struct C
// { dg-message "candidate" "candidate note" { target *-*-* } 21 }
};
-C<B> c; // { dg-message "instantiated" }
+C<B> c; // { dg-message "required" }
@@ -7,4 +7,4 @@ template<typename T> struct A
template<T&> struct B; // { dg-error "reference to void" }
};
-A<void> a; // { dg-message "instantiated" }
+A<void> a; // { dg-message "required" }
@@ -16,5 +16,5 @@ void findIntersection( PCVector2<double>& p0, PCVector2<double>& p1);
void findIntersection( PCVector2<double>& p0, PCVector2<double>& p1)
{
- PCVector2<double> e = p1 - p0; // { dg-message "instantiated" }
+ PCVector2<double> e = p1 - p0; // { dg-message "required" }
}
@@ -14,5 +14,5 @@ template <typename T> void Bar ()
void Foo ()
{
- Bar<B> (); // { dg-message "instantiated" "" }
+ Bar<B> (); // { dg-message "required" "" }
}
@@ -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 }
}
@@ -30,5 +30,5 @@ template<class T> void A<T>::B2::f()
int main()
{
A<int>::B2 b1;
- b1.f(); // { dg-message "instantiated" }
+ b1.f(); // { dg-message "required" }
}
@@ -30,5 +30,5 @@ template<class T> template <class U> void A<T>::B2<U>::f()
int main()
{
A<int>::B2<int> b1;
- b1.f(); // { dg-message "instantiated" }
+ b1.f(); // { dg-message "required" }
}
@@ -43,4 +43,4 @@ void A<T>::B::func2(void)
(void)F2<T*>::foo;
}
-template class A<int>; // { dg-message "instantiated" }
+template class A<int>; // { dg-message "required" }
@@ -116,18 +116,18 @@ template <> void A<char>::j<0>()
int main()
{
A<int *> a1;
- a1.f(0); // { dg-message "instantiated" }
- a1.g<char>(); // { dg-message "instantiated" }
- a1.g<int>(); // { dg-message "instantiated" }
- a1.h(); // { dg-message "instantiated" }
- a1.i('a'); // { dg-message "instantiated" }
- a1.j<1>(); // { dg-message "instantiated" }
+ a1.f(0); // { dg-message "required" }
+ a1.g<char>(); // { dg-message "required" }
+ a1.g<int>(); // { dg-message "required" }
+ a1.h(); // { dg-message "required" }
+ a1.i('a'); // { dg-message "required" }
+ a1.j<1>(); // { dg-message "required" }
A<char> a2;
a2.f(0);
- a2.g<char>(); // { dg-message "instantiated" }
+ a2.g<char>(); // { dg-message "required" }
a2.g<int>();
a2.h();
a2.i('a');
- a2.j<1>(); // { dg-message "instantiated" }
+ a2.j<1>(); // { dg-message "required" }
a2.j<0>();
}
@@ -5,4 +5,4 @@ struct S
S() : S() {} // { dg-error "base" }
};
-S<int> s; // { dg-message "instantiated" }
+S<int> s; // { dg-message "required" }
@@ -24,7 +24,7 @@ class B {
int main() {
- B<char> objB; // { dg-message "instantiated" }
+ B<char> objB; // { dg-message "required" }
return 0;
}
@@ -9,4 +9,4 @@ template <typename T> struct D
C<T::X> c; // { dg-error "parsed as a non-type|if a type is meant" }
};
-D<B> d; // { dg-message "instantiated from here" }
+D<B> d; // { dg-message "required from here" }
@@ -9,7 +9,7 @@ template<typename T> struct A
};
A<char> a1;
-A<double> a2; // { dg-message "instantiated" }
+A<double> a2; // { dg-message "required" }
template<typename T> struct B
{
@@ -27,9 +27,9 @@ template<typename T> struct C
template<T> int foo(); // { dg-error "double" }
};
-template<typename T> int baz(T) { C<T> c; } // { dg-message "instantiated" }
+template<typename T> int baz(T) { C<T> c; } // { dg-message "required" }
void foobar()
{
- baz(1.2); // { dg-message "instantiated" }
+ baz(1.2); // { dg-message "required" }
}
@@ -24,6 +24,6 @@ struct Dummy
int main()
{
Dummy<int> d;
- d.tester<true> (); // { dg-message "instantiated" }
+ d.tester<true> (); // { dg-message "required" }
}
@@ -16,4 +16,4 @@ void func(void)
// { dg-message "if a type" "note" { target *-*-* } 15 }
}
-template void func<float>(void); // { dg-message "instantiated from here" }
+template void func<float>(void); // { dg-message "required from here" }
@@ -4,7 +4,7 @@ template<unsigned int nFactor>
struct Factorial
{
enum { nValue = nFactor * Factorial<nFactor - 1>::nValue }; // { dg-error "depth exceeds maximum" }
- // { dg-message "recursively instantiated" "" { target *-*-* } 6 }
+ // { dg-message "recursively required" "" { target *-*-* } 6 }
// { dg-error "incomplete type" "" { target *-*-* } 6 }
} // { dg-error "expected ';' after" }
@@ -8,5 +8,5 @@ template<int N> A<sizeof(new int[N][N])> foo(); // { dg-message "unimplemented"
void bar()
{
- foo<1>(); // { dg-message "instantiated" }
+ foo<1>(); // { dg-message "required" }
}
@@ -6,4 +6,4 @@ template<typename T> struct A
T A::* p; // { dg-error "void" }
};
-A<void> a; // { dg-message "instantiated" }
+A<void> a; // { dg-message "required" }
@@ -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" }
@@ -23,5 +23,5 @@ template <typename T> void foo()
void bar()
{
- foo<A>(); // { dg-message "instantiated" }
+ foo<A>(); // { dg-message "required" }
}
@@ -32,5 +32,5 @@ template <typename T> struct B2 : T
myconst b;
};
-B1<AS> b1; // { dg-message "instantiated" "" }
+B1<AS> b1; // { dg-message "required" "" }
B2<AS> b2;
@@ -19,5 +19,5 @@ template <class T> struct C
int main()
{
- C<A> c; // { dg-message "instantiated" }
+ C<A> c; // { dg-message "required" }
}
@@ -20,5 +20,5 @@ template <class T> struct C
int main()
{
- C<A> c; // { dg-message "instantiated" }
+ C<A> c; // { dg-message "required" }
}
@@ -16,11 +16,11 @@ template <template <class> class TT> void f()
template <class T> struct C
{
- void g() { f<A<T>::template B>(); } // { dg-message "instantiated" }
+ void g() { f<A<T>::template B>(); } // { dg-message "required" }
};
int main()
{
C<int> c;
- c.g(); // { dg-message "instantiated" }
+ c.g(); // { dg-message "required" }
}
@@ -12,4 +12,4 @@ template <class T> struct D {
struct E {
};
-D<E> d; // { dg-message "instantiated" }
+D<E> d; // { dg-message "required" }
@@ -9,4 +9,4 @@ template <class T> struct D {
C<T::template B> c; // { dg-error "no class template" }
};
-D<int> d; // { dg-message "instantiated" }
+D<int> d; // { dg-message "required" }
@@ -14,4 +14,4 @@ struct E {
template <class T> class B {}; // { dg-error "private" }
};
-D<E> d; // { dg-message "instantiated" }
+D<E> d; // { dg-message "required" }
@@ -8,7 +8,7 @@ template <int I> struct F
F<I+1> f; // { dg-error "incomplete type" "incomplete" }
// { dg-bogus "exceeds maximum.*exceeds maximum" "exceeds" { xfail *-*-* } 8 }
// { dg-error "exceeds maximum" "exceeds" { xfail *-*-* } 8 }
- return f()*I; // { dg-message "recursively instantiated" "recurse" }
+ return f()*I; // { dg-message "recursively" "recurse" }
}
};
@@ -20,8 +20,8 @@ template <> struct F<52>
int main ()
{
F<1> f;
- return f(); // { dg-message "instantiated from here" "excessive recursion" }
+ return f(); // { dg-message "from here" "excessive recursion" }
}
// Ignore excess messages from recursion.
-// { dg-prune-output "instantiated from 'int" }
+// { dg-prune-output "from 'int" }
@@ -3,6 +3,6 @@
template <int N> struct X {
static const int value = X<N-1>::value; // { dg-error "instantiation|incomplete" }
- // { dg-message "recursively instantiated" "" { target *-*-* } 5 }
+ // { dg-message "recursively required" "" { target *-*-* } 5 }
};
template struct X<1000>;
@@ -8,4 +8,4 @@ template<typename T> struct B
A<t> a; // { dg-error "reference variable" }
};
-B<int&> b; // { dg-message "instantiated" }
+B<int&> b; // { dg-message "required" }
@@ -3,7 +3,7 @@
// Copyright (C) 2003 Free Software Foundation, Inc.
// Contributed by Nathan Sidwell 15 Aug 2003 <nathan@codesourcery.com>
-// checked instantiated bases in wrong scope.
+// checked required bases in wrong scope.
class Helper {};
@@ -169,13 +169,13 @@ STATIC_ASSERT((has_postdecrement<X>::value));
STATIC_ASSERT((!has_postdecrement<Y>::value));
// Check for private members
-STATIC_ASSERT((has_unary_plus<Z>::value)); // { dg-message "instantiated from here" }
-STATIC_ASSERT((is_negatable<Z>::value)); // { dg-message "instantiated from here" }
-STATIC_ASSERT((is_dereferenceable<Z>::value)); // { dg-message "instantiated from here" }
-STATIC_ASSERT((has_bitwise_not<Z>::value)); // { dg-message "instantiated from here" }
-STATIC_ASSERT((has_truth_not<Z>::value)); // { dg-message "instantiated from here" }
-STATIC_ASSERT((has_preincrement<Z>::value)); // { dg-message "instantiated from here" }
-STATIC_ASSERT((has_predecrement<Z>::value)); // { dg-message "instantiated from here" }
-STATIC_ASSERT((has_postincrement<Z>::value)); // { dg-message "instantiated from here" }
-STATIC_ASSERT((has_postdecrement<Z>::value)); // { dg-message "instantiated from here" }
+STATIC_ASSERT((has_unary_plus<Z>::value)); // { dg-message "required from here" }
+STATIC_ASSERT((is_negatable<Z>::value)); // { dg-message "required from here" }
+STATIC_ASSERT((is_dereferenceable<Z>::value)); // { dg-message "required from here" }
+STATIC_ASSERT((has_bitwise_not<Z>::value)); // { dg-message "required from here" }
+STATIC_ASSERT((has_truth_not<Z>::value)); // { dg-message "required from here" }
+STATIC_ASSERT((has_preincrement<Z>::value)); // { dg-message "required from here" }
+STATIC_ASSERT((has_predecrement<Z>::value)); // { dg-message "required from here" }
+STATIC_ASSERT((has_postincrement<Z>::value)); // { dg-message "required from here" }
+STATIC_ASSERT((has_postdecrement<Z>::value)); // { dg-message "required from here" }
@@ -14,4 +14,4 @@ template<typename> struct B
template<typename T> B(T, Y);
};
-B<int> b(0,0); // { dg-message "instantiated from here" }
+B<int> b(0,0); // { dg-message "required from here" }
@@ -1,5 +1,5 @@
// The call to f is not potentially evaluated (3.2), so f<int> is not used,
-// so it should not be instantiated.
+// so it should not be required.
template <class T>
T f (T)
@@ -5,4 +5,4 @@ template<typename T> struct A
static const T i = 0; // { dg-error "declared void" "void" }
};
-A<void> a; // { dg-message "instantiated" }
+A<void> a; // { dg-message "required" }
@@ -18,5 +18,5 @@ template<> struct A<void>
void bar()
{
A<void> a;
- a.foo<int>(); // { dg-message "instantiated" }
+ a.foo<int>(); // { dg-message "required" }
}
@@ -12,5 +12,5 @@ template <class T> class B : public A
mytype mem; // { dg-error "within this context" }
};
-B<int> b; // { dg-message "instantiated from here" }
+B<int> b; // { dg-message "required from here" }
@@ -1,3 +1,3 @@
struct B { template <typename U> struct C; };
template <typename T> struct A { typedef typename T::C V; }; // { dg-error "not a type" }
-void f () { A<B>::V p; } // { dg-message "instantiated" }
+void f () { A<B>::V p; } // { dg-message "required" }
@@ -17,5 +17,5 @@ template <class T> struct C : public B1<T>, public B2
int main()
{
C<int> c;
- c.f(); // { dg-message "instantiated" }
+ c.f(); // { dg-message "required" }
}
@@ -25,6 +25,6 @@ struct Bar : public Foo<T>, Baz {
void foo (Bar<int> &bar)
{
- bar.foo(); // { dg-message "instantiated" }
+ bar.foo(); // { dg-message "required" }
}
@@ -17,7 +17,7 @@ template <class T> void Foo(T i)
void Bar ()
{
- Foo (1); // { dg-message "instantiated" }
+ Foo (1); // { dg-message "required" }
}
struct M {};
@@ -66,4 +66,4 @@ bar (T)
foo (27);
}
-template void bar<int> (int); // { dg-message "instantiated" }
+template void bar<int> (int); // { dg-message "required" }
@@ -65,4 +65,4 @@ bar (T a, T b, T c)
foo (1 != (2 != 3));
}
-template void bar<int> (int, int, int); // { dg-message "instantiated" }
+template void bar<int> (int, int, int); // { dg-message "required" }
@@ -83,4 +83,4 @@ bar (T a, T b, T c)
foo (6 >> (5 - 4));
}
-template void bar<int> (int, int, int); // { dg-message "instantiated" }
+template void bar<int> (int, int, int); // { dg-message "required" }
@@ -29,4 +29,4 @@ bar (T a, T b, T c)
foo (1 || (2 && 3));
}
-template void bar<int> (int, int, int); // { dg-message "instantiated" }
+template void bar<int> (int, int, int); // { dg-message "required" }
@@ -119,4 +119,4 @@ bar (T a, T b, T c)
foo (1 | (2 <= 3));
}
-template void bar<int> (int, int, int); // { dg-message "instantiated" }
+template void bar<int> (int, int, int); // { dg-message "required" }
@@ -119,4 +119,4 @@ bar (T a, T b, T c)
foo (1 ^ (2 < 3));
}
-template void bar<int> (int, int, int); // { dg-message "instantiated" }
+template void bar<int> (int, int, int); // { dg-message "required" }
@@ -101,4 +101,4 @@ bar (T a, T b, T c)
foo (1 & (2 != 3));
}
-template void bar<int> (int, int, int); // { dg-message "instantiated" }
+template void bar<int> (int, int, int); // { dg-message "required" }
@@ -114,8 +114,8 @@ bar4 (T)
return (a = a);
}
-template void bar<int> (int); // { dg-message "instantiated" }
-template bool bar1<int> (int); // { dg-message "instantiated" }
+template void bar<int> (int); // { dg-message "required" }
+template bool bar1<int> (int); // { dg-message "required" }
template bool bar2<int> (int);
-template bool bar3<int> (int); // { dg-message "instantiated" }
+template bool bar3<int> (int); // { dg-message "required" }
template bool bar4<int> (int);
@@ -9,6 +9,6 @@ T *foo(void)
return (T *)&x; /* { dg-warning "strict-aliasing" } */
}
-template int *foo<int>(void); /* { dg-message "instantiated from here" } */
-template char *foo<char>(void); /* { dg-bogus "instantiated from here" } */
+template int *foo<int>(void); /* { dg-message "required from here" } */
+template char *foo<char>(void); /* { dg-bogus "required from here" } */
@@ -12,9 +12,9 @@ extern "C" void FormatDisk();
struct C {
C(){ FormatDisk(), 0; } // { dg-warning "right operand of comma" "" }
};
- template struct C<int>; // { dg-message "instantiated" }
+ template struct C<int>; // { dg-message "required" }
template <class T>
void f() { FormatDisk(), 0; } // { dg-warning "right operand of comma" "" }
- template void f<int> (); // { dg-message "instantiated" }
+ template void f<int> (); // { dg-message "required" }
void g() { FormatDisk(), 0; } // { dg-warning "right operand of comma" "" }
@@ -85,4 +85,4 @@ template<int I> void Foo (X &x)
__alignof__ (x++); // { dg-warning "no effect" "" }
}
-template void Foo<4> (X&); // { dg-message "instantiated" }
+template void Foo<4> (X&); // { dg-message "required" }
@@ -10,4 +10,4 @@ private:
template <typename U> friend class X; // { dg-error "redeclared with 1 template parameter" }
};
-X<int, int> i; // { dg-message "instantiated" }
+X<int, int> i; // { dg-message "required" }
@@ -1,5 +1,5 @@
// { dg-do assemble }
// GROUPS passed initialization
-// this should give an error in require_instantiated_type about not
+// this should give an error in require_required_type about not
// being allowed to have an initializer list in an argument list.
int f(int a = {1});// { dg-error "" } .*
@@ -25,7 +25,7 @@ template<class T> void fnx(T *) throw(T){} // { dg-error "" } invalid use of vo
void fx()
{
fnx((int *)0);
- fnx((void *)0); // { dg-message "instantiated from here" }
+ fnx((void *)0); // { dg-message "required from here" }
}
// [except.spec] 2, exception specifiers must be the same set of types (but
@@ -9,5 +9,5 @@ public:
};
int main() {
- GCD< 1, 0 >::val; // { dg-message "instantiated" }
+ GCD< 1, 0 >::val; // { dg-message "required" }
}
@@ -13,7 +13,7 @@ struct iterator {
template <class Iterator>
-struct reverse_iterator : public // { dg-message "instantiated" } no type iterator_category
+struct reverse_iterator : public // { dg-message "required" } no type iterator_category
iterator<typename iterator_traits<Iterator>::iterator_category> {
protected:
Iterator current;
@@ -8,9 +8,9 @@ class X {
class Y : public T // { dg-error "base type .* fails to be" }
{
};
- Y y; // { dg-message "instantiated" }
+ Y y; // { dg-message "required" }
};
int main() {
- X<int> x; // { dg-message "instantiated" }
+ X<int> x; // { dg-message "required" }
}
@@ -9,7 +9,7 @@ public:
void f ()
{
- Test<void> c; // { dg-message "instantiated" }
+ Test<void> c; // { dg-message "required" }
}
@@ -41,4 +41,4 @@ template <class T>
void g(T);
template void g(int); // { dg-error "no definition available" "no def" }
-// { dg-message "instantiated" "inst" { target *-*-* } 43 }
+// { dg-message "required" "inst" { target *-*-* } 43 }
@@ -19,3 +19,5 @@ int main()
{
f<0>();
}
+
+// { dg-prune-output "note" }
@@ -12,4 +12,4 @@ template<template<class> class XX>
class Y {
XX<int> x_;
};
-Y<Q::X> y; // { dg-error "" } instantiated from here
+Y<Q::X> y; // { dg-error "" } required from here
@@ -17,5 +17,5 @@ template<class T> void foo(moo_t<T>) {
int main() {
moo_t<int> x;
- foo(x); // { dg-bogus "" "" { xfail *-*-* } } - instantiated from here -
+ foo(x); // { dg-bogus "" "" { xfail *-*-* } } - required from here -
}
@@ -22,6 +22,6 @@ int main (void)
{
A dummy;
PrintArgs (dummy, dummy); // { dg-error "cannot pass" } cannot pass non-POD
-// { dg-message "instantiated" "inst" { target *-*-* } 24 }
+// { dg-message "required" "inst" { target *-*-* } 24 }
return 0;
}
@@ -22,7 +22,7 @@ proc prune_gcc_output { text } {
regsub -all "(^|\n)(\[^\n\]*: )?In ((static member |lambda )?function|member|method|(copy )?constructor|destructor|instantiation|program|subroutine|block-data)\[^\n\]*" $text "" text
regsub -all "(^|\n)\[^\n\]*(: )?At (top level|global scope):\[^\n\]*" $text "" text
- regsub -all "(^|\n)\[^\n\]*: (recursively )?instantiated from \[^\n\]*" $text "" text
+ regsub -all "(^|\n)\[^\n\]*: (recursively )?required \[^\n\]*" $text "" text
regsub -all "(^|\n)\[^\n\]*: . skipping \[0-9\]* instantiation contexts \[^\n\]*" $text "" text
regsub -all "(^|\n) inlined from \[^\n\]*" $text "" text
regsub -all "(^|\n)collect2: error: ld returned \[^\n\]*" $text "" text
@@ -25,5 +25,5 @@
void test01()
{
- std::declval<int>(); // { dg-error "instantiated from here" }
+ std::declval<int>(); // { dg-error "required from here" }
}
@@ -32,4 +32,4 @@ void test01()
}
// { dg-error "rep cannot be a duration" "" { target *-*-* } 226 }
-// { dg-error "instantiated from here" "" { target *-*-* } 31 }
+// { dg-error "required from here" "" { target *-*-* } 31 }
@@ -33,5 +33,5 @@ void test01()
}
// { dg-error "must be a specialization of ratio" "" { target *-*-* } 227 }
-// { dg-error "instantiated from here" "" { target *-*-* } 32 }
+// { dg-error "required from here" "" { target *-*-* } 32 }
// { dg-excess-errors "In instantiation of" }
@@ -34,4 +34,4 @@ void test01()
}
// { dg-error "period must be positive" "" { target *-*-* } 229 }
-// { dg-error "instantiated from here" "" { target *-*-* } 33 }
+// { dg-error "required from here" "" { target *-*-* } 33 }
@@ -38,7 +38,7 @@ struct A
void g()
{
- std::shared_ptr<A> sp1 = factory<A>(2, 1.414); // { dg-error "instantiated from here" }
+ std::shared_ptr<A> sp1 = factory<A>(2, 1.414); // { dg-error "required from here" }
}
// { dg-excess-errors "" }
@@ -43,10 +43,10 @@ void test01()
}
// { dg-error "does not name a type" "" { target *-*-* } 33 }
-// { dg-error "instantiated from here" "" { target *-*-* } 35 }
-// { dg-error "instantiated from here" "" { target *-*-* } 37 }
-// { dg-error "instantiated from here" "" { target *-*-* } 40 }
-// { dg-error "instantiated from here" "" { target *-*-* } 42 }
+// { dg-error "required from here" "" { target *-*-* } 35 }
+// { dg-error "required from here" "" { target *-*-* } 37 }
+// { dg-error "required from here" "" { target *-*-* } 40 }
+// { dg-error "required from here" "" { target *-*-* } 42 }
// { dg-error "invalid use of incomplete type" "" { target *-*-* } 1511 }
// { dg-error "declaration of" "" { target *-*-* } 1475 }
@@ -43,10 +43,10 @@ void test01()
}
// { dg-error "does not name a type" "" { target *-*-* } 33 }
-// { dg-error "instantiated from here" "" { target *-*-* } 35 }
-// { dg-error "instantiated from here" "" { target *-*-* } 37 }
-// { dg-error "instantiated from here" "" { target *-*-* } 40 }
-// { dg-error "instantiated from here" "" { target *-*-* } 42 }
+// { dg-error "required from here" "" { target *-*-* } 35 }
+// { dg-error "required from here" "" { target *-*-* } 37 }
+// { dg-error "required from here" "" { target *-*-* } 40 }
+// { dg-error "required from here" "" { target *-*-* } 42 }
// { dg-error "invalid use of incomplete type" "" { target *-*-* } 1435 }
// { dg-error "declaration of" "" { target *-*-* } 1399 }
@@ -46,9 +46,9 @@ test04()
std::ratio<1,0> r1 __attribute__((unused));
}
-// { dg-error "instantiated from here" "" { target *-*-* } 34 }
-// { dg-error "instantiated from here" "" { target *-*-* } 40 }
-// { dg-error "instantiated from here" "" { target *-*-* } 46 }
+// { dg-error "required from here" "" { target *-*-* } 34 }
+// { dg-error "required from here" "" { target *-*-* } 40 }
+// { dg-error "required from here" "" { target *-*-* } 46 }
// { dg-error "denominator cannot be zero" "" { target *-*-* } 268 }
// { dg-error "out of range" "" { target *-*-* } 269 }
// { dg-error "overflow in constant expression" "" { target *-*-* } 109 }
@@ -36,9 +36,9 @@ test02()
std::ratio_multiply<std::ratio<INTMAX_MAX>, std::ratio<INTMAX_MAX>>::type r2;
}
-// { dg-error "instantiated from here" "" { target *-*-* } 29 }
-// { dg-error "instantiated from here" "" { target *-*-* } 35 }
-// { dg-error "instantiated from here" "" { target *-*-* } 36 }
+// { dg-error "required from here" "" { target *-*-* } 29 }
+// { dg-error "required from here" "" { target *-*-* } 35 }
+// { dg-error "required from here" "" { target *-*-* } 36 }
// { dg-error "overflow in addition" "" { target *-*-* } 432 }
// { dg-error "overflow in multiplication" "" { target *-*-* } 104 }
// { dg-error "overflow in multiplication" "" { target *-*-* } 100 }
@@ -49,4 +49,4 @@ main()
}
// { dg-error "In member function" "" { target *-*-* } 0 }
// { dg-error "cannot convert" "" { target *-*-* } 0 }
-// { dg-error "instantiated from" "" { target *-*-* } 0 }
+// { dg-error "required from" "" { target *-*-* } 0 }
@@ -54,16 +54,16 @@ void test01(void) {
A_pointer aptr( &a );
// Can't implicitly cast from A* to B*
- B_pointer bptr1(aptr); // { dg-error "instantiated from here" 31 }
- B_pointer bptr2(&a); // { dg-error "instantiated from here" 32 }
+ B_pointer bptr1(aptr); // { dg-error "required from here" 31 }
+ B_pointer bptr2(&a); // { dg-error "required from here" 32 }
// but explicit cast/conversion is OK.
B_pointer bptr3(__static_pointer_cast<B_pointer>(aptr)); // ok
B_pointer bptr4(__static_pointer_cast<B_pointer>(&a)); // ok
// Can't implicitly cast from A* to B*
- bptr1 = aptr; // { dg-error "instantiated from here" 39 }
- bptr1 = &a; // { dg-error "instantiated from here" 40 }
+ bptr1 = aptr; // { dg-error "required from here" 39 }
+ bptr1 = &a; // { dg-error "required from here" 40 }
// but explicit cast/conversion is OK.
bptr1 = __static_pointer_cast<B_pointer>(aptr); // ok
@@ -71,21 +71,21 @@ void test01(void) {
// Similarly, can't shed constness via implicit cast
const_A_pointer captr(&a);
- A_pointer aptr2(captr); // { dg-error "instantiated from here" 48 }
+ A_pointer aptr2(captr); // { dg-error "required from here" 48 }
// but explicit cast/conversion is OK.
A_pointer aptr3(__const_pointer_cast<A_pointer>(captr)); // ok
// Similarly, can't shed constness via implicit cast
- aptr2 = captr; // { dg-error "instantiated from here" 54 }
+ aptr2 = captr; // { dg-error "required from here" 54 }
// but explicit cast/conversion is OK.
aptr3 = __const_pointer_cast<A_pointer>(captr); // ok
// Combine explicit const cast with implicit downcast.
const_B_pointer cbptr(&b);
- A_pointer aptr4(cbptr); // { dg-error "instantiated from here" 61 }
- aptr4 = cbptr; // { dg-error "instantiated from here" 62 }
+ A_pointer aptr4(cbptr); // { dg-error "required from here" 61 }
+ aptr4 = cbptr; // { dg-error "required from here" 62 }
A_pointer aptr5(__const_pointer_cast<B_pointer>(cbptr)); // ok
aptr5 = __const_pointer_cast<B_pointer>(cbptr); // ok
@@ -57,7 +57,7 @@ int main()
// The following line won't compile. The resize policy needs to be
// configured to allow external resize (by default, this is not
// available).
- h.resize(20); // { dg-error "instantiated from" }
+ h.resize(20); // { dg-error "required from" }
}
// { dg-error "invalid" "" { target *-*-* } 187 }
@@ -30,9 +30,9 @@ template<typename T>
int main()
{
- check_add_unsigned<float>(); // { dg-error "instantiated from" }
+ check_add_unsigned<float>(); // { dg-error "required from" }
return 0;
}
-// { dg-error "instantiated from" "" { target *-*-* } 28 }
+// { dg-error "required from" "" { target *-*-* } 28 }
// { dg-error "no type" "" { target *-*-* } 69 }
@@ -30,8 +30,8 @@ template<typename T>
int main()
{
- check_add_unsigned<bool>(); // { dg-error "instantiated from" }
- check_add_unsigned<wchar_t>(); // { dg-error "instantiated from" }
+ check_add_unsigned<bool>(); // { dg-error "required from" }
+ check_add_unsigned<wchar_t>(); // { dg-error "required from" }
return 0;
}
@@ -30,9 +30,9 @@ template<typename T>
int main()
{
- check_remove_unsigned<float>(); // { dg-error "instantiated from" }
+ check_remove_unsigned<float>(); // { dg-error "required from" }
return 0;
}
-// { dg-error "instantiated from" "" { target *-*-* } 28 }
+// { dg-error "required from" "" { target *-*-* } 28 }
// { dg-error "no type" "" { target *-*-* } 112 }
@@ -30,8 +30,8 @@ template<typename T>
int main()
{
- check_remove_unsigned<bool>(); // { dg-error "instantiated from" }
- check_remove_unsigned<wchar_t>(); // { dg-error "instantiated from" }
+ check_remove_unsigned<bool>(); // { dg-error "required from" }
+ check_remove_unsigned<wchar_t>(); // { dg-error "required from" }
return 0;
}
@@ -39,7 +39,7 @@ proc libstdc++-dg-prune { system text } {
# definitions, etc as these confuse dejagnu
regsub -all "(^|\n)(\[^\n\]*: )?In ((static member |lambda )?function|member|method|(copy )?constructor|destructor|instantiation|program|subroutine|block-data)\[^\n\]*" $text "" text
regsub -all "(^|\n)\[^\n\]*(: )?At (top level|global scope):\[^\n\]*" $text "" text
- regsub -all "(^|\n)\[^\n\]*: (recursively )?instantiated from \[^\n\]*" $text "" text
+ regsub -all "(^|\n)\[^\n\]*: (recursively )?required \[^\n\]*" $text "" text
regsub -all "(^|\n)\[^\n\]*: . skipping \[0-9\]* instantiation contexts \[^\n\]*" $text "" text
regsub -all "(^|\n) inlined from \[^\n\]*" $text "" text
# Why doesn't GCC need these to strip header context?
@@ -48,4 +48,4 @@ main()
}
// { dg-error "In member function" "" { target *-*-* } 0 }
// { dg-error "cannot convert" "" { target *-*-* } 0 }
-// { dg-error "instantiated from" "" { target *-*-* } 0 }
+// { dg-error "required from" "" { target *-*-* } 0 }