1 //===-- main.cpp ------------------------------------------------*- C++ -*-===// 2 // 3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. 4 // See https://llvm.org/LICENSE.txt for license information. 5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception 6 // 7 //===----------------------------------------------------------------------===// 8 9 class A { 10 public: 11 virtual int foo() { return 1; } 12 virtual ~A () = default; 13 A() = default; 14 }; 15 16 class B : public A { 17 public: 18 virtual int foo() { return 2; } 19 virtual ~B () = default; 20 B() = default; 21 }; 22 23 int main() { 24 A* a = new B(); 25 a->foo(); // break here 26 return 0; // break here 27 } 28 29