2017-09-16 00:03:35 +08:00
|
|
|
// RUN: %clang_cc1 -fsyntax-only -verify -fms-extensions %s
|
|
|
|
|
2017-09-27 02:55:16 +08:00
|
|
|
extern "C++" struct __declspec(uuid("00000000-0000-0000-C000-000000000046")) IUnknown {
|
2017-09-16 00:03:35 +08:00
|
|
|
void foo();
|
2017-09-30 05:06:00 +08:00
|
|
|
// Definitions aren't allowed, unless they are a template.
|
|
|
|
template<typename T>
|
|
|
|
void bar(T t){}
|
2017-09-16 00:03:35 +08:00
|
|
|
};
|
2017-09-30 05:06:00 +08:00
|
|
|
|
2017-09-16 00:03:35 +08:00
|
|
|
struct IPropertyPageBase : public IUnknown {};
|
|
|
|
struct IPropertyPage : public IPropertyPageBase {};
|
|
|
|
__interface ISfFileIOPropertyPage : public IPropertyPage {};
|
|
|
|
|
|
|
|
|
|
|
|
namespace NS {
|
|
|
|
struct __declspec(uuid("00000000-0000-0000-C000-000000000046")) IUnknown {};
|
|
|
|
// expected-error@+1 {{interface type cannot inherit from}}
|
2017-09-30 05:06:00 +08:00
|
|
|
__interface IPropertyPageBase : public IUnknown {};
|
2017-09-16 00:03:35 +08:00
|
|
|
}
|
2017-09-30 05:06:00 +08:00
|
|
|
|
|
|
|
namespace NS2 {
|
|
|
|
extern "C++" struct __declspec(uuid("00000000-0000-0000-C000-000000000046")) IUnknown {};
|
|
|
|
// expected-error@+1 {{interface type cannot inherit from}}
|
|
|
|
__interface IPropertyPageBase : public IUnknown{};
|
|
|
|
}
|
|
|
|
|
2017-09-16 00:03:35 +08:00
|
|
|
// expected-error@+1 {{interface type cannot inherit from}}
|
2017-09-30 05:06:00 +08:00
|
|
|
__interface IPropertyPageBase2 : public NS::IUnknown {};
|
2017-09-16 00:03:35 +08:00
|
|
|
|
|
|
|
__interface temp_iface {};
|
|
|
|
struct bad_base : temp_iface {};
|
|
|
|
// expected-error@+1 {{interface type cannot inherit from}}
|
|
|
|
__interface bad_inherit : public bad_base{};
|
|
|
|
|
|
|
|
struct mult_inher_base : temp_iface, IUnknown {};
|
|
|
|
// expected-error@+1 {{interface type cannot inherit from}}
|
|
|
|
__interface bad_inherit2 : public mult_inher_base{};
|
|
|
|
|
|
|
|
struct PageBase : public IUnknown {};
|
|
|
|
struct Page3 : public PageBase {};
|
|
|
|
struct Page4 : public PageBase {};
|
|
|
|
__interface PropertyPage : public Page4 {};
|
|
|
|
|
|
|
|
struct Page5 : public Page3, Page4{};
|
|
|
|
// expected-error@+1 {{interface type cannot inherit from}}
|
2017-09-30 05:06:00 +08:00
|
|
|
__interface PropertyPage2 : public Page5 {};
|
2017-09-16 00:03:35 +08:00
|
|
|
|
|
|
|
__interface IF1 {};
|
2017-09-30 05:06:00 +08:00
|
|
|
__interface PP : IUnknown, IF1{};
|
2017-09-16 00:03:35 +08:00
|
|
|
__interface PP2 : PP, Page3, Page4{};
|