Anders Carlsson | 2174d4c | 2011-05-06 14:25:31 +0000 | [diff] [blame] | 1 | // RUN: %clang_cc1 %s -fsyntax-only -verify |
| 2 | struct A { |
| 3 | A() { f(); } // expected-warning {{call to pure virtual member function 'f'; overrides of 'f' in subclasses are not available in the constructor of 'A'}} |
| 4 | ~A() { f(); } // expected-warning {{call to pure virtual member function 'f'; overrides of 'f' in subclasses are not available in the destructor of 'A'}} |
| 5 | |
| 6 | virtual void f() = 0; // expected-note 2 {{'f' declared here}} |
| 7 | }; |
Chandler Carruth | ae19806 | 2011-06-27 08:31:58 +0000 | [diff] [blame^] | 8 | |
| 9 | // Don't warn (or note) when calling the function on a pointer. (PR10195) |
| 10 | struct B { |
| 11 | A *a; |
| 12 | B() { a->f(); }; |
| 13 | ~B() { a->f(); }; |
| 14 | }; |