ARM Cortex M0+ __set_MSP C++17 compiler warning

I do have a working code for jumping from bootloader to application. But now since C++17 the implementation for setting the Master Stack Pointer __set_MSP raises a compiler warning.

Code:

__attribute__( ( always_inline ) ) __STATIC_INLINE void __set_MSP(uint32_t topOfMainStack)
{
  __ASM volatile ("MSR msp, %0\n" : : "r" (topOfMainStack) : "sp");
}

Warning:

warning: listing the stack pointer register 'sp' in a clobber list is deprecated [-Wdeprecated]

My Question is, if it's save to just omit the clobbing entry:

__ASM volatile ("MSR msp, %0\n" : : "r" (topOfMainStack));

The code still works and the application is entered. But I want to be sure that this is not just working by chance.

Thanks a lot!