| 476 | |
| 477 | template<size_t size> |
| 478 | Result isUsedAsBool(const char (&code)[size], const char pattern[]) { |
| 479 | SimpleTokenizer tokenizer(settingsDefault, *this); |
| 480 | if (!tokenizer.tokenize(code)) |
| 481 | return Result::Fail; |
| 482 | const Token * const argtok = Token::findmatch(tokenizer.tokens(), pattern); |
| 483 | if (!argtok) |
| 484 | return Result::Fail; |
| 485 | return ::isUsedAsBool(argtok, settingsDefault) ? Result::True : Result::False; |
| 486 | } |
| 487 | |
| 488 | void isUsedAsBool() { |
| 489 | ASSERT(Result::True == isUsedAsBool("void f() { bool b = true; }", "b")); |
nothing calls this directly
no test coverage detected