]> granicus.if.org Git - clang/commitdiff
Add test for [dcl.attr.final]p4.
authorAnders Carlsson <andersca@mac.com>
Sun, 17 Oct 2010 22:47:44 +0000 (22:47 +0000)
committerAnders Carlsson <andersca@mac.com>
Sun, 17 Oct 2010 22:47:44 +0000 (22:47 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116691 91177308-0d34-0410-b5e6-96231b3b80d8

test/CXX/dcl.dcl/dcl.attr/dcl.attr.final/p4.cpp [new file with mode: 0644]

diff --git a/test/CXX/dcl.dcl/dcl.attr/dcl.attr.final/p4.cpp b/test/CXX/dcl.dcl/dcl.attr/dcl.attr.final/p4.cpp
new file mode 100644 (file)
index 0000000..cac3624
--- /dev/null
@@ -0,0 +1,15 @@
+// RUN: %clang_cc1 -std=c++0x -fsyntax-only -verify %s
+
+struct B1 {
+  [[final]] virtual void f(); // expected-note {{overridden virtual function is here}}
+};
+
+struct D1 : B1 {
+  void f(); // expected-error {{declaration of 'f' overrides a 'final' function}}
+};
+
+struct [[final]] B2 { // expected-note {{'B2' declared here}}
+};
+
+struct D2 : B2 { // expected-error {{derivation from 'final' struct B2}}
+};