diff options
author | Anders Carlsson <andersca@mac.com> | 2009-03-24 01:19:16 +0000 |
---|---|---|
committer | Anders Carlsson <andersca@mac.com> | 2009-03-24 01:19:16 +0000 |
commit | 8211effbd3abc5948a5d6924c87e72323016a376 (patch) | |
tree | e7a78360e3482db52dc96d9e4af335b59e24df4a /test | |
parent | 42edd0d32a729d2735a6fb152ba6bf349bf0a169 (diff) |
More work on diagnosing abstract classes. We can now handle cases like
class C {
void g(C c);
virtual void f() = 0;
};
In this case, C is not known to be abstract when doing semantic analysis on g. This is done by recursively traversing the abstract class and checking the types of member functions.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@67594 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'test')
-rw-r--r-- | test/SemaCXX/abstract.cpp | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/test/SemaCXX/abstract.cpp b/test/SemaCXX/abstract.cpp index 08baacc49d..9c8e2dc977 100644 --- a/test/SemaCXX/abstract.cpp +++ b/test/SemaCXX/abstract.cpp @@ -51,4 +51,16 @@ void t5(void (*)(C)); // expected-error {{parameter type 'C' is an abstract clas typedef void (*Func)(C); // expected-error {{parameter type 'C' is an abstract class}} void t6(Func); - +class F { + F a() { } // expected-error {{return type 'F' is an abstract class}} + + class D { + void f(F c); // expected-error {{parameter type 'F' is an abstract class}} + }; + + union U { + void u(F c); // expected-error {{parameter type 'F' is an abstract class}} + }; + + virtual void f() = 0; // expected-note {{pure virtual function 'f'}} +}; |