1 // RUN: %clang_cc1 -fsyntax-only -verify -fms-extensions %s 2 3 extern "C++" struct __declspec(uuid("00000000-0000-0000-C000-000000000046")) IUnknown { 4 void foo(); 5 // Definitions aren't allowed, unless they are a template. 6 template<typename T> barIUnknown7 void bar(T t){} 8 }; 9 10 struct IPropertyPageBase : public IUnknown {}; 11 struct IPropertyPage : public IPropertyPageBase {}; 12 __interface ISfFileIOPropertyPage : public IPropertyPage {}; 13 14 15 namespace NS { 16 struct __declspec(uuid("00000000-0000-0000-C000-000000000046")) IUnknown {}; 17 // expected-error@+1 {{interface type cannot inherit from}} 18 __interface IPropertyPageBase : public IUnknown {}; 19 } 20 21 namespace NS2 { 22 extern "C++" struct __declspec(uuid("00000000-0000-0000-C000-000000000046")) IUnknown {}; 23 // expected-error@+1 {{interface type cannot inherit from}} 24 __interface IPropertyPageBase : public IUnknown{}; 25 } 26 27 // expected-error@+1 {{interface type cannot inherit from}} 28 __interface IPropertyPageBase2 : public NS::IUnknown {}; 29 30 __interface temp_iface {}; 31 struct bad_base : temp_iface {}; 32 // expected-error@+1 {{interface type cannot inherit from}} 33 __interface bad_inherit : public bad_base{}; 34 35 struct mult_inher_base : temp_iface, IUnknown {}; 36 // expected-error@+1 {{interface type cannot inherit from}} 37 __interface bad_inherit2 : public mult_inher_base{}; 38 39 struct PageBase : public IUnknown {}; 40 struct Page3 : public PageBase {}; 41 struct Page4 : public PageBase {}; 42 __interface PropertyPage : public Page4 {}; 43 44 struct Page5 : public Page3, Page4{}; 45 // expected-error@+1 {{interface type cannot inherit from}} 46 __interface PropertyPage2 : public Page5 {}; 47 48 __interface IF1 {}; 49 __interface PP : IUnknown, IF1{}; 50 __interface PP2 : PP, Page3, Page4{}; 51