This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/82894] New: Inherited member functions do not create ambiguity


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.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]