diff options
| author | Fariborz Jahanian <fjahanian@apple.com> | 2014-10-02 23:13:51 +0000 |
|---|---|---|
| committer | Fariborz Jahanian <fjahanian@apple.com> | 2014-10-02 23:13:51 +0000 |
| commit | b91c5d6a79665c9028f15669dc41b5973b9fd8f8 (patch) | |
| tree | 10280a0264c8f5e06807e0dd2f2e1f6495886d34 /clang/test/SemaCXX/cxx98-compat.cpp | |
| parent | a3f58694b5c0fa2af552d70220da787dc6d7e890 (diff) | |
| download | bcm5719-llvm-b91c5d6a79665c9028f15669dc41b5973b9fd8f8.tar.gz bcm5719-llvm-b91c5d6a79665c9028f15669dc41b5973b9fd8f8.zip | |
Patch to warn if 'override' is missing
for an overriding method if class has at least one
'override' specified on one of its methods.
Reviewed by Doug Gregor. rdar://18295240
(I have already checked in all llvm files with missing 'override'
methods and Bob Wilson has fixed a TableGen of FastISel so
no warnings are expected from build of llvm after this patch.
I have already verified this).
llvm-svn: 218925
Diffstat (limited to 'clang/test/SemaCXX/cxx98-compat.cpp')
| -rw-r--r-- | clang/test/SemaCXX/cxx98-compat.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/clang/test/SemaCXX/cxx98-compat.cpp b/clang/test/SemaCXX/cxx98-compat.cpp index 029e9098962..7c6b408b6c5 100644 --- a/clang/test/SemaCXX/cxx98-compat.cpp +++ b/clang/test/SemaCXX/cxx98-compat.cpp @@ -120,11 +120,12 @@ struct InClassInit { struct OverrideControlBase { virtual void f(); - virtual void g(); + virtual void g(); // expected-note {{overridden virtual function is here}} }; struct OverrideControl final : OverrideControlBase { // expected-warning {{'final' keyword is incompatible with C++98}} virtual void f() override; // expected-warning {{'override' keyword is incompatible with C++98}} - virtual void g() final; // expected-warning {{'final' keyword is incompatible with C++98}} + virtual void g() final; // expected-warning {{'final' keyword is incompatible with C++98}} \ + // expected-warning {{'g' overrides a member function but is not marked 'override'}} }; using AliasDecl = int; // expected-warning {{alias declarations are incompatible with C++98}} |

