https://bugs.llvm.org/show_bug.cgi?id=44531

Reid Kleckner <[email protected]> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |[email protected]
         Resolution|---                         |INVALID

--- Comment #1 from Reid Kleckner <[email protected]> ---
The intention of the warning is to indicate that, on Linux, you are not
friending the global class S, but you are declaring a class N::S, which will
friend N::SS. MSVC will instead friend class ::S, and clang-cl does this.
Consider:

https://godbolt.org/z/yZbeVt

class S;

namespace N
{
    class SS
    {
        friend class S;
        static int gv;
    };
}

class S {
  int usePriv() { return N::SS::gv; }
};

MSVC and clang-cl accept, regular clang on Linux rejects. Clang on Windows is
trying to warn you about that non-standard behavior. Seems to be working as
intended.

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
llvm-bugs mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-bugs

Reply via email to