Skip to content

Commit d6495e0

Browse files
authored
Appending mangledNameHash to AstNode identifier. (#438)
1 parent 3aa96a7 commit d6495e0

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

plugins/cpp/model/include/model/cppastnode.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,6 +183,7 @@ inline std::uint64_t createIdentifier(const CppAstNode& astNode_)
183183

184184
res
185185
.append(astNode_.astValue).append(":")
186+
.append(std::to_string(astNode_.mangledNameHash)).append(":")
186187
.append(std::to_string(
187188
static_cast<SymbolTypeInt>(astNode_.symbolType))).append(":")
188189
.append(std::to_string(

plugins/cpp/test/src/cppparsertest.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -357,10 +357,11 @@ TEST_F(CppParserTest, Record)
357357
{
358358
case -1:
359359
EXPECT_TRUE(
360-
// Compiler generated assignment operator return value.
361-
n.astType == model::CppAstNode::AstType::ReturnTypeLoc ||
362-
// TODO: What's this? Maybe a compiler generated copy constructor
363-
// parameter's type? Then why isn't this a ParameterTypeLoc?
360+
// TODO: investigate the type of this. It is possibly the parameter of a
361+
// compiler generated copy constructor or assignment operator.
362+
// The type should also be visible as a return type of the compiler generated
363+
// assignment operator.
364+
n.astType == model::CppAstNode::AstType::ParameterTypeLoc ||
364365
n.astType == model::CppAstNode::AstType::TypeLocation);
365366
break;
366367

0 commit comments

Comments
 (0)