Skip to content

Commit 38658a0

Browse files
committed
[cxx-interop] Fix test for linux; bail if we didn't load the overlay.
1 parent ffec6a2 commit 38658a0

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

lib/Sema/CSDiagnostics.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3767,6 +3767,10 @@ void MissingMemberFailure::diagnoseUnsafeCxxMethod(SourceLoc loc,
37673767
auto conformsToRACollection = [&](auto baseType) {
37683768
auto raCollectionProto =
37693769
ctx.getProtocol(KnownProtocolKind::CxxRandomAccessCollection);
3770+
// We didn't load the overlay.
3771+
if (raCollectionProto == nullptr)
3772+
return false;
3773+
37703774
SmallVector<ProtocolConformance *, 2> scratch;
37713775
return baseType->getAnyNominal()->lookupConformance(raCollectionProto,
37723776
scratch);

test/Interop/Cxx/class/fixits-for-std-vector.swift

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
// TODO: why can't we run this on linux?
2-
// REQUIRES: OS=macosx
3-
41
// RUN: rm -rf %t
52
// RUN: split-file %s %t
63
// RUN: not %target-swift-frontend -typecheck -I %t/Inputs %t/test.swift -enable-experimental-cxx-interop 2>&1 | %FileCheck %s
74

5+
// REQUIRES: OS=macosx || OS=linux-gnu
6+
87
//--- Inputs/module.modulemap
98
module Test {
109
header "test.h"
@@ -19,7 +18,7 @@ using V = std::vector<int>;
1918
//--- test.swift
2019

2120
import Test
22-
import CxxStdlib.vector
21+
import CxxStdlib
2322

2423
public func test(v: V) {
2524
// CHECK: note: C++ method 'begin' that returns an iterator is unavailable

0 commit comments

Comments
 (0)