Commit Graph

8 Commits

Author SHA1 Message Date
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
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
Jordan Rose
efa82fcc6c [test] Use new module cache; some diags only occur in module building 2019-10-29 15:55:30 -07:00
Jordan Rose
8168669a27 [ClangImporter] Diagnose bad swift_name attributes better
1. Set the diagnostic location to where the attribute was written (or
   to the Clang decl's source, if the attribute came from API notes)

2. Add a note to contact the owners of the framework to make it clear
   that the client of the framework didn't do anything wrong.

rdar://problem/52736145
2019-10-28 22:08:26 -07:00
Doug Gregor
0ea6536b95 [Name shadowing] Extend Objective-C initializer shadowing to imported inits.
There are multiple ways in which the Clang importer can produce an
initializer, and we have existing name shadowing rules to decide on
the best. Extend those rules to cover the case where a
Clang-importer-synthesized initializer collides with a C function
imported as an initializer. There's technically no reason to do the
latter because the former already exists, but some frameworks
currently depend on this.

Prior to this, the constraint solver was preferring the synthesized
initializer already (which is the right thing to do), for the wrong
reasons.
2019-02-28 09:13:32 -08:00
Saleem Abdulrasool
7606e2b5c5 ClangImporter: improve ObjC-interop and enable tests
This enables additional tests for the ClangImporter.  This found a
missing piece in the `-enable-objc-interop` work that was done
previously.  Address that and enable the tests.  There are now the
following failing tests on Linux:

  * sdk - depends on Foundation (not hermetic, see SR-7572)
  * mixed-nsuinteger - depends on Foundation (not hermetic, see SR-7572)
  * import-mixed-with-header-twice - requires apple/swift PR#16022
  * can_import_objc_idempotent - requires apple/swift PR#16022
  * objc_protocol_renaming - requires apple/swift PR#16022
2018-05-01 18:39:42 -07:00
Jordan Rose
3d428285fa [test] Add a test for two types import-as-member'd with the same name.
Unrelated to the previous commits, but good to Not Crash.
2017-07-17 11:52:48 -07:00
Jordan Rose
701a70d257 [ClangImporter] Filter import-as-member decls by preferred submodule. (#10612)
That is, if a member is redeclarable, use the module of the definition
if possible, and the canonical declaration otherwise. This is
consistent with what we do when we actually import the declaration.
Without this, we can end up dropping declarations.

rdar://problem/32816381
2017-06-27 09:00:47 -07:00