Erich Keane | 58bd603 | 2017-09-15 16:03:35 +0000 | [diff] [blame^] | 1 | // RUN: %clang_cc1 -fsyntax-only -verify -fms-extensions %s |
| 2 | |
| 3 | struct __declspec(uuid("00000000-0000-0000-C000-000000000046")) IUnknown { |
| 4 | void foo(); |
| 5 | }; |
| 6 | struct IPropertyPageBase : public IUnknown {}; |
| 7 | struct IPropertyPage : public IPropertyPageBase {}; |
| 8 | __interface ISfFileIOPropertyPage : public IPropertyPage {}; |
| 9 | |
| 10 | |
| 11 | namespace 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 {}; |
| 20 | struct bad_base : temp_iface {}; |
| 21 | // expected-error@+1 {{interface type cannot inherit from}} |
| 22 | __interface bad_inherit : public bad_base{}; |
| 23 | |
| 24 | struct mult_inher_base : temp_iface, IUnknown {}; |
| 25 | // expected-error@+1 {{interface type cannot inherit from}} |
| 26 | __interface bad_inherit2 : public mult_inher_base{}; |
| 27 | |
| 28 | struct PageBase : public IUnknown {}; |
| 29 | struct Page3 : public PageBase {}; |
| 30 | struct Page4 : public PageBase {}; |
| 31 | __interface PropertyPage : public Page4 {}; |
| 32 | |
| 33 | struct 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{}; |