How to import private key of a P2SH-P2PKH address to Bitcoincore 0.18.0? I have a privkey of a P2SH-P2PKH address, how to import it to Bitcoin core 0.18.0? In previous versions, I could call importprivatekey and then addwitnessaddress but the addwitnessaddress was removed.

Edit: seems like Bitcoin core 0.18.0 auto calls addwitnessaddress when I use 'importprivatekey' but I found no official documentation of that.
Since Bitcoin Core 0.16, every private key gives rise to a supported P2PKH (1...), P2SH-P2WPKH (3...), and P2WPKH (bc1...) address.

All you need to do is import the private key with importprivkey; the corresponding segwit address will automatically be supported.

A more reliable method is using importmulti, where you specify the address you want together with the private key; if they mismatch, or information is missing, it will complain (since 0.18).