Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
17 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Also avoid auto-parsing for __pair_base during I/O init
  • Loading branch information
pcanal committed Sep 30, 2020
commit 9ca6572fddd862d84f946b7090fc3442b801ee34
4 changes: 2 additions & 2 deletions core/foundation/src/TClassEdit.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -842,12 +842,12 @@ void TClassEdit::GetNormalizedName(std::string &norm_name, std::string_view name
TClassEdit::TSplitType splitname(norm_name.c_str(),(TClassEdit::EModType)(TClassEdit::kLong64 | TClassEdit::kDropStd | TClassEdit::kDropStlDefault | TClassEdit::kKeepOuterConst));
splitname.ShortType(norm_name, TClassEdit::kDropStd | TClassEdit::kDropStlDefault | TClassEdit::kResolveTypedef | TClassEdit::kKeepOuterConst);

if (splitname.fElements.size() == 4 && (splitname.fElements[0] == "std::pair" || splitname.fElements[0] == "pair")) {
if (splitname.fElements.size() == 4 && (splitname.fElements[0] == "std::pair" || splitname.fElements[0] == "pair" || splitname.fElements[0] == "__pair_base")) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you not use IsStdPair here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think so. The test is also on the base class name (__pair_base) and technically the name can have wild spelling. I.e. the input name (unsplit and unnormalized of course) could be "std :: pair <" and the split name lacks the < that IsStdPair expects.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

here I mean that I need to do the test after the call to Split to remove the problem with spelling (and then the name does not have the "<" and thus IsStdPair is not applicable.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How can splitname be std::pair when splitname is the result of kDropStd? Or am I misremembering input/output of ShortType?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actually ... that's right .. the test for std::pair is here superfluous ...

// We don't want to lookup the std::pair itself.
std::string first, second;
GetNormalizedName(first, splitname.fElements[1]);
GetNormalizedName(second, splitname.fElements[2]);
norm_name = "pair<" + first + "," + second;
norm_name = splitname.fElements[0] + "<" + first + "," + second;
if (!second.empty() && second.back() == '>')
norm_name += " >";
else
Expand Down