Skip to content
Merged
Show file tree
Hide file tree
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
Avoid auto-parsing upon seeing __pair_base
  • Loading branch information
pcanal committed Sep 30, 2020
commit 0005d17fa38c8acd5947072e5fe14cbe48aef703
5 changes: 5 additions & 0 deletions core/foundation/inc/TClassEdit.h
Original file line number Diff line number Diff line change
Expand Up @@ -192,6 +192,11 @@ namespace TClassEdit {
return 0 == name.compare(0, 10, "std::pair<") || 0 == name.compare(0, 5, "pair<");
}
inline bool IsStdPair(ROOT::Internal::TStringView name) {return IsStdPair(std::string_view(name)); }
inline bool IsStdPairBase(std::string_view name)
{
return 0 == name.compare(0, 17, "std::__pair_base<") || 0 == name.compare(0, 12, "__pair_base<");
}
inline bool IsStdPairBase(ROOT::Internal::TStringView name) {return IsStdPair(std::string_view(name)); }
inline std::string GetUniquePtrType(std::string_view name)
{
// Find the first template parameter
Expand Down
5 changes: 3 additions & 2 deletions core/meta/src/TClass.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -3049,6 +3049,7 @@ TClass *TClass::GetClass(const char *name, Bool_t load, Bool_t silent)
// kEmulated state) so that they have proper interpreter (ClassInfo) information which
// will be used to create the TProtoClass (if one is requested for the pair).
const bool ispair = TClassEdit::IsStdPair(normalizedName) && !IsFromRootCling();
const bool ispairbase = TClassEdit::IsStdPairBase(normalizedName) && !IsFromRootCling();

TClass *loadedcl = 0;
if (checkTable) {
Expand All @@ -3061,7 +3062,7 @@ TClass *TClass::GetClass(const char *name, Bool_t load, Bool_t silent)
if (e)
return nullptr;
// Maybe this was a typedef: let's try to see if this is the case
if (!loadedcl && !ispair) {
if (!loadedcl && !ispair && !ispairbase) {
if (TDataType* theDataType = gROOT->GetType(normalizedName.c_str())){
// We have a typedef: we get the name of the underlying type
auto underlyingTypeName = theDataType->GetTypeName();
Expand Down Expand Up @@ -3094,7 +3095,7 @@ TClass *TClass::GetClass(const char *name, Bool_t load, Bool_t silent)
}

// Check the interpreter only after autoparsing the template if any.
{
if (!ispairbase) {
std::string::size_type posLess = normalizedName.find('<');
if (posLess != std::string::npos) {
gCling->AutoParse(normalizedName.substr(0, posLess).c_str());
Expand Down
2 changes: 1 addition & 1 deletion core/metacling/src/TCling.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -4054,7 +4054,7 @@ TCling::CheckClassInfo(const char *name, Bool_t autoload, Bool_t isClassOrNamesp
};

MaybeSuspendAutoLoadParse autoLoadParseRAII( autoload );
if (TClassEdit::IsStdPair(classname))
if (TClassEdit::IsStdPair(classname) || TClassEdit::IsStdPairBase(classname))
autoLoadParseRAII.SuspendAutoParsing();

// First we want to check whether the decl exist, but _without_
Expand Down