summaryrefslogtreecommitdiffstats
path: root/clang/test/Parser
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2014-10-02 23:13:51 +0000
committerFariborz Jahanian <fjahanian@apple.com>2014-10-02 23:13:51 +0000
commitb91c5d6a79665c9028f15669dc41b5973b9fd8f8 (patch)
tree10280a0264c8f5e06807e0dd2f2e1f6495886d34 /clang/test/Parser
parenta3f58694b5c0fa2af552d70220da787dc6d7e890 (diff)
downloadbcm5719-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/Parser')
-rw-r--r--clang/test/Parser/MicrosoftExtensions.cpp4
-rw-r--r--clang/test/Parser/cxx0x-decl.cpp4
-rw-r--r--clang/test/Parser/cxx0x-in-cxx98.cpp5
3 files changed, 7 insertions, 6 deletions
diff --git a/clang/test/Parser/MicrosoftExtensions.cpp b/clang/test/Parser/MicrosoftExtensions.cpp
index ee530b8669f..85ccdc5490c 100644
--- a/clang/test/Parser/MicrosoftExtensions.cpp
+++ b/clang/test/Parser/MicrosoftExtensions.cpp
@@ -208,12 +208,12 @@ extern TypenameWrongPlace<AAAA> PR16925;
__interface MicrosoftInterface;
__interface MicrosoftInterface {
- void foo1() = 0;
+ void foo1() = 0; // expected-note {{overridden virtual function is here}}
virtual void foo2() = 0;
};
__interface MicrosoftDerivedInterface : public MicrosoftInterface {
- void foo1();
+ void foo1(); // expected-warning {{'foo1' overrides a member function but is not marked 'override'}}
void foo2() override;
void foo3();
};
diff --git a/clang/test/Parser/cxx0x-decl.cpp b/clang/test/Parser/cxx0x-decl.cpp
index 2cd68252133..9bc60bd35a1 100644
--- a/clang/test/Parser/cxx0x-decl.cpp
+++ b/clang/test/Parser/cxx0x-decl.cpp
@@ -83,13 +83,13 @@ namespace PR5066 {
namespace FinalOverride {
struct Base {
- virtual void *f();
+ virtual void *f(); // expected-note {{overridden virtual function is here}}
virtual void *g();
virtual void *h();
virtual void *i();
};
struct Derived : Base {
- virtual auto f() -> void *final;
+ virtual auto f() -> void *final; // expected-warning {{'f' overrides a member function but is not marked 'override'}}
virtual auto g() -> void *override;
virtual auto h() -> void *final override;
virtual auto i() -> void *override final;
diff --git a/clang/test/Parser/cxx0x-in-cxx98.cpp b/clang/test/Parser/cxx0x-in-cxx98.cpp
index 72499381163..3a63f63291a 100644
--- a/clang/test/Parser/cxx0x-in-cxx98.cpp
+++ b/clang/test/Parser/cxx0x-in-cxx98.cpp
@@ -10,11 +10,12 @@ struct X {
struct B {
virtual void f();
- virtual void g();
+ virtual void g(); // expected-note {{overridden virtual function is here}}
};
struct D final : B { // expected-warning {{'final' keyword is a C++11 extension}}
virtual void f() override; // expected-warning {{'override' keyword is a C++11 extension}}
- virtual void g() final; // expected-warning {{'final' keyword is a C++11 extension}}
+ virtual void g() final; // expected-warning {{'final' keyword is a C++11 extension}} \
+ // expected-warning {{'g' overrides a member function but is not marked 'override'}}
};
void NewBracedInitList() {
OpenPOWER on IntegriCloud