[MacPorts] #69157: encfs @1.9.5_2: fails to compile on Sonoma: NullCipher.cpp:81:36: error: no matching constructor for initialization of 'std::shared_ptr<AbstractCipherKey>'

MacPorts noreply at macports.org
Mon Jan 22 17:15:05 UTC 2024


#69157: encfs @1.9.5_2: fails to compile on Sonoma: NullCipher.cpp:81:36: error: no
matching constructor for initialization of
'std::shared_ptr<AbstractCipherKey>'
-----------------------+----------------------------
  Reporter:  vidakris  |      Owner:  (none)
      Type:  defect    |     Status:  new
  Priority:  Normal    |  Milestone:  MacPorts 2.9.0
 Component:  ports     |    Version:  2.8.1
Resolution:            |   Keywords:  Sonoma
      Port:  encfs     |
-----------------------+----------------------------

Comment (by kencu):

 ChatGPT:

 It seems like the error is related to the constructor of
 `std::shared_ptr<AbstractCipherKey>`. The code is attempting to create a
 shared pointer with a custom deleter, `NullDestructor()`, but it seems
 there's an issue with the constructor parameters.

 One possible solution could be to use `std::make_shared` instead of the
 direct constructor, and provide the custom deleter as a second argument to
 `std::make_shared`. Here's how you can modify the line:

 ```cpp
 :info:build std::shared_ptr<AbstractCipherKey> gNullKey =
 std::make_shared<NullKey>();
 ```

 This assumes that `NullKey` is a class derived from `AbstractCipherKey`.
 The `std::make_shared` function automatically deduces the type and
 allocates memory for both the object and the control block, which should
 help resolve the issue.

 If `NullKey` does not take any arguments in its constructor, this should
 work. If it does, you may need to provide the necessary arguments within
 the `std::make_shared` call.

-- 
Ticket URL: <https://trac.macports.org/ticket/69157#comment:5>
MacPorts <https://www.macports.org/>
Ports system for macOS


More information about the macports-tickets mailing list