blob: 6cbf3ef15f3c2ebfe41e201d4cd54099cfb60741 [file] [log] [blame]
Sebastian Redl9ba73ad2009-01-09 19:57:06 +00001// RUN: clang -fsyntax-only -verify %s
2
3class 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
11public:
12 A(int);
13};
14
15class 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/*
25A fn(A)
26{
27 A a;
28 static_cast<A>(0);
29 try {
30 } catch(A) {
31 }
32}
33*/