Sebastian Redl | 9ba73ad | 2009-01-09 19:57:06 +0000 | [diff] [blame] | 1 | // RUN: clang -fsyntax-only -verify %s |
| 2 | |
| 3 | class A { |
| 4 | virtual void f(); |
| 5 | virtual void g() = 0; |
| 6 | |
| 7 | void h() = 0; // expected-error {{'h' is not virtual and cannot be declared pure}} |
| 8 | void i() = 1; // expected-error {{initializer on function does not look like a pure-specifier}} |
| 9 | void j() = 0u; // expected-error {{initializer on function does not look like a pure-specifier}} |
| 10 | |
| 11 | public: |
| 12 | A(int); |
| 13 | }; |
| 14 | |
| 15 | class B : public A { |
| 16 | // Needs to recognize that overridden function is virtual. |
| 17 | //void g() = 0; |
| 18 | |
| 19 | // Needs to recognize that function does not override. |
| 20 | //void g(int) = 0; |
| 21 | }; |
| 22 | |
| 23 | // Needs to recognize invalid uses of abstract classes. |
| 24 | /* |
| 25 | A fn(A) |
| 26 | { |
| 27 | A a; |
| 28 | static_cast<A>(0); |
| 29 | try { |
| 30 | } catch(A) { |
| 31 | } |
| 32 | } |
| 33 | */ |