summaryrefslogtreecommitdiffstats
path: root/clang/test
diff options
context:
space:
mode:
Diffstat (limited to 'clang/test')
-rw-r--r--clang/test/Parser/cxx-class.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/clang/test/Parser/cxx-class.cpp b/clang/test/Parser/cxx-class.cpp
index 80cd8288011..8698454968e 100644
--- a/clang/test/Parser/cxx-class.cpp
+++ b/clang/test/Parser/cxx-class.cpp
@@ -139,6 +139,16 @@ namespace CtorErrors {
};
}
+namespace BadFriend {
+ struct A {
+ friend int : 3; // expected-error {{friends can only be classes or functions}}
+ friend void f() = 123; // expected-error {{illegal initializer}}
+ friend virtual void f(); // expected-error {{'virtual' is invalid in friend declarations}}
+ friend void f() final; // expected-error {{'final' is invalid in friend declarations}}
+ friend void f() override; // expected-error {{'override' is invalid in friend declarations}}
+ };
+}
+
// PR11109 must appear at the end of the source file
class pr11109r3 { // expected-note{{to match this '{'}}
public // expected-error{{expected ':'}} expected-error{{expected '}'}} expected-error{{expected ';' after class}}
OpenPOWER on IntegriCloud