MCPcopy Create free account
hub / github.com/cppcheck-opensource/cppcheck / newPlacementArgsCppInit

Method newPlacementArgsCppInit

test/testtokenize.cpp:8571–8581  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8569 }
8570
8571 void newPlacementArgsCppInit() { // #13775
8572 const char code[] = "::new(nullptr) int {};";
8573 SimpleTokenizer tokenizer(settings1, *this);
8574 tokenizer.tokenize(code);
8575 const Token *inttok = Token::findsimplematch(tokenizer.tokens(), "int");
8576 ASSERT(inttok);
8577 const Token *brace = inttok->next();
8578 ASSERT(brace);
8579 ASSERT_EQUALS(brace->astOperand1(), inttok);
8580 ASSERT_EQUALS(brace->astOperand2(), static_cast<const Token*>(nullptr));
8581 }
8582
8583 void cpp20_default_bitfield_initializer() {
8584 const Settings s1 = settingsBuilder().cpp(Standards::CPP20).build();

Callers

nothing calls this directly

Calls 5

findsimplematchFunction · 0.85
tokenizeMethod · 0.80
nextMethod · 0.80
astOperand1Method · 0.80
astOperand2Method · 0.80

Tested by

no test coverage detected