From a2dfb563745d1b0be669f49e37f6b7d56ee65991 Mon Sep 17 00:00:00 2001 From: Jason Merrill Date: Sat, 8 Aug 2015 18:01:12 -0400 Subject: [PATCH] re PR libstdc++/67114 ([MinGW64] build failure with POSIX threads enabled) PR c++/67114 * call.c (joust): Only call more_constrained on decls. From-SVN: r226736 --- gcc/cp/ChangeLog | 5 +++++ gcc/cp/call.c | 16 ++++++++-------- gcc/testsuite/g++.dg/cpp1z/regress1.C | 19 +++++++++++++++++++ 3 files changed, 32 insertions(+), 8 deletions(-) create mode 100644 gcc/testsuite/g++.dg/cpp1z/regress1.C diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog index a50804ae14b0..40ed123c961c 100644 --- a/gcc/cp/ChangeLog +++ b/gcc/cp/ChangeLog @@ -1,3 +1,8 @@ +2015-08-08 Jason Merrill + + PR c++/67114 + * call.c (joust): Only call more_constrained on decls. + 2015-08-06 Andrew Sutton Braden Obrzut Jason Merrill diff --git a/gcc/cp/call.c b/gcc/cp/call.c index 4823d37a9c40..19ddb91e08fc 100644 --- a/gcc/cp/call.c +++ b/gcc/cp/call.c @@ -9157,14 +9157,14 @@ joust (struct z_candidate *cand1, struct z_candidate *cand2, bool warn, return winner; } - // C++ Concepts - // or, if not that, F1 is more constrained than F2. - if (flag_concepts) - { - winner = more_constrained (cand1->fn, cand2->fn); - if (winner) - return winner; - } + // C++ Concepts + // or, if not that, F1 is more constrained than F2. + if (flag_concepts && DECL_P (cand1->fn) && DECL_P (cand2->fn)) + { + winner = more_constrained (cand1->fn, cand2->fn); + if (winner) + return winner; + } /* Check whether we can discard a builtin candidate, either because we have two identical ones or matching builtin and non-builtin candidates. diff --git a/gcc/testsuite/g++.dg/cpp1z/regress1.C b/gcc/testsuite/g++.dg/cpp1z/regress1.C new file mode 100644 index 000000000000..bbcca083ede5 --- /dev/null +++ b/gcc/testsuite/g++.dg/cpp1z/regress1.C @@ -0,0 +1,19 @@ +// PR c++/67114 +// { dg-options -std=c++1z } + +typedef unsigned uint32_t; +class A { +public: + void operator==(A); + operator uint32_t() const; + operator int() const; +}; +class BluetoothNamedValue { + bool operator==(const BluetoothNamedValue &) const; + A value() const; +}; +auto BluetoothNamedValue:: +operator==(const BluetoothNamedValue &) const -> bool { + value() == value(); + return true; +} -- 2.47.3