From 54ae96de89f391cd76bbd0bfab208b54e71804ec Mon Sep 17 00:00:00 2001 From: Mark Mitchell Date: Tue, 30 May 2000 17:39:59 +0000 Subject: [PATCH] * call.c (joust): Fix handling of overloaded builtin operators. From-SVN: r34269 --- gcc/cp/ChangeLog | 4 ++++ gcc/cp/call.c | 2 +- gcc/testsuite/g++.old-deja/g++.other/overload13.C | 13 +++++++++++++ 3 files changed, 18 insertions(+), 1 deletion(-) create mode 100644 gcc/testsuite/g++.old-deja/g++.other/overload13.C diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index e7f8552f7ed..e6cdcd2c9ba 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,7 @@ +2000-05-30 Mark Mitchell + + * call.c (joust): Fix handling of overloaded builtin operators. + 2000-05-30 Zack Weinberg * cp-tree.h (DECL_ANTICIPATED): New macro. diff --git a/gcc/cp/call.c b/gcc/cp/call.c index 2bd5c81843a..acb5cfeced3 100644 --- a/gcc/cp/call.c +++ b/gcc/cp/call.c @@ -5128,7 +5128,7 @@ joust (cand1, cand2, warn) /* Kludge around broken overloading rules whereby Integer a, b; test ? a : b; is ambiguous, since there's a builtin that takes references and another that takes values. */ - if (DECL_OVERLOADED_OPERATOR_P (cand1->fn) == COND_EXPR) + if (cand1->fn == ansi_opname (COND_EXPR)) { tree c1 = TREE_VEC_ELT (cand1->convs, 1); tree c2 = TREE_VEC_ELT (cand2->convs, 1); diff --git a/gcc/testsuite/g++.old-deja/g++.other/overload13.C b/gcc/testsuite/g++.old-deja/g++.other/overload13.C new file mode 100644 index 00000000000..d6728c79e17 --- /dev/null +++ b/gcc/testsuite/g++.old-deja/g++.other/overload13.C @@ -0,0 +1,13 @@ +// Build don't link: +// Origin: Nathan Sidwell + +struct A { + bool operator== (A const &); + operator bool () const; + operator int * () const; +}; + +bool foo (A &a1, A &a2) +{ + return a1 == a2; +}