Files
swift-mirror/test/ClangImporter/import-as-member.swift
Becca Royal-Gordon 4e0905ae3f Fix rebranch SwiftNameAttr warning regression
A change in the new clang branch seems to have caused it to start applying SwiftNameAttrs to forward declarations. We have apparently always tried to add these forward declarations to the lookup tables in PCH files, but never diagnosed the resulting failures because they did not have SwiftNameAttrs. Now they do, so we started emitting incorrect warnings.

We *probably* don’t need to process these at all, but there’s a risk of unintended behavior changes from that; instead, this commit takes a conservative approach and simply suppresses the warnings like we always have.

Fixes rdar://74710976.
2021-03-01 15:33:05 -08:00

19 lines
858 B
Swift

// RUN: %empty-directory(%t.mcp)
// RUN: not %target-swift-frontend(mock-sdk: %clang-importer-sdk) -enable-objc-interop -typecheck -F %S/Inputs/frameworks -I %S/Inputs/custom-modules -module-cache-path %t.mcp %s >%t.txt 2>&1
// RUN: %FileCheck %S/Inputs/custom-modules/ImportAsMember.h <%t.txt
// RUN: %FileCheck %S/Inputs/custom-modules/ImportAsMember_Private.h <%t.txt
// RUN: %target-swift-frontend(mock-sdk: %clang-importer-sdk) -enable-objc-interop -typecheck -F %S/Inputs/frameworks -I %S/Inputs/custom-modules -module-cache-path %t.mcp %s -verify
import ImportAsMember
import ImportAsMember_Private
import ImportAsMemberSubmodules
let _: IAMSOuter.Inner?
let _: IAMMultipleNested.Inner? // expected-error {{ambiguous type name 'Inner' in 'IAMMultipleNested'}}
func testCreateShadowing(d: Double) -> Struct1 {
return Struct1(x: d, y: d, z: d)
}