llvm-project/clang/test/SemaCXX/ms-iunknown-outofline-def.cpp
Erich Keane 58bd603109 Fix the __interface inheritence rules to work better with IUnknown and IDispatch
__interface objects in MSVC are permitted to inherit from __interface types, 
and interface-like types.

Additionally, there are two default interface-like types 
(IUnknown and IDispatch) that all interface-like
types must inherit from.

Differential Revision: https://reviews.llvm.org/D37308

llvm-svn: 313364
2017-09-15 16:03:35 +00:00

11 lines
324 B
C++

// RUN: %clang_cc1 -fsyntax-only -verify -fms-extensions %s
struct __declspec(uuid("00000000-0000-0000-C000-000000000046")) IUnknown {
void foo();
};
__interface NoError : public IUnknown {};
void IUnknown::foo() {}
// expected-error@+1{{interface type cannot inherit from}}
__interface HasError : public IUnknown {};