// RUN: %clang_cc1 -fsyntax-only -verify %s
// RUN: %clang_cc1 -fsyntax-only -verify -std=c++98 %s
// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
// PR6716
// Check the rules described in p4:
// When considering an associated namespace, the lookup is the same as the lookup
// performed when the associated namespace is used as a qualifier (6.4.3.2) except that:
// - Any using-directives in the associated namespace are ignored.
// - Any namespace-scope friend functions or friend function templates declared in
// associated classes are visible within their respective namespaces even if
// they are not visible during an ordinary lookup
// (Note: For the friend declaration to be visible, the corresponding class must be
// included in the set of associated classes. Merely including the namespace in
// the set of associated namespaces is not enough.)
// credit: Arthur O’Dwyer
// - All names except those of (possibly overloaded) functions and
// function templates are ignored.