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.

Reply via email to