1 #ifndef BASIC_H 2 #define BASIC_H 3 4 5 class Parent { 6 public: func()7 virtual void func() {} 8 }; 9 10 class Derived : public Parent { 11 public: func()12 virtual void func() {} 13 // CHECK: virtual void func() override {} 14 }; 15 16 extern void ext(int (&)[5], const Parent &); 17 func(int t)18void func(int t) { 19 int ints[5]; 20 for (unsigned i = 0; i < 5; ++i) { 21 int &e = ints[i]; 22 e = t; 23 // CHECK: for (auto & elem : ints) { 24 // CHECK-NEXT: elem = t; 25 } 26 27 Derived d; 28 29 ext(ints, d); 30 } 31 32 #endif // BASIC_H 33