This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug c++/82894] New: Inherited member functions do not create ambiguity
- From: "david at doublewise dot net" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: Wed, 08 Nov 2017 06:33:00 +0000
- Subject: [Bug c++/82894] New: Inherited member functions do not create ambiguity
- Auto-submitted: auto-generated
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82894
Bug ID: 82894
Summary: Inherited member functions do not create ambiguity
Product: gcc
Version: 8.0
Status: UNCONFIRMED
Severity: normal
Priority: P3
Component: c++
Assignee: unassigned at gcc dot gnu.org
Reporter: david at doublewise dot net
Target Milestone: ---
#include <type_traits>
template<typename T>
struct wrapper : private T {
struct type {};
type f(type = {});
using T::f;
};
struct S {
void f() {
}
};
static_assert(std::is_same<
decltype(std::declval<wrapper<S> &>().f()),
wrapper<S>::type
>{});
This program should fail to compile because the call to `f` should be
ambiguous. Instead, it compiles just fine, indicating that the outer `f` is
hiding `S::f`. This bug prevents the ability to detect certain classes of
member functions.