summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/CXX/class.access/class.friend/p11.cpp80
-rw-r--r--clang/test/CXX/special/class.copy/implicit-move.cpp36
-rw-r--r--clang/test/FixIt/typo-crash.cpp2
3 files changed, 99 insertions, 19 deletions
diff --git a/clang/test/CXX/class.access/class.friend/p11.cpp b/clang/test/CXX/class.access/class.friend/p11.cpp
index a05b2d28751..ba44a0d4924 100644
--- a/clang/test/CXX/class.access/class.friend/p11.cpp
+++ b/clang/test/CXX/class.access/class.friend/p11.cpp
@@ -17,3 +17,83 @@ namespace test1 {
};
}
}
+
+namespace test2 {
+ void bar(); // expected-note {{'::test2::bar' declared here}}
+
+ void foo() { // expected-note {{'::test2::foo' declared here}}
+ struct S1 {
+ friend void foo(); // expected-error {{no matching function 'foo' found in local scope; did you mean '::test2::foo'?}}
+ };
+
+ void foo(); // expected-note {{local declaration nearly matches}}
+ struct S2 {
+ friend void foo();
+ };
+
+ {
+ struct S2 {
+ friend void foo(); // expected-error {{no matching function found in local scope}}
+ };
+ }
+
+ {
+ int foo;
+ struct S3 {
+ friend void foo(); // expected-error {{no matching function found in local scope}}
+ };
+ }
+
+ struct S4 {
+ friend void bar(); // expected-error {{no matching function 'bar' found in local scope; did you mean '::test2::bar'?}}
+ };
+
+ { void bar(); }
+ struct S5 {
+ friend void bar(); // expected-error {{no matching function found in local scope}}
+ };
+
+ {
+ void bar();
+ struct S6 {
+ friend void bar();
+ };
+ }
+
+ struct S7 {
+ void bar() { Inner::f(); }
+ struct Inner {
+ friend void bar();
+ static void f() {}
+ };
+ };
+
+ void bar(); // expected-note {{'bar' declared here}}
+ struct S8 {
+ struct Inner {
+ friend void bar();
+ };
+ };
+
+ struct S9 {
+ struct Inner {
+ friend void baz(); // expected-error {{no matching function 'baz' found in local scope; did you mean 'bar'?}}
+ };
+ };
+
+ struct S10 {
+ void quux() {}
+ void foo() {
+ struct Inner1 {
+ friend void bar(); // expected-error {{no matching function found in local scope}}
+ friend void quux(); // expected-error {{no matching function found in local scope}}
+ };
+
+ void bar();
+ struct Inner2 {
+ friend void bar();
+ };
+ }
+ };
+ }
+}
diff --git a/clang/test/CXX/special/class.copy/implicit-move.cpp b/clang/test/CXX/special/class.copy/implicit-move.cpp
index 33374129f71..1941da7e8a8 100644
--- a/clang/test/CXX/special/class.copy/implicit-move.cpp
+++ b/clang/test/CXX/special/class.copy/implicit-move.cpp
@@ -209,29 +209,29 @@ namespace DR1402 {
struct NoMove11 : NonTrivialMoveAssignVBase {}; // expected-note {{'const DR1402::NoMove11 &'}}
struct Test {
- friend NoMove1::NoMove1(NoMove1 &&); // expected-error {{no matching function}}
- friend NoMove2::NoMove2(NoMove2 &&); // expected-error {{no matching function}}
- friend NoMove3::NoMove3(NoMove3 &&); // expected-error {{no matching function}}
- friend NoMove4::NoMove4(NoMove4 &&); // expected-error {{no matching function}}
- friend NoMove5::NoMove5(NoMove5 &&); // expected-error {{no matching function}}
- friend NoMove6::NoMove6(NoMove6 &&); // expected-error {{no matching function}}
- friend NoMove7::NoMove7(NoMove7 &&); // expected-error {{no matching function}}
- friend NoMove8::NoMove8(NoMove8 &&); // expected-error {{no matching function}}
+ friend NoMove1::NoMove1(NoMove1 &&); // expected-error {{does not match}}
+ friend NoMove2::NoMove2(NoMove2 &&); // expected-error {{does not match}}
+ friend NoMove3::NoMove3(NoMove3 &&); // expected-error {{does not match}}
+ friend NoMove4::NoMove4(NoMove4 &&); // expected-error {{does not match}}
+ friend NoMove5::NoMove5(NoMove5 &&); // expected-error {{does not match}}
+ friend NoMove6::NoMove6(NoMove6 &&); // expected-error {{does not match}}
+ friend NoMove7::NoMove7(NoMove7 &&); // expected-error {{does not match}}
+ friend NoMove8::NoMove8(NoMove8 &&); // expected-error {{does not match}}
friend NoMove9::NoMove9(NoMove9 &&);
friend NoMove10::NoMove10(NoMove10 &&);
friend NoMove11::NoMove11(NoMove11 &&);
- friend NoMove1 &NoMove1::operator=(NoMove1 &&); // expected-error {{no matching function}}
- friend NoMove2 &NoMove2::operator=(NoMove2 &&); // expected-error {{no matching function}}
- friend NoMove3 &NoMove3::operator=(NoMove3 &&); // expected-error {{no matching function}}
- friend NoMove4 &NoMove4::operator=(NoMove4 &&); // expected-error {{no matching function}}
- friend NoMove5 &NoMove5::operator=(NoMove5 &&); // expected-error {{no matching function}}
- friend NoMove6 &NoMove6::operator=(NoMove6 &&); // expected-error {{no matching function}}
- friend NoMove7 &NoMove7::operator=(NoMove7 &&); // expected-error {{no matching function}}
- friend NoMove8 &NoMove8::operator=(NoMove8 &&); // expected-error {{no matching function}}
+ friend NoMove1 &NoMove1::operator=(NoMove1 &&); // expected-error {{does not match}}
+ friend NoMove2 &NoMove2::operator=(NoMove2 &&); // expected-error {{does not match}}
+ friend NoMove3 &NoMove3::operator=(NoMove3 &&); // expected-error {{does not match}}
+ friend NoMove4 &NoMove4::operator=(NoMove4 &&); // expected-error {{does not match}}
+ friend NoMove5 &NoMove5::operator=(NoMove5 &&); // expected-error {{does not match}}
+ friend NoMove6 &NoMove6::operator=(NoMove6 &&); // expected-error {{does not match}}
+ friend NoMove7 &NoMove7::operator=(NoMove7 &&); // expected-error {{does not match}}
+ friend NoMove8 &NoMove8::operator=(NoMove8 &&); // expected-error {{does not match}}
friend NoMove9 &NoMove9::operator=(NoMove9 &&);
- friend NoMove10 &NoMove10::operator=(NoMove10 &&); // expected-error {{no matching function}}
- friend NoMove11 &NoMove11::operator=(NoMove11 &&); // expected-error {{no matching function}}
+ friend NoMove10 &NoMove10::operator=(NoMove10 &&); // expected-error {{does not match}}
+ friend NoMove11 &NoMove11::operator=(NoMove11 &&); // expected-error {{does not match}}
};
}
diff --git a/clang/test/FixIt/typo-crash.cpp b/clang/test/FixIt/typo-crash.cpp
index 0ff160e4482..4ea63c542a8 100644
--- a/clang/test/FixIt/typo-crash.cpp
+++ b/clang/test/FixIt/typo-crash.cpp
@@ -26,5 +26,5 @@ namespace PR12297 {
using namespace A::B;
// FIXME: Adding '::PR12297::' is not needed as removing 'A::' is sufficient
- T A::global(); // expected-error {{out-of-line definition of 'global' does not match any declaration in namespace 'PR12297::A'; did you mean '::PR12297::global'?}}
+ T A::global(); // expected-error {{out-of-line declaration of 'global' does not match any declaration in namespace 'PR12297::A'; did you mean '::PR12297::global'?}}
}
OpenPOWER on IntegriCloud