Closed RSilicon closed 1 year ago
Hi @AtariDreams, can you please describe the warning instances you are fixing, and the warning flags you used to enable the warnings? I'm having a hard time reproducing any warnings for this file when compiling with clang 15 with -Wall -Weverything -pedantic -Wextra
@dmitrykobets-msft I apologize. This was clang-tidy with these warnings. I also removed the ones that don't matter.
Thanks @AtariDreams,
The compiler will attempt to mark default
-ed move constructors as noexcept
in cases where appropriate. Your modification to always force it to be noexcept
will change the current exception behavior. For instance, if a custom smartpointer type decides to throw on copy, then wrapping it in not_null and using the noexcept
move constructor will call std::terminate
, whereas without the noexcept
, the exception will be propagated.
The other changes look good to me.
I do not see where it can throw on copy or why, but I will take your word on it.
Also default copy constructors do not throw on copy
@dmitrykobets-msft
Edited my earlier comment to hopefully make my noexcept
concern clearer.
These warnings were found by running clang-tidy 15.