fail_override_virtual_virtual.carbon 575 B

12345678910111213141516171819202122
  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 {
  11. extend base: A;
  12. // CHECK:STDERR: COMPILATION ERROR: fail_override_virtual_virtual.carbon:[[@LINE+1]]: Error declaring destructor for `B`: use `impl` to implement virtual destructor in child class.
  13. virtual destructor[self: Self]{}
  14. }
  15. fn Main() -> i32 {
  16. return 0;
  17. }