blob: c965a4c0a1b45d5aef569ad2d509794b3bc996fe [file] [log] [blame]
Erich Keane58bd6032017-09-15 16:03:35 +00001// RUN: %clang_cc1 -fsyntax-only -verify -fms-extensions %s
2
3struct __declspec(uuid("00000000-0000-0000-C000-000000000046")) IUnknown {
4 void foo();
5};
6struct IPropertyPageBase : public IUnknown {};
7struct IPropertyPage : public IPropertyPageBase {};
8__interface ISfFileIOPropertyPage : public IPropertyPage {};
9
10
11namespace NS {
12 struct __declspec(uuid("00000000-0000-0000-C000-000000000046")) IUnknown {};
13 // expected-error@+1 {{interface type cannot inherit from}}
14 __interface IPropertyPageBase : public IUnknown {};
15}
16// expected-error@+1 {{interface type cannot inherit from}}
17__interface IPropertyPageBase2 : public NS::IUnknown {};
18
19__interface temp_iface {};
20struct bad_base : temp_iface {};
21// expected-error@+1 {{interface type cannot inherit from}}
22__interface bad_inherit : public bad_base{};
23
24struct mult_inher_base : temp_iface, IUnknown {};
25// expected-error@+1 {{interface type cannot inherit from}}
26__interface bad_inherit2 : public mult_inher_base{};
27
28struct PageBase : public IUnknown {};
29struct Page3 : public PageBase {};
30struct Page4 : public PageBase {};
31__interface PropertyPage : public Page4 {};
32
33struct Page5 : public Page3, Page4{};
34// expected-error@+1 {{interface type cannot inherit from}}
35__interface PropertyPage2 : public Page5 {};
36
37__interface IF1 {};
38__interface PP : IUnknown, IF1{};
39__interface PP2 : PP, Page3, Page4{};