-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Fix Issue #6443: spurrious auto-parsing due to @ class, pair, __pair_base and enums #6445
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
8d2567b
9ca6572
72c723b
cd04b64
2787835
c7930cf
fe77942
d51fa31
19f417d
94b5a72
e311a8a
84cb8a5
2c274dc
9b1058a
2fb16c9
3936c2f
0005d17
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -838,16 +838,24 @@ void TClassEdit::GetNormalizedName(std::string &norm_name, std::string_view name | |
| } | ||
|
|
||
| norm_name = std::string(name); // NOTE: Is that the shortest version? | ||
|
|
||
| if (TClassEdit::IsArtificial(name)) { | ||
| // If there is a @ symbol (followed by a version number) then this is a synthetic class name created | ||
| // from an already normalized name for the purpose of supporting schema evolution. | ||
| return; | ||
| } | ||
|
|
||
| // Remove the std:: and default template argument and insert the Long64_t and change basic_string to string. | ||
| 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() == 3 && (splitname.fElements[0] == "std::pair" || splitname.fElements[0] == "pair")) { | ||
| // 4 elements expected: "pair", "first type name", "second type name", "trailing stars" | ||
| if (splitname.fElements.size() == 4 && (splitname.fElements[0] == "std::pair" || splitname.fElements[0] == "pair" || splitname.fElements[0] == "__pair_base")) { | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can you not use
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 (
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How can
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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 | ||
|
|
@@ -1391,7 +1399,7 @@ bool TClassEdit::IsStdClass(const char *classname) | |
| classname += StdLen( classname ); | ||
| if ( strcmp(classname,"string")==0 ) return true; | ||
| if ( strncmp(classname,"bitset<",strlen("bitset<"))==0) return true; | ||
| if ( strncmp(classname,"pair<",strlen("pair<"))==0) return true; | ||
| if ( IsStdPair(classname) ) return true; | ||
| if ( strcmp(classname,"allocator")==0) return true; | ||
| if ( strncmp(classname,"allocator<",strlen("allocator<"))==0) return true; | ||
| if ( strncmp(classname,"greater<",strlen("greater<"))==0) return true; | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -127,7 +127,7 @@ class TVirtualStreamerInfo : public TNamed { | |||||||||||||||||||||||||||||
| TVirtualStreamerInfo(TClass * /*cl*/); | ||||||||||||||||||||||||||||||
| virtual ~TVirtualStreamerInfo(); | ||||||||||||||||||||||||||||||
| virtual void Build() = 0; | ||||||||||||||||||||||||||||||
| virtual void BuildCheck(TFile *file = 0) = 0; | ||||||||||||||||||||||||||||||
| virtual void BuildCheck(TFile *file = 0, Bool_t load = kTRUE) = 0; | ||||||||||||||||||||||||||||||
| virtual void BuildEmulated(TFile *file) = 0; | ||||||||||||||||||||||||||||||
| virtual void BuildOld() = 0; | ||||||||||||||||||||||||||||||
| virtual Bool_t BuildFor( const TClass *cl ) = 0; | ||||||||||||||||||||||||||||||
|
|
@@ -180,6 +180,14 @@ class TVirtualStreamerInfo : public TNamed { | |||||||||||||||||||||||||||||
| static void SetCanDelete(Bool_t opt=kTRUE); | ||||||||||||||||||||||||||||||
| static void SetFactory(TVirtualStreamerInfo *factory); | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| // \brief Generate the TClass and TStreamerInfo for the requested pair. | ||||||||||||||||||||||||||||||
| // This creates a TVirtualStreamerInfo for the pair and trigger the BuildCheck/Old to | ||||||||||||||||||||||||||||||
| // provokes the creation of the corresponding TClass. This relies on the dictionary for | ||||||||||||||||||||||||||||||
| // std::pair<const int, int> to already exist (or the interpreter information being available) | ||||||||||||||||||||||||||||||
| // as it is used as a template. | ||||||||||||||||||||||||||||||
|
Comment on lines
+185
to
+187
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Implementation detail; this should be asserted by
Comment on lines
+183
to
+187
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||||||||||||||||||||||||
| virtual TVirtualStreamerInfo *GenerateInfoForPair(const std::string &pairclassname) = 0; | ||||||||||||||||||||||||||||||
| virtual TVirtualStreamerInfo *GenerateInfoForPair(const std::string &firstname, const std::string &secondname) = 0; | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
| virtual TVirtualCollectionProxy *GenEmulatedProxy(const char* class_name, Bool_t silent) = 0; | ||||||||||||||||||||||||||||||
| virtual TClassStreamer *GenEmulatedClassStreamer(const char* class_name, Bool_t silent) = 0; | ||||||||||||||||||||||||||||||
| virtual TVirtualCollectionProxy *GenExplicitProxy( const ::ROOT::Detail::TCollectionProxyInfo &info, TClass *cl ) = 0; | ||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm still not a bit fan of
== 3and== 4without any comment. See also the change in tree/treeplayer/src/TTreeGeneratorBase.cxxThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In TTreeGeneratorBase.cxx, I left 3 or 4 because the likely wrong one was there with no (obvious negative consequence) and (I should add a comment) thus it might actually be the right one .... i.e. to remove it I would have to try to produce a test and the code is used little enough to not be a priority (to spend the time to write the test).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A comment would be great! :-)
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well that's part of the documented contract of TClassEdit::TSplitType :)
But nevertheless I will add a comment.