Add test for [dcl.attr.final]p4.

llvm-svn: 116691
This commit is contained in:
Anders Carlsson 2010-10-17 22:47:44 +00:00
parent dd36defda7
commit fa9de26518
1 changed files with 15 additions and 0 deletions

View File

@ -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}}
};