Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions lib/ClangImporter/ImportDecl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2544,15 +2544,6 @@ namespace {
// constructor available in Swift.
ConstructorDecl *defaultCtor =
synthesizer.createDefaultConstructor(result);
if (cxxRecordDecl) {
auto attr = AvailableAttr::createUniversallyDeprecated(
defaultCtor->getASTContext(),
"This zero-initializes the backing memory of the struct, which "
"is unsafe for some C++ structs. Consider adding an explicit "
"default initializer for this C++ struct.",
"");
defaultCtor->getAttrs().add(attr);
}
ctors.push_back(defaultCtor);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@
// CHECK-NEXT: public func getCopyCounter() -> UnsafeMutablePointer<Int32>
// CHECK-NEXT: public struct CopyTrackedBaseClass {
// CHECK-NEXT: public init(_ x: Int32)
// CHECK-NEXT: @available(*, deprecated, message: "This zero-initializes the backing memory of the struct, which is unsafe for some C++ structs. Consider adding an explicit default initializer for this C++ struct.")
// CHECK-NEXT: @_transparent public init()
// CHECK-NEXT: @discardableResult
// CHECK-NEXT: public func getX() -> Int32
Expand All @@ -147,7 +146,6 @@

// CHECK-NEXT: public struct CopyTrackedDerivedClass {
// CHECK-NEXT: public init(_ x: Int32)
// CHECK-NEXT: @available(*, deprecated, message: "This zero-initializes the backing memory of the struct, which is unsafe for some C++ structs. Consider adding an explicit default initializer for this C++ struct.")
// CHECK-NEXT: @_transparent public init()
// CHECK-NEXT: @discardableResult
// CHECK-NEXT: public func getDerivedX() -> Int32
Expand All @@ -167,7 +165,6 @@

// CHECK-NEXT: public struct CopyTrackedDerivedDerivedClass {
// CHECK-NEXT: public init(_ x: Int32)
// CHECK-NEXT: @available(*, deprecated, message: "This zero-initializes the backing memory of the struct, which is unsafe for some C++ structs. Consider adding an explicit default initializer for this C++ struct.")
// CHECK-NEXT: @_transparent public init()
// CHECK-NEXT: @discardableResult
// CHECK-NEXT: public func getY() -> Int32
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@

import Darwin

_ = pthread_mutexattr_t() // expected-warning {{'init()' is deprecated: This zero-initializes the backing memory of the struct}}
_ = pthread_mutexattr_t()
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
// The `init<T>` constructor template is not yet supported in Swift.

// CHECK: struct HasConstructorWithEnableIf {
// CHECK-NEXT: @available(*, deprecated, message: "This zero-initializes the backing memory of the struct, which is unsafe for some C++ structs. Consider adding an explicit default initializer for this C++ struct.")
// CHECK-NEXT: init()
// CHECK-NEXT:}

Expand Down