fail_override_virtual_virtual.carbon 600 B

123456789101112131415161718192021
  1. // Part of the Carbon Language project, under the Apache License v2.0 with LLVM
  2. // Exceptions. See /LICENSE for license information.
  3. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  4. //
  5. // AUTOUPDATE
  6. package ExplorerTest api;
  7. base class A {
  8. virtual destructor[self: Self]{}
  9. }
  10. class B extends A {
  11. // CHECK:STDERR: COMPILATION ERROR: explorer/testdata/destructor/fail_override_virtual_virtual.carbon:[[@LINE+1]]: Error declaring destructor for `B`: use `impl` to implement virtual destructor in child class.
  12. virtual destructor[self: Self]{}
  13. }
  14. fn Main() -> i32 {
  15. return 0;
  16. }