2019-09-01 02:31:19 +08:00
|
|
|
// RUN: %clang_cc1 -fsyntax-only -std=c++11 -verify %s -Wfinal-dtor-non-final-class
|
2019-09-03 18:32:21 +08:00
|
|
|
// RUN: %clang_cc1 -fsyntax-only -std=c++11 %s -Wfinal-dtor-non-final-class -fdiagnostics-parseable-fixits 2>&1 | FileCheck %s
|
2019-09-01 02:31:19 +08:00
|
|
|
|
|
|
|
class A {
|
|
|
|
~A();
|
|
|
|
};
|
|
|
|
|
|
|
|
class B { // expected-note {{mark 'B' as 'final' to silence this warning}}
|
2019-09-03 18:32:21 +08:00
|
|
|
// CHECK: fix-it:"{{.*}}":{[[@LINE-1]]:8-[[@LINE-1]]:8}:" final"
|
2019-09-01 02:31:19 +08:00
|
|
|
virtual ~B() final; // expected-warning {{class with destructor marked 'final' cannot be inherited from}}
|
|
|
|
};
|
|
|
|
|
|
|
|
class C final {
|
|
|
|
virtual ~C() final;
|
|
|
|
};
|