Home | History | Annotate | Download | only in class.friend
      1 // RUN: %clang_cc1 -fsyntax-only -verify %s
      2 
      3 void f1();
      4 
      5 struct X {
      6   void f2();
      7 };
      8 
      9 struct Y {
     10   friend void ::f1() { } // expected-error{{friend function definition cannot be qualified with '::'}}
     11   friend void X::f2() { } // expected-error{{friend function definition cannot be qualified with 'X::'}}
     12 };
     13 
     14 void local() {
     15   void f();
     16 
     17   struct Local {
     18     friend void f() { } // expected-error{{friend function cannot be defined in a local class}}
     19   };
     20 }
     21