Skip to content

Commit c70bff3

Browse files
authored
Merge pull request #59643 from apple/egorzhdan/cxx-plusplus-void
2 parents 8a4f24e + b901ad2 commit c70bff3

File tree

2 files changed

+1
-8
lines changed

2 files changed

+1
-8
lines changed

lib/ClangImporter/ImportDecl.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2191,11 +2191,7 @@ namespace {
21912191
MD->overwriteAccess(AccessLevel::Private);
21922192
} else if (cxxOperatorKind ==
21932193
clang::OverloadedOperatorKind::OO_PlusPlus) {
2194-
auto selfTy = result->getSelfInterfaceType();
2195-
auto returnTy =
2196-
MD->getResultInterfaceType()->getAnyPointerElementType();
2197-
if (cxxMethod->param_empty() &&
2198-
selfTy->getCanonicalType() == returnTy->getCanonicalType()) {
2194+
if (cxxMethod->param_empty()) {
21992195
// This is a pre-increment operator. We synthesize a
22002196
// non-mutating function called `successor() -> Self`.
22012197
FuncDecl *successorFunc = synthesizer.makeSuccessorFunc(MD);

test/Interop/Cxx/operators/member-inline-typechecker.swift

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,3 @@ let diffTypesResultDoubleByVal: Double = diffTypesArrayByVal[0.5]
4343

4444
let postIncrement = HasPostIncrementOperator()
4545
postIncrement.successor() // expected-error {{value of type 'HasPostIncrementOperator' has no member 'successor'}}
46-
47-
let anotherReturnType = HasPreIncrementOperatorWithAnotherReturnType()
48-
anotherReturnType.successor() // expected-error {{value of type 'HasPreIncrementOperatorWithAnotherReturnType' has no member 'successor'}}

0 commit comments

Comments
 (0)