summaryrefslogtreecommitdiffstats
path: root/clang/test/CXX/class.derived
diff options
context:
space:
mode:
authorAnders Carlsson <andersca@mac.com>2011-01-20 16:25:36 +0000
committerAnders Carlsson <andersca@mac.com>2011-01-20 16:25:36 +0000
commit3f610c75de545d04cf016465f497ce9ae5ca9af6 (patch)
tree0720efc882a369629c5c02fff55b4cac8187dc77 /clang/test/CXX/class.derived
parent11b293b30415b4cc6c958e6238b162faee29245e (diff)
downloadbcm5719-llvm-3f610c75de545d04cf016465f497ce9ae5ca9af6.tar.gz
bcm5719-llvm-3f610c75de545d04cf016465f497ce9ae5ca9af6.zip
Diagnose when a virtual member function marked final is overridden.
llvm-svn: 123916
Diffstat (limited to 'clang/test/CXX/class.derived')
-rw-r--r--clang/test/CXX/class.derived/class.virtual/p3-0x.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/clang/test/CXX/class.derived/class.virtual/p3-0x.cpp b/clang/test/CXX/class.derived/class.virtual/p3-0x.cpp
index d49d06cbddb..4bd9efda1f6 100644
--- a/clang/test/CXX/class.derived/class.virtual/p3-0x.cpp
+++ b/clang/test/CXX/class.derived/class.virtual/p3-0x.cpp
@@ -40,3 +40,14 @@ template struct B<int, char, int>;
template struct B<int>; // expected-note {{in instantiation of template class 'Test3::B<int>' requested here}}
}
+
+namespace Test4 {
+struct B {
+ virtual void f() const final; // expected-note {{overridden virtual function is here}}
+};
+
+struct D : B {
+ void f() const; // expected-error {{declaration of 'f' overrides a 'final' function}}
+};
+
+}
OpenPOWER on IntegriCloud