/
githubmirror
/
cmssw
Обзор
Документация
Войти
/
githubmirror
/
cmssw
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
Utilities/StaticAnalyzers/test/const_cast_away.cpp
16 строк
388 B
Ivan Razumov
Replace MutableMemberChecker with version that checks access to mutable member via const pointer
04 дек 2024, 17:44
04 дек 2024, 17:44
d01e337
Код
Авторство
О чём код?
#include <string> int main() { std::string s = "23"; std::string const& r_const = s; std::string const* p_const = &s; // will produce a warning only by ConstCastAwayChecker std::string& r = (std::string&)(r_const); std::string* p = (std::string*)(p_const); // must not produce a warning std::string const& r_const_again = (std::string const&)(r_const); return 0; }