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++/47294] New: definition of function template can be explicitly-qualified with a namespace it isn't a member of


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=47294

           Summary: definition of function template can be
                    explicitly-qualified with a namespace it isn't a
                    member of
           Product: gcc
           Version: 4.6.0
            Status: UNCONFIRMED
          Keywords: accepts-invalid
          Severity: normal
          Priority: P3
         Component: c++
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: redi@gcc.gnu.org


namespace N
{
    void f();
}

template<typename T>
void N::f(T)   // ERROR does not match any declaration in N
{
}

int main()
{
    ::f(0);
}

This is forbidden by [namespace.memdef]p2 but g++ accepts it without error.

EDG, Clang and Sun reject it.


If there isn't an (incompatible) overload of N::f then g++ rejects it.


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