summaryrefslogtreecommitdiffstats
path: root/clang/test/SemaCXX/ms-iunknown-outofline-def.cpp
diff options
context:
space:
mode:
authorErich Keane <erich.keane@intel.com>2017-09-15 16:03:35 +0000
committerErich Keane <erich.keane@intel.com>2017-09-15 16:03:35 +0000
commit58bd603109e4e6ca214712ca897d024bed07ef0f (patch)
treef4864509cdc5bb0e7bdf3502de05b680272f11db /clang/test/SemaCXX/ms-iunknown-outofline-def.cpp
parentf34537dff8e75704d699bca7b6a03a6949c50c61 (diff)
downloadbcm5719-llvm-58bd603109e4e6ca214712ca897d024bed07ef0f.tar.gz
bcm5719-llvm-58bd603109e4e6ca214712ca897d024bed07ef0f.zip
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
Diffstat (limited to 'clang/test/SemaCXX/ms-iunknown-outofline-def.cpp')
-rw-r--r--clang/test/SemaCXX/ms-iunknown-outofline-def.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/clang/test/SemaCXX/ms-iunknown-outofline-def.cpp b/clang/test/SemaCXX/ms-iunknown-outofline-def.cpp
new file mode 100644
index 00000000000..b6e74d0eb60
--- /dev/null
+++ b/clang/test/SemaCXX/ms-iunknown-outofline-def.cpp
@@ -0,0 +1,10 @@
+// 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 {};
OpenPOWER on IntegriCloud