mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-03 09:46:54 +02:00
[Analyzers][CPP] Turn on rule 26497 (#23119)
* Turn on warning 26497 This function function-name could be marked constexpr if compile-time evaluation is desired. * C++20 has constexpr swap * as constexpr is not only for compile time, make all functions that can be constexpr constexpr * constexpr functions are implicity inline
This commit is contained in:
@@ -206,7 +206,7 @@ void notifications::show_toast(std::wstring message, std::wstring title, toast_p
|
||||
show_toast_with_activations(std::move(message), std::move(title), {}, {}, std::move(params));
|
||||
}
|
||||
|
||||
inline void xml_escape(std::wstring data)
|
||||
constexpr inline void xml_escape(std::wstring data)
|
||||
{
|
||||
std::wstring buffer;
|
||||
buffer.reserve(data.size());
|
||||
|
||||
@@ -4,8 +4,9 @@
|
||||
#include <Windows.h>
|
||||
|
||||
// disable warning 26471 - Don't use reinterpret_cast. A cast from void* can use static_cast
|
||||
// Disable 26497 for winrt - This function function-name could be marked constexpr if compile-time evaluation is desired.
|
||||
#pragma warning(push)
|
||||
#pragma warning(disable: 26471)
|
||||
#pragma warning(disable : 26471 26497)
|
||||
#include <wil/resource.h>
|
||||
#pragma warning(pop)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user