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++/70099] New: Function found by ADL, but shouldn't be visible at point of definition


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=70099

            Bug ID: 70099
           Summary: Function found by ADL, but shouldn't be visible at
                    point of definition
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: barry.revzin at gmail dot com
  Target Milestone: ---

The following fragment compiles on g++ 5.3.0:

struct X { };

namespace foo {
    template <class T>
    void bar() { T{} < T{}; }

    void operator<(const X&, const X&) {}
}

int main() {
    foo::bar<X>();
}

But foo::operator<(const X&, const X&) isn't visible at the point of the
definition of bar, and isn't in one of the associated namespaces of X, per
[temp.dep.res].

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