This is currently copied from http://quickgit.kde.org/index.php?p=scratch%2Fdakon%2Fcmake-cxx11.git but there is a chance that in future it will be merged into CMake proper.
26 lines
378 B
C++
26 lines
378 B
C++
class base {
|
|
public:
|
|
virtual int foo(int a)
|
|
{ return 4 + a; }
|
|
virtual int bar(int a) final
|
|
{ return a - 2; }
|
|
};
|
|
|
|
class sub final : public base {
|
|
public:
|
|
virtual int foo(int a) override
|
|
{ return 8 + 2 * a; };
|
|
virtual int bar(int a)
|
|
{ return a; }
|
|
};
|
|
|
|
class impossible : public sub { };
|
|
|
|
int main(void)
|
|
{
|
|
base b;
|
|
sub s;
|
|
|
|
return 1;
|
|
}
|