mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
When constructing SwiftLookupTable at clang module creation time, calls to `clang::Sema::LookupName` will fail in C++ mode (including ObjC++). The specific reason is that `clangSema.TUScope` (which we are passing in as a Scope) is `nullptr` as we have no active Parser. The C++ path in `clang::Sema::LookupName` is set to fail early and hard when the Scope passed in is nullptr. In most, if not all, calls to `LookupName`, we care about ObjC symbols and not C++ names. For example, the motivation behind this issue is that ObjC protocols are not being renamed when there is an ObjC class with the same name, leading to compilation failures.
13 lines
551 B
Swift
13 lines
551 B
Swift
// RUN: %target-swift-ide-test -print-module -module-to-print=ProtocolNamingConflict -I %S/Inputs -source-filename=x -enable-experimental-cxx-interop -enable-objc-interop | %FileCheck -check-prefix=CHECK-IDE-TEST %s
|
|
// RUN: %swift-frontend -c -enable-experimental-cxx-interop -enable-objc-interop -I %S/Inputs %s -emit-sil -o - | %FileCheck %s
|
|
|
|
// REQUIRES: objc_interop
|
|
|
|
import ProtocolNamingConflict
|
|
|
|
// CHECK: class Thing : FooProtocol
|
|
// CHECK-IDE-TEST: protocol FooProtocol
|
|
// CHECK-IDE-TEST: class Foo : FooProtocol
|
|
class Thing: FooProtocol {
|
|
}
|