diff options
| author | Richard Smith <richard-llvm@metafoo.co.uk> | 2014-08-12 00:22:39 +0000 |
|---|---|---|
| committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2014-08-12 00:22:39 +0000 |
| commit | 3d1a94c6a63692541896a42388a4c08efbd59959 (patch) | |
| tree | 4640bb1eebc86f5d6516c4a72817efc4ba0383da /clang/test | |
| parent | 3ae6e1528a29a0c717d2f2c6a63e9dcb67731cd7 (diff) | |
| download | bcm5719-llvm-3d1a94c6a63692541896a42388a4c08efbd59959.tar.gz bcm5719-llvm-3d1a94c6a63692541896a42388a4c08efbd59959.zip | |
Reject virt-specifiers on friend declarations. Give anonymous bitfields a
location so their diagnostics have somewhere to point.
llvm-svn: 215416
Diffstat (limited to 'clang/test')
| -rw-r--r-- | clang/test/Parser/cxx-class.cpp | 10 |
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}} |

