Debian Codegraph @

clang/test/SemaObjCXX/abstract-class-type-ivar.mm

raw
1 // RUN: %clang_cc1 -fsyntax-only -verify -Wno-objc-root-class %s
2
3 class CppAbstractBase {
4 public:
5 virtual void testA() = 0;
6 virtual void testB() = 0; // expected-note {{unimplemented pure virtual method 'testB' in 'CppConcreteSub}}
7 int a;
8 };
9
10 class CppConcreteSub : public CppAbstractBase {
11 virtual void testA() { }
12 };
13
14 @interface Objc {
15 CppConcreteSub _concrete; // expected-error{{instance variable type 'CppConcreteSub' is an abstract class}}
16 }
17 - (CppAbstractBase*)abstract;
18 @property (nonatomic, readonly) const CppConcreteSub Prop; // expected-note {{property declared here}}
19 @end
20
21 @implementation Objc
22 - (CppAbstractBase*)abstract {
23 return &_concrete;
24 }
25 @synthesize Prop; // expected-error {{synthesized instance variable type 'const CppConcreteSub' is an abstract class}}
26 @end
27
28 class Cpp {
29 public:
30 CppConcreteSub sub; // expected-error {{field type 'CppConcreteSub' is an abstract class}}
31 };