Skip to content

Commit 490021f

Browse files
committed
Fix: Access NamedDecl::getName() only if the name is an identifier.
Non-identifier names aren't currently an issue, but it will become one when we add more support for C++, e.g. for C++ constructors (which I plan to tackle soon).
1 parent 9f94fd1 commit 490021f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/ClangImporter/ImportDecl.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7680,7 +7680,7 @@ void ClangImporter::Implementation::importAttributes(
76807680
// Ban CFRelease|CFRetain|CFAutorelease(CFTypeRef) as well as custom ones
76817681
// such as CGColorRelease(CGColorRef).
76827682
if (auto FD = dyn_cast<clang::FunctionDecl>(ClangDecl)) {
7683-
if (FD->getNumParams() == 1 &&
7683+
if (FD->getNumParams() == 1 && FD->getDeclName().isIdentifier() &&
76847684
(FD->getName().endswith("Release") ||
76857685
FD->getName().endswith("Retain") ||
76867686
FD->getName().endswith("Autorelease")) &&

0 commit comments

Comments
 (0)