@@ -12,7 +12,7 @@ namespace test0 {
1212namespace test1 {
1313 void foo () {
1414 class A {
15- friend void bar (); // expected-error {{no matching function found in local scope }}
15+ friend void bar (); // expected-error {{cannot define friend function in a local class definition }}
1616 };
1717 }
1818}
@@ -22,7 +22,7 @@ namespace test2 {
2222
2323 void foo () { // expected-note 2{{'::test2::foo' declared here}}
2424 struct S1 {
25- friend void foo (); // expected-error {{no matching function 'foo' found in local scope ; did you mean '::test2::foo'?}}
25+ friend void foo (); // expected-error {{cannot define friend function 'foo' in a local class definition ; did you mean '::test2::foo'?}}
2626 };
2727
2828 void foo (); // expected-note {{local declaration nearly matches}}
@@ -32,24 +32,24 @@ namespace test2 {
3232
3333 {
3434 struct S2 {
35- friend void foo (); // expected-error {{no matching function found in local scope }}
35+ friend void foo (); // expected-error {{cannot define friend function in a local class definition }}
3636 };
3737 }
3838
3939 {
4040 int foo;
4141 struct S3 {
42- friend void foo (); // expected-error {{no matching function 'foo' found in local scope ; did you mean '::test2::foo'?}}
42+ friend void foo (); // expected-error {{cannot define friend function 'foo' in a local class definition ; did you mean '::test2::foo'?}}
4343 };
4444 }
4545
4646 struct S4 {
47- friend void bar (); // expected-error {{no matching function 'bar' found in local scope ; did you mean '::test2::bar'?}}
47+ friend void bar (); // expected-error {{cannot define friend function 'bar' in a local class definition ; did you mean '::test2::bar'?}}
4848 };
4949
5050 { void bar (); }
5151 struct S5 {
52- friend void bar (); // expected-error {{no matching function 'bar' found in local scope ; did you mean '::test2::bar'?}}
52+ friend void bar (); // expected-error {{cannot define friend function 'bar' in a local class definition ; did you mean '::test2::bar'?}}
5353 };
5454
5555 {
@@ -76,16 +76,16 @@ namespace test2 {
7676
7777 struct S9 {
7878 struct Inner {
79- friend void baz (); // expected-error {{no matching function 'baz' found in local scope ; did you mean 'bar'?}}
79+ friend void baz (); // expected-error {{cannot define friend function 'baz' in a local class definition ; did you mean 'bar'?}}
8080 };
8181 };
8282
8383 struct S10 {
8484 void quux () {}
8585 void foo () {
8686 struct Inner1 {
87- friend void bar (); // expected-error {{no matching function 'bar' found in local scope ; did you mean '::test2::bar'?}}
88- friend void quux (); // expected-error {{no matching function found in local scope }}
87+ friend void bar (); // expected-error {{cannot define friend function 'bar' in a local class definition ; did you mean '::test2::bar'?}}
88+ friend void quux (); // expected-error {{cannot define friend function in a local class definition }}
8989 };
9090
9191 void bar ();
0 commit comments