brintos

brintos / llvm-project-archived public Read only

0
0
Text · 1.7 KiB · df761d5 Raw
51 lines · cpp
1// RUN: %clang_cc1 -fsyntax-only -verify -fms-extensions %s 2 3extern "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>7  void bar(T t){}8};9 10struct IPropertyPageBase : public IUnknown {};11struct IPropertyPage : public IPropertyPageBase {};12__interface ISfFileIOPropertyPage : public IPropertyPage {};13 14 15namespace 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 21namespace NS2 {22extern "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 {};31struct bad_base : temp_iface {};32// expected-error@+1 {{interface type cannot inherit from}}33__interface bad_inherit : public bad_base{};34 35struct mult_inher_base : temp_iface, IUnknown {};36// expected-error@+1 {{interface type cannot inherit from}}37__interface bad_inherit2 : public mult_inher_base{};38 39struct PageBase : public IUnknown {};40struct Page3 : public PageBase {};41struct Page4 : public PageBase {};42__interface PropertyPage : public Page4 {};43 44struct 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