// RUN: %clang_cc1 -fsyntax-only -verify -std=c++98 %s
// RUN: %clang_cc1 -fsyntax-only -verify -std=c++11 %s
// RUN: %clang_cc1 -fsyntax-only -verify -std=c++14 %s
// RUN: %clang_cc1 -fsyntax-only -verify %s
// C++'0x [class.friend] p1:
// A friend of a class is a function or class that is given permission to use
// the private and protected member names from the class. A class specifies
// its friends, if any, by way of friend declarations. Such declarations give
// special access rights to the friends, but they do not make the nominated
// friends members of the befriending class.
; // expected-note 2 {{'S' declared here}}
S* // expected-note 2 {{'g' declared here}}
;
void
// Test that we recurse through namespaces to find already declared names, but
// new names are declared within the enclosing namespace.
// Make sure that friends have access to inherited protected members.
// PR6174
// PR6207
// Return types, parameters and default arguments to friend functions.
// PR6885
// PR7230
// PR8705
// PR9221
// PR13642. When computing the effective context, we were walking up
// the DC chain for the canonical decl, which is unfortunate if that's
// (e.g.) a friend declaration.