Files
swift-mirror/test/Interop/Cxx/reference/reference-cannot-import-diagnostic.swift
Henrik G. Olsson cbc0ec3b88 Add -verify-ignore-unrelated where necessary (NFC)
These are tests that fail in the next commit without this flag. This
does not add -verify-ignore-unrelated to all tests with -verify, only
the ones that would fail without it. This is NFC since this flag is
currently a no-op.
2025-10-04 14:19:52 -07:00

31 lines
829 B
Swift

// RUN: rm -rf %t
// RUN: split-file %s %t
// RUN: %target-swift-frontend -typecheck -verify -verify-ignore-unrelated -I %t/Inputs %t/test.swift -enable-experimental-cxx-interop
// RUN: not %target-swift-frontend -typecheck -I %t/Inputs %t/test.swift -enable-experimental-cxx-interop 2>&1 | %FileCheck %s
//--- Inputs/module.modulemap
module Test {
header "test.h"
requires cplusplus
}
//--- Inputs/test.h
void acceptRValueRef(int &&);
template<class T>
void notStdMove(T &&);
//--- test.swift
import Test
public func test() {
var x: CInt = 2
acceptRValueRef(consuming: x)
notStdMove(x) // expected-error {{cannot find 'notStdMove' in scope}}
// CHECK: note: function 'notStdMove' unavailable (cannot import)
// CHECK: note: C++ functions with rvalue reference parameters are unavailable in Swift
}