summaryrefslogtreecommitdiff
path: root/clang/test/CXX/class.access/class.friend/p6.cpp
blob: 7f7d9099032815163e6917a2c7fc0bf061d54c76 (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
// RUN: %clang_cc1 -fsyntax-only -verify %s

void f1();

struct X {
  void f2();
};

struct Y {
  friend void ::f1() { } // expected-error{{friend function definition cannot be qualified with '::'}}
  friend void X::f2() { } // expected-error{{friend function definition cannot be qualified with 'X::'}}
};

void local() {
  void f();

  struct Local {
    friend void f() { } // expected-error{{friend function cannot be defined in a local class}}
  };
}