parent
2c54f31bfe
commit
b26b78b86d
|
@ -1588,7 +1588,8 @@ namespace {
|
|||
if (op1 && op1->exprId() == 0)
|
||||
return;
|
||||
const Token* op2 = tok->astParent()->astOperand2();
|
||||
if (op2 && op2->exprId() == 0 && !(isLambdaCaptureList(op2) || (op2->str() == "(" && isLambdaCaptureList(op2->astOperand1()))))
|
||||
if (op2 && op2->exprId() == 0 &&
|
||||
!(isLambdaCaptureList(op2) || (op2->str() == "(" && isLambdaCaptureList(op2->astOperand1())) || Token::simpleMatch(op2, "{ }")))
|
||||
return;
|
||||
|
||||
if (tok->astParent()->isExpandedMacro() || Token::Match(tok->astParent(), "++|--")) {
|
||||
|
|
|
@ -3980,6 +3980,18 @@ private:
|
|||
const char expected3[] = "1: struct S { int * p ; } ;\n"
|
||||
"2: S f ( ) { return S@UNIQUE {@UNIQUE std ::@UNIQUE make_unique < int > (@UNIQUE [ ] ( ) { return 4 ; } ( ) ) .@UNIQUE release (@UNIQUE ) } ; }\n";
|
||||
ASSERT_EQUALS(expected3, tokenizeExpr(code3));
|
||||
|
||||
const char code4[] = "std::unique_ptr<int> g(int i) { return std::make_unique<int>(i); }\n"
|
||||
"void h(int*);\n"
|
||||
"void f() {\n"
|
||||
" h(g({}).get());\n"
|
||||
"}\n";
|
||||
const char expected4[] = "1: std :: unique_ptr < int > g ( int i ) { return std ::@UNIQUE make_unique < int > (@UNIQUE i@1 ) ; }\n"
|
||||
"2: void h ( int * ) ;\n"
|
||||
"3: void f ( ) {\n"
|
||||
"4: h (@UNIQUE g (@UNIQUE { } ) .@UNIQUE get (@UNIQUE ) ) ;\n"
|
||||
"5: }\n";
|
||||
ASSERT_EQUALS(expected4, tokenizeExpr(code4));
|
||||
}
|
||||
|
||||
void structuredBindings() {
|
||||
|
|
Loading…
Reference in New Issue