Commit 6ba6f70d by Paolo Bonzini

[multiple changes]

2009-12-15  Paolo Bonzini  <bonzini@gnu.org>
	    Shujing Zhao  <pearly.zhao@oracle.com>

	* intl.c (get_spaces): New.
	* intl.h (get_spaces): New.

cp:
2009-12-15  Paolo Bonzini  <bonzini@gnu.org>
	    Shujing Zhao  <pearly.zhao@oracle.com>

	* Makefile.in (cp/pt.o): Depend on intl.h
	* call.c (print_z_candidates): Make loop more compact,
	choose head string depending on number of candidates,
	extract creation of spaces string to intl.c.
	* pt.c (print_overloaded_functions): Replace with...
	(print_candidates_1): ... this rewrite.
	(print_candidates): Rewrite to call print_candidates_1.
	(most_specialized_class): Make loop more compact,
	choose head string depending on number of candidates,
	and size indents depending on translations.
 
testsuite:
2009-12-15  Shujing Zhao  <pearly.zhao@oracle.com>

	* g++.dg/other/error20.C: Adjust dg-message strings.
	* g++.dg/other/error31.C: Likewise.
	* g++.dg/rtti/typeid6.C: Likewise.
	* g++.dg/ext/ms-1.C: Likewise.
	* g++.dg/parse/error19.C: Likewise.
	* g++.dg/parse/crash5.C: Likewise.
	* g++.dg/cpp0x/explicit4.C: Likewise.
	* g++.dg/template/ptrmem4.C: Likewise.
	* g++.dg/template/crash37.C: Likewise.
	* g++.dg/template/qualttp5.C: Likewise.
	* g++.dg/template/local6.C: Likewise.
	* g++.dg/template/instantiate5.C: Likewise.
	* g++.old-deja/g++.brendan/overload1.C: Likewise.
	* g++.old-deja/g++.brendan/cvt3.C: Likewise.
	* g++.old-deja/g++.brendan/overload4.C: Likewise.
	* g++.old-deja/g++.jason/conversion11.C: Likewise.
	* g++.old-deja/g++.jason/scoping10.C: Likewise.
	* g++.old-deja/g++.other/expr1.C: Likewise.
	* g++.old-deja/g++.other/pmf3.C: Likewise.
	* g++.old-deja/g++.other/crash24.C: Likewise.
	* g++.old-deja/g++.niklas/t120.C: Likewise.
	* g++.old-deja/g++.niklas/t121.C: Likewise.
	* g++.old-deja/g++.law/operators9.C: Likewise.
	* g++.old-deja/g++.law/arm9.C: Likewise.
	* g++.old-deja/g++.law/enum4.C: Likewise.
	* g++.old-deja/g++.law/arg11.C: Likewise.
	* g++.old-deja/g++.benjamin/15800-1.C: Likewise.
	* g++.old-deja/g++.mike/p2431.C: Likewise.
	* g++.old-deja/g++.mike/p438.C: Likewise.
	* g++.old-deja/g++.mike/p9068.C: Likewise.
	* g++.old-deja/g++.mike/p11110.C: Likewise.
	* g++.old-deja/g++.bugs/900330_02.C: Likewise.

From-SVN: r155245
parent 9ed796d7
2009-12-15 Paolo Bonzini <bonzini@gnu.org>
Shujing Zhao <pearly.zhao@oracle.com>
* intl.c (get_spaces): New.
* intl.h (get_spaces): New.
2009-12-14 Jakub Jelinek <jakub@redhat.com> 2009-12-14 Jakub Jelinek <jakub@redhat.com>
PR bootstrap/42369 PR bootstrap/42369
2009-12-15 Paolo Bonzini <bonzini@gnu.org>
Shujing Zhao <pearly.zhao@oracle.com>
* Makefile.in (cp/pt.o): Depend on intl.h
* call.c (print_z_candidates): Make loop more compact,
choose head string depending on number of candidates,
extract creation of spaces string to intl.c.
* pt.c (print_overloaded_functions): Replace with...
(print_candidates_1): ... this rewrite.
(print_candidates): Rewrite to call print_candidates_1.
(most_specialized_class): Make loop more compact,
choose head string depending on number of candidates,
and size indents depending on translations.
2009-12-11 Jason Merrill <jason@redhat.com> 2009-12-11 Jason Merrill <jason@redhat.com>
PR c++/42219 PR c++/42219
......
...@@ -292,7 +292,7 @@ cp/expr.o: cp/expr.c $(CXX_TREE_H) $(TM_H) $(RTL_H) $(FLAGS_H) $(EXPR_H) \ ...@@ -292,7 +292,7 @@ cp/expr.o: cp/expr.c $(CXX_TREE_H) $(TM_H) $(RTL_H) $(FLAGS_H) $(EXPR_H) \
toplev.h except.h $(TM_P_H) toplev.h except.h $(TM_P_H)
cp/pt.o: cp/pt.c $(CXX_TREE_H) $(TM_H) cp/decl.h cp/cp-objcp-common.h \ cp/pt.o: cp/pt.c $(CXX_TREE_H) $(TM_H) cp/decl.h cp/cp-objcp-common.h \
toplev.h $(RTL_H) except.h $(TREE_INLINE_H) pointer-set.h gt-cp-pt.h \ toplev.h $(RTL_H) except.h $(TREE_INLINE_H) pointer-set.h gt-cp-pt.h \
vecprim.h vecprim.h intl.h
cp/error.o: cp/error.c $(CXX_TREE_H) $(TM_H) toplev.h $(DIAGNOSTIC_H) \ cp/error.o: cp/error.c $(CXX_TREE_H) $(TM_H) toplev.h $(DIAGNOSTIC_H) \
$(FLAGS_H) $(REAL_H) $(LANGHOOKS_DEF_H) $(CXX_PRETTY_PRINT_H) $(FLAGS_H) $(REAL_H) $(LANGHOOKS_DEF_H) $(CXX_PRETTY_PRINT_H)
cp/repo.o: cp/repo.c $(CXX_TREE_H) $(TM_H) toplev.h $(DIAGNOSTIC_H) \ cp/repo.o: cp/repo.c $(CXX_TREE_H) $(TM_H) toplev.h $(DIAGNOSTIC_H) \
......
...@@ -2730,6 +2730,7 @@ print_z_candidates (struct z_candidate *candidates) ...@@ -2730,6 +2730,7 @@ print_z_candidates (struct z_candidate *candidates)
const char *str; const char *str;
struct z_candidate *cand1; struct z_candidate *cand1;
struct z_candidate **cand2; struct z_candidate **cand2;
char *spaces;
if (!candidates) if (!candidates)
return; return;
...@@ -2770,25 +2771,14 @@ print_z_candidates (struct z_candidate *candidates) ...@@ -2770,25 +2771,14 @@ print_z_candidates (struct z_candidate *candidates)
} }
} }
str = _("candidates are:"); str = candidates->next ? _("candidates are:") : _("candidate is:");
print_z_candidate (str, candidates); spaces = NULL;
if (candidates->next) for (; candidates; candidates = candidates->next)
{ {
/* Indent successive candidates by the width of the translation print_z_candidate (spaces ? spaces : str, candidates);
of the above string. */ spaces = spaces ? spaces : get_spaces (str);
size_t len = gcc_gettext_width (str) + 1;
char *spaces = (char *) alloca (len);
memset (spaces, ' ', len-1);
spaces[len - 1] = '\0';
candidates = candidates->next;
do
{
print_z_candidate (spaces, candidates);
candidates = candidates->next;
}
while (candidates);
} }
free (spaces);
} }
/* USER_SEQ is a user-defined conversion sequence, beginning with a /* USER_SEQ is a user-defined conversion sequence, beginning with a
......
...@@ -32,6 +32,7 @@ along with GCC; see the file COPYING3. If not see ...@@ -32,6 +32,7 @@ along with GCC; see the file COPYING3. If not see
#include "tm.h" #include "tm.h"
#include "obstack.h" #include "obstack.h"
#include "tree.h" #include "tree.h"
#include "intl.h"
#include "pointer-set.h" #include "pointer-set.h"
#include "flags.h" #include "flags.h"
#include "c-common.h" #include "c-common.h"
...@@ -1646,19 +1647,52 @@ explicit_class_specialization_p (tree type) ...@@ -1646,19 +1647,52 @@ explicit_class_specialization_p (tree type)
return !uses_template_parms (CLASSTYPE_TI_ARGS (type)); return !uses_template_parms (CLASSTYPE_TI_ARGS (type));
} }
/* Print the list of overloaded FNS in an error message. */ /* Print the list of functions at FNS, going through all the overloads
for each element of the list. Alternatively, FNS can not be a
TREE_LIST, in which case it will be printed together with all the
overloads.
MORE and *STR should respectively be FALSE and NULL when the function
is called from the outside. They are used internally on recursive
calls. print_candidates manages the two parameters and leaves NULL
in *STR when it ends. */
static void static void
print_overloaded_functions (tree fns, const char **str) print_candidates_1 (tree fns, bool more, const char **str)
{ {
tree fn; tree fn, fn2;
char *spaces = NULL;
for (fn = fns; fn; fn = OVL_NEXT (fn)) for (fn = fns; fn; fn = OVL_NEXT (fn))
if (TREE_CODE (fn) == TREE_LIST)
{
gcc_assert (!OVL_NEXT (fn) && !is_overloaded_fn (fn));
for (fn2 = fn; fn2 != NULL_TREE; fn2 = TREE_CHAIN (fn2))
print_candidates_1 (TREE_VALUE (fn2),
TREE_CHAIN (fn2) || more, str);
}
else
{
if (!*str)
{
/* Pick the prefix string. */
if (!more && !OVL_NEXT (fns))
{
error ("candidate is: %+#D", OVL_CURRENT (fn));
continue;
}
*str = _("candidates are:");
spaces = get_spaces (*str);
}
error ("%s %+#D", *str, OVL_CURRENT (fn));
*str = spaces ? spaces : *str;
}
if (!more)
{ {
if (TREE_CODE (fn) == TREE_LIST) free (spaces);
print_candidates (fn); *str = NULL;
else
error ("%s %+#D", *str, OVL_CURRENT (fn));
*str = " ";
} }
} }
...@@ -1667,16 +1701,9 @@ print_overloaded_functions (tree fns, const char **str) ...@@ -1667,16 +1701,9 @@ print_overloaded_functions (tree fns, const char **str)
void void
print_candidates (tree fns) print_candidates (tree fns)
{ {
const char *str = "candidates are:"; const char *str = NULL;
print_candidates_1 (fns, false, &str);
if (is_overloaded_fn (fns)) gcc_assert (str == NULL);
print_overloaded_functions (fns, &str);
else
{
tree fn;
for (fn = fns; fn != NULL_TREE; fn = TREE_CHAIN (fn))
print_overloaded_functions (TREE_VALUE (fn), &str);
}
} }
/* Returns the template (one of the functions given by TEMPLATE_ID) /* Returns the template (one of the functions given by TEMPLATE_ID)
...@@ -15753,13 +15780,16 @@ most_specialized_class (tree type, tree tmpl) ...@@ -15753,13 +15780,16 @@ most_specialized_class (tree type, tree tmpl)
if (ambiguous_p) if (ambiguous_p)
{ {
const char *str = "candidates are:"; const char *str;
char *spaces = NULL;
error ("ambiguous class template instantiation for %q#T", type); error ("ambiguous class template instantiation for %q#T", type);
str = TREE_CHAIN (list) ? _("candidates are:") : _("candidate is:");
for (t = list; t; t = TREE_CHAIN (t)) for (t = list; t; t = TREE_CHAIN (t))
{ {
error ("%s %+#T", str, TREE_TYPE (t)); error ("%s %+#T", spaces ? spaces : str, TREE_TYPE (t));
str = " "; spaces = spaces ? spaces : get_spaces (str);
} }
free (spaces);
return error_mark_node; return error_mark_node;
} }
......
...@@ -120,3 +120,20 @@ gcc_gettext_width (const char *msgstr) ...@@ -120,3 +120,20 @@ gcc_gettext_width (const char *msgstr)
#endif #endif
#endif /* ENABLE_NLS */ #endif /* ENABLE_NLS */
/* Return the indent for successive lines, using the width of
the STR. STR must have been translated already. The string
must be freed by the caller. */
char *
get_spaces (const char *str)
{
size_t len = gcc_gettext_width (str);
char *spaces = XNEWVEC(char, len + 1);
memset (spaces, ' ', len);
spaces[len] = '\0';
return spaces;
}
...@@ -54,6 +54,8 @@ extern size_t gcc_gettext_width (const char *); ...@@ -54,6 +54,8 @@ extern size_t gcc_gettext_width (const char *);
# define G_(gmsgid) gmsgid # define G_(gmsgid) gmsgid
#endif #endif
extern char *get_spaces (const char *);
extern const char *open_quote; extern const char *open_quote;
extern const char *close_quote; extern const char *close_quote;
extern const char *locale_encoding; extern const char *locale_encoding;
......
2009-12-15 Shujing Zhao <pearly.zhao@oracle.com>
* g++.dg/other/error20.C: Adjust dg-message strings.
* g++.dg/other/error31.C: Likewise.
* g++.dg/rtti/typeid6.C: Likewise.
* g++.dg/ext/ms-1.C: Likewise.
* g++.dg/parse/error19.C: Likewise.
* g++.dg/parse/crash5.C: Likewise.
* g++.dg/cpp0x/explicit4.C: Likewise.
* g++.dg/template/ptrmem4.C: Likewise.
* g++.dg/template/crash37.C: Likewise.
* g++.dg/template/qualttp5.C: Likewise.
* g++.dg/template/local6.C: Likewise.
* g++.dg/template/instantiate5.C: Likewise.
* g++.old-deja/g++.brendan/overload1.C: Likewise.
* g++.old-deja/g++.brendan/cvt3.C: Likewise.
* g++.old-deja/g++.brendan/overload4.C: Likewise.
* g++.old-deja/g++.jason/conversion11.C: Likewise.
* g++.old-deja/g++.jason/scoping10.C: Likewise.
* g++.old-deja/g++.other/expr1.C: Likewise.
* g++.old-deja/g++.other/pmf3.C: Likewise.
* g++.old-deja/g++.other/crash24.C: Likewise.
* g++.old-deja/g++.niklas/t120.C: Likewise.
* g++.old-deja/g++.niklas/t121.C: Likewise.
* g++.old-deja/g++.law/operators9.C: Likewise.
* g++.old-deja/g++.law/arm9.C: Likewise.
* g++.old-deja/g++.law/enum4.C: Likewise.
* g++.old-deja/g++.law/arg11.C: Likewise.
* g++.old-deja/g++.benjamin/15800-1.C: Likewise.
* g++.old-deja/g++.mike/p2431.C: Likewise.
* g++.old-deja/g++.mike/p438.C: Likewise.
* g++.old-deja/g++.mike/p9068.C: Likewise.
* g++.old-deja/g++.mike/p11110.C: Likewise.
* g++.old-deja/g++.bugs/900330_02.C: Likewise.
2009-12-14 Uros Bizjak <ubizjak@gmail.com> 2009-12-14 Uros Bizjak <ubizjak@gmail.com>
* g++.dg/other/i386-2.C: Add -mpopcnt -mabm -mlwp to dg-options. * g++.dg/other/i386-2.C: Add -mpopcnt -mabm -mlwp to dg-options.
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// { dg-options "-std=c++0x" } // { dg-options "-std=c++0x" }
struct A { struct A {
A(const A&, int = 0); // { dg-message "candidates" } A(const A&, int = 0); // { dg-message "candidate" }
}; };
struct B struct B
{ {
......
...@@ -10,7 +10,7 @@ struct X ...@@ -10,7 +10,7 @@ struct X
void Quux (void (X::*) ()); void Quux (void (X::*) ());
void X::Foo (X *ptr) // { dg-message "candidates" } void X::Foo (X *ptr) // { dg-message "candidate" }
{ {
Quux (Foo); // { dg-error "no matches" } Quux (Foo); // { dg-error "no matches" }
Quux (Bar); Quux (Bar);
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// { dg-do compile } // { dg-do compile }
struct A struct A
{ // { dg-message "candidates" } { // { dg-message "candidate is" }
virtual A foo (); virtual A foo ();
}; };
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
// { dg-options "" } // { dg-options "" }
// { dg-bogus "not supported by" "" { target *-*-* } 0 } // { dg-bogus "not supported by" "" { target *-*-* } 0 }
struct A {}; // { dg-message "note: candidates are" } struct A {}; // { dg-message "note: candidate is" }
void void
foo () foo ()
......
// { dg-options "-w" } // { dg-options "-w" }
class QString { // { dg-error "previous definition" } class QString { // { dg-error "previous definition" }
QString (const QString & a); // { dg-message "candidates" } QString (const QString & a); // { dg-message "candidate is" }
}; };
class QString { }; // { dg-error "redefinition" } class QString { }; // { dg-error "redefinition" }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// PR C++/17867 // PR C++/17867
struct A struct A
{ // { dg-message "1:candidates are:" } { // { dg-message "1:candidate is:" }
A(int); A(int);
}; };
......
...@@ -7,5 +7,5 @@ namespace std ...@@ -7,5 +7,5 @@ namespace std
template<int> void foo() template<int> void foo()
{ {
!typeid(void); // { dg-error "!typeid\\(void\\)|candidates" } !typeid(void); // { dg-error "!typeid\\(void\\)|candidate is" }
} }
...@@ -11,7 +11,7 @@ struct coperator_stack ...@@ -11,7 +11,7 @@ struct coperator_stack
struct helper {}; struct helper {};
template<class F> template<class F>
void bla(F f) // { dg-message "candidates" } void bla(F f) // { dg-message "candidate is" }
{ {
} }
......
...@@ -13,7 +13,7 @@ int baz() { return A<0>::i; } ...@@ -13,7 +13,7 @@ int baz() { return A<0>::i; }
struct B struct B
{ {
static void foo (int); // { dg-message "candidates" } static void foo (int); // { dg-message "candidate is" }
}; };
template <typename T> struct C template <typename T> struct C
......
template <class T> struct PCVector2 template <class T> struct PCVector2
{ // { dg-message "candidates" } { // { dg-message "candidate is" }
template <class T2> PCVector2(const PCVector2<T> &cv) ; template <class T2> PCVector2(const PCVector2<T> &cv) ;
PCVector2<T> operator- (const PCVector2<T> &ov) const PCVector2<T> operator- (const PCVector2<T> &ov) const
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
// Pointer to member function template argument deduction ICE. // Pointer to member function template argument deduction ICE.
template <class CONT> void queryAliases(CONT& fill_me); // { dg-message "candidates" } template <class CONT> void queryAliases(CONT& fill_me); // { dg-message "candidate is" }
struct SpyExample struct SpyExample
{ {
......
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
template <class U> struct A template <class U> struct A
{ {
template <class T> class B {}; // { dg-message "candidates" } template <class T> class B {}; // { dg-message "candidate is" }
}; };
template <template <class> class TT> void f() template <template <class> class TT> void f()
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
struct panama { struct panama {
panama(); panama();
panama(panama &); panama(panama &);
panama& operator=(panama&); // { dg-message "candidates" } panama& operator=(panama&); // { dg-message "candidate is" }
}; };
extern panama dig(); extern panama dig();
......
...@@ -38,7 +38,7 @@ struct bar ...@@ -38,7 +38,7 @@ struct bar
class nnyacc class nnyacc
{ {
public: public:
static void assign(void*& lval, void*& rval); // { dg-message "candidates" } static void assign(void*& lval, void*& rval); // { dg-message "candidate is" }
}; };
void void
......
...@@ -9,7 +9,7 @@ public: ...@@ -9,7 +9,7 @@ public:
class Bar : public Foo class Bar : public Foo
{ {
public: public:
int f (int); // { dg-message "candidates" } int f (int); // { dg-message "candidate is" }
}; };
int main () int main ()
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
class B class B
{ {
public: public:
static void WantsNew (NewObject creator); // { dg-message "candidates" } static void WantsNew (NewObject creator); // { dg-message "candidate is" }
}; };
class A class A
......
...@@ -19,7 +19,7 @@ struct B { ...@@ -19,7 +19,7 @@ struct B {
}; };
struct D : public B { struct D : public B {
int f(struct B); // { dg-message "candidates" } referred to below int f(struct B); // { dg-message "candidate is" } referred to below
}; };
void h(D* pd) void h(D* pd)
......
...@@ -14,7 +14,7 @@ public: ...@@ -14,7 +14,7 @@ public:
class Something { class Something {
public: public:
void DoSomething(Ding A); // { dg-message "candidates" } referred to void DoSomething(Ding A); // { dg-message "candidate is" } referred to
}; };
void DoSomething(Ding A); void DoSomething(Ding A);
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
void f (char *); void f (char *);
struct A { struct A {
void f (); // { dg-message "candidates" } referred to void f (); // { dg-message "candidate is" } referred to
}; };
struct B : public A { struct B : public A {
void g (char *); void g (char *);
......
...@@ -9,7 +9,7 @@ struct String { String(const char*); }; ...@@ -9,7 +9,7 @@ struct String { String(const char*); };
struct Ack { Ack(String); }; struct Ack { Ack(String); };
struct S { void method(Ack); }; // { dg-message "candidates" } referenced below struct S { void method(Ack); }; // { dg-message "candidate is" } referenced below
void function(Ack); void function(Ack);
......
...@@ -19,7 +19,7 @@ class B : public A { ...@@ -19,7 +19,7 @@ class B : public A {
public: public:
void set (f2 f); void set (f2 f);
}; };
void B::set (f2 f) { std::cout << "called B\n";} // { dg-message "candidates" } void B::set (f2 f) { std::cout << "called B\n";} // { dg-message "candidate is" }
int main() { int main() {
B b; B b;
......
...@@ -11,7 +11,7 @@ enum Enum {enumerator1, enumerator2}; ...@@ -11,7 +11,7 @@ enum Enum {enumerator1, enumerator2};
struct Struct struct Struct
{ {
int i; int i;
int getI(Enum) {return i;} // { dg-message "candidates" } int getI(Enum) {return i;} // { dg-message "candidate is" }
}; };
int funct (Enum) int funct (Enum)
......
...@@ -10,7 +10,7 @@ class B ...@@ -10,7 +10,7 @@ class B
{ {
public: public:
operator=(B &); // { dg-error "no type" } operator=(B &); // { dg-error "no type" }
// { dg-message "candidates" "note" { target *-*-* } 12 } // { dg-message "candidate is" "note" { target *-*-* } 12 }
}; };
void void
......
...@@ -6,7 +6,7 @@ class data; ...@@ -6,7 +6,7 @@ class data;
class conatiner { class conatiner {
public: public:
virtual void* first (); virtual void* first ();
virtual data* contents (void* i); // { dg-message "candidates" } virtual data* contents (void* i); // { dg-message "candidate is" }
}; };
class user { class user {
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
class A class A
{ {
public: public:
A(A &); // { dg-message "candidates" } A(A &); // { dg-message "candidate is" }
}; };
class B class B
......
...@@ -12,7 +12,7 @@ class C ...@@ -12,7 +12,7 @@ class C
class D class D
{ {
public: public:
void a(C& b); // { dg-message "candidates" } void a(C& b); // { dg-message "candidate is" }
}; };
void C::test() const void C::test() const
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// prms-id: 9068 // prms-id: 9068
struct ostream { struct ostream {
void operator<< (int); // { dg-message "candidates" } fn ref in err msg void operator<< (int); // { dg-message "candidate is" } fn ref in err msg
}; };
class C { class C {
......
...@@ -3,4 +3,4 @@ ...@@ -3,4 +3,4 @@
typedef void (*T) (...); typedef void (*T) (...);
void f (); void f ();
struct S { void g (T); void h() { g(f); } };// { dg-error "match" "match" } struct S { void g (T); void h() { g(f); } };// { dg-error "match" "match" }
// { dg-message "candidates" "note" { target *-*-* } 5 } // { dg-message "candidate is" "note" { target *-*-* } 5 }
...@@ -3,4 +3,4 @@ ...@@ -3,4 +3,4 @@
void f (); void f ();
void g1 (void (*) (...)); void h1 () { g1 (f); }// { dg-error "invalid conversion" } void g1 (void (*) (...)); void h1 () { g1 (f); }// { dg-error "invalid conversion" }
struct S { void g2 (void (*) (...)); void h2 () { g2 (f); } };// { dg-error "match" "match" } struct S { void g2 (void (*) (...)); void h2 () { g2 (f); } };// { dg-error "match" "match" }
// { dg-message "candidates" "note" { target *-*-* } 5 } // { dg-message "candidate is" "note" { target *-*-* } 5 }
...@@ -7,7 +7,7 @@ class foo { ...@@ -7,7 +7,7 @@ class foo {
friend class __iterator; friend class __iterator;
typedef __iterator const_iterator; typedef __iterator const_iterator;
virtual ~foo() { } virtual ~foo() { }
__iterator begin(); // { dg-message "candidates" } __iterator begin(); // { dg-message "candidate is" }
}; };
static void iteratorTest(const foo &x) static void iteratorTest(const foo &x)
{ {
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
// Simplified from bug report by Trevor Taylor <ttaylor@powerup.com.au> // Simplified from bug report by Trevor Taylor <ttaylor@powerup.com.au>
struct T { struct T {
int operator()(int) { } // { dg-message "candidates" } int operator()(int) { } // { dg-message "candidate is" }
}; };
int main() { int main() {
......
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
// Bug: g++ was crashing after giving errors. // Bug: g++ was crashing after giving errors.
template<class T> template<class T>
void connect_to_method( // { dg-message "candidates are" } void connect_to_method( // { dg-message "candidate is" }
T *receiver, T *receiver,
void (T::*method)()) void (T::*method)())
{} {}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment