Files
swift-mirror/test/Interop/SwiftToCxx/class/class-api-prohibited.cpp
Alex Lorenz 3a9b6dce9d [interop][SwiftToCxx] add support for emitting Swift stdlib dependency in one header file
This is the default behavior. You can disable this by specifying the -clang-header-expose-decls= flag explicitly when generating the header
2022-09-28 08:08:48 -07:00

13 lines
439 B
C++

// RUN: %empty-directory(%t)
// RUN: %target-swift-frontend %S/swift-class-in-cxx.swift -typecheck -module-name Class -clang-header-expose-decls=all-public -emit-clang-header-path %t/class.h
// RUN: not %target-interop-build-clangxx -c %s -I %t -o %t/swift-class-execution.o
#include "class.h"
void test(void * _Nonnull p) {
// Prohibited to construct class reference directly from opaque pointer.
Class::ClassWithIntField x(p);
}