| 2048 | #define checkOldStylePointerCast(...) checkOldStylePointerCast_(__FILE__, __LINE__, __VA_ARGS__) |
| 2049 | template<size_t size> |
| 2050 | void checkOldStylePointerCast_(const char* file, int line, const char (&code)[size], Standards::cppstd_t std = Standards::CPPLatest) { |
| 2051 | |
| 2052 | const Settings settings = settingsBuilder().severity(Severity::warning).severity(Severity::style).cpp(std).build(); |
| 2053 | |
| 2054 | // Tokenize.. |
| 2055 | SimpleTokenizer tokenizerCpp(settings, *this); |
| 2056 | ASSERT_LOC(tokenizerCpp.tokenize(code), file, line); |
| 2057 | |
| 2058 | CheckOtherImpl checkOtherCpp(&tokenizerCpp, settings, *this); |
| 2059 | checkOtherCpp.warningOldStylePointerCast(); |
| 2060 | checkOtherCpp.warningDangerousTypeCast(); |
| 2061 | } |
| 2062 | |
| 2063 | void oldStylePointerCast() { |
| 2064 | checkOldStylePointerCast("class Base{};\n" |
nothing calls this directly
no test coverage detected