Added more descriptive message (issue 116808) (#117201)

The dialogue messages were changed to be more descriptive.

Fixes #116808
This commit is contained in:
tlemy 2024-11-22 12:24:17 -05:00 committed by GitHub
parent 39913ae095
commit 61f1dc05a8
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 12 additions and 12 deletions

View File

@ -1728,9 +1728,9 @@ def err_introducing_special_friend : Error<
def err_tagless_friend_type_template : Error<
"friend type templates must use an elaborated type">;
def err_no_matching_local_friend : Error<
"no matching function found in local scope">;
"cannot define friend function in a local class definition">;
def err_no_matching_local_friend_suggest : Error<
"no matching function %0 found in local scope; did you mean %3?">;
"cannot define friend function %0 in a local class definition; did you mean %3?">;
def err_partial_specialization_friend : Error<
"partial specialization cannot be declared as a friend">;
def err_qualified_friend_def : Error<

View File

@ -12,7 +12,7 @@ namespace test0 {
namespace test1 {
void foo() {
class A {
friend void bar(); // expected-error {{no matching function found in local scope}}
friend void bar(); // expected-error {{cannot define friend function in a local class definition}}
};
}
}
@ -22,7 +22,7 @@ namespace test2 {
void foo() { // expected-note 2{{'::test2::foo' declared here}}
struct S1 {
friend void foo(); // expected-error {{no matching function 'foo' found in local scope; did you mean '::test2::foo'?}}
friend void foo(); // expected-error {{cannot define friend function 'foo' in a local class definition; did you mean '::test2::foo'?}}
};
void foo(); // expected-note {{local declaration nearly matches}}
@ -32,24 +32,24 @@ namespace test2 {
{
struct S2 {
friend void foo(); // expected-error {{no matching function found in local scope}}
friend void foo(); // expected-error {{cannot define friend function in a local class definition}}
};
}
{
int foo;
struct S3 {
friend void foo(); // expected-error {{no matching function 'foo' found in local scope; did you mean '::test2::foo'?}}
friend void foo(); // expected-error {{cannot define friend function 'foo' in a local class definition; did you mean '::test2::foo'?}}
};
}
struct S4 {
friend void bar(); // expected-error {{no matching function 'bar' found in local scope; did you mean '::test2::bar'?}}
friend void bar(); // expected-error {{cannot define friend function 'bar' in a local class definition; did you mean '::test2::bar'?}}
};
{ void bar(); }
struct S5 {
friend void bar(); // expected-error {{no matching function 'bar' found in local scope; did you mean '::test2::bar'?}}
friend void bar(); // expected-error {{cannot define friend function 'bar' in a local class definition; did you mean '::test2::bar'?}}
};
{
@ -76,7 +76,7 @@ namespace test2 {
struct S9 {
struct Inner {
friend void baz(); // expected-error {{no matching function 'baz' found in local scope; did you mean 'bar'?}}
friend void baz(); // expected-error {{cannot define friend function 'baz' in a local class definition; did you mean 'bar'?}}
};
};
@ -84,8 +84,8 @@ namespace test2 {
void quux() {}
void foo() {
struct Inner1 {
friend void bar(); // expected-error {{no matching function 'bar' found in local scope; did you mean '::test2::bar'?}}
friend void quux(); // expected-error {{no matching function found in local scope}}
friend void bar(); // expected-error {{cannot define friend function 'bar' in a local class definition; did you mean '::test2::bar'?}}
friend void quux(); // expected-error {{cannot define friend function in a local class definition}}
};
void bar();

View File

@ -46,7 +46,7 @@ namespace test0 {
void dummy() {
void Bar(); // expected-note {{'Bar' declared here}}
class A {
friend void bar(); // expected-error {{no matching function 'bar' found in local scope; did you mean 'Bar'}}
friend void bar(); // expected-error {{cannot define friend function 'bar' in a local class definition; did you mean 'Bar'}}
};
}
}