From: Anders Carlsson Date: Sun, 17 Oct 2010 22:47:44 +0000 (+0000) Subject: Add test for [dcl.attr.final]p4. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7759919062b4e773791f1b49dabf0a509c4a7406;p=clang Add test for [dcl.attr.final]p4. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@116691 91177308-0d34-0410-b5e6-96231b3b80d8 --- 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 index 0000000000..cac362409a --- /dev/null +++ b/test/CXX/dcl.dcl/dcl.attr/dcl.attr.final/p4.cpp @@ -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}} +};