You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
25 lines
596 B
25 lines
596 B
4 months ago
|
// 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::'}}
|
||
|
};
|
||
|
|
||
|
template <typename T> struct Z {
|
||
|
friend void T::f() {} // expected-error{{friend function definition cannot be qualified with 'T::'}}
|
||
|
};
|
||
|
|
||
|
void local() {
|
||
|
void f();
|
||
|
|
||
|
struct Local {
|
||
|
friend void f() { } // expected-error{{friend function cannot be defined in a local class}}
|
||
|
};
|
||
|
}
|