Skip to content

Commit 5a78330

Browse files
committed
[ClangImporter] Check for API-note-provided attributes by source loc
...rather than by whether they're implicit. We're planning to make them explicit (prompted by a change in upstream Clang that no longer prints implicit attributes). rdar://problem/40346997 (Swift side)
1 parent e840330 commit 5a78330

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

lib/ClangImporter/ImportName.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -682,9 +682,9 @@ findSwiftNameAttr(const clang::Decl *decl, ImportNameVersion version) {
682682
auto attr = decl->getAttr<clang::SwiftNameAttr>();
683683
if (!attr) return nullptr;
684684

685-
// API notes produce implicit attributes; ignore them because they weren't
686-
// used for naming in Swift 2.
687-
if (attr->isImplicit()) return nullptr;
685+
// API notes produce attributes with no source location; ignore them because
686+
// they weren't used for naming in Swift 2.
687+
if (attr->getLocation().isInvalid()) return nullptr;
688688

689689
// Hardcode certain kinds of explicitly-written Swift names that were
690690
// permitted and used in Swift 2. All others are ignored, so that we are

0 commit comments

Comments
 (0)