-
Notifications
You must be signed in to change notification settings - Fork 132
Add test for https://github.com/root-project/root/issues/13574 #1030
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
Open
pcanal
wants to merge
4
commits into
root-project:master
Choose a base branch
from
pcanal:master-13574
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
a987d0b
Add test for https://github.com/root-project/root/issues/13574
pcanal 52aa9c3
Make the output of #12783 test the same on Windows
pcanal 0da2aa6
Correct spelling of version tag in pragma read.
pcanal a131f97
Correct pragma read version syntax.
pcanal File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| #ifndef ns_privacy_hh | ||
pcanal marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| #define ns_privacy_hh | ||
| #include <iostream> | ||
| #include <filesystem> | ||
| #include <tuple> | ||
|
|
||
| namespace fs = std::filesystem; | ||
|
|
||
| namespace privacy | ||
| { | ||
|
|
||
| class test | ||
| { | ||
| public: | ||
| test() = default; | ||
| ~test() = default; | ||
|
|
||
| private: | ||
| fs::path path; ///<! | ||
| fs::path persistent_path; | ||
| }; | ||
|
|
||
| class test1 { | ||
| private: | ||
| struct Inner { struct Most {}; }; | ||
| std::unique_ptr<Inner> unique_data; | ||
| Inner *ptr_data; | ||
| }; | ||
|
|
||
| class test2 { | ||
| private: | ||
| test1 transient_data; ///<! | ||
| test1 persistent_data; | ||
| }; | ||
|
|
||
| class test3 { | ||
| private: | ||
| struct Inner {}; | ||
| std::tuple<int, Inner> persistent_data; | ||
| std::tuple<int, int, Inner> transient_data; ///<! | ||
| }; | ||
|
|
||
| class test4 { | ||
| private: | ||
| test3 transient_data; ///<! | ||
| }; | ||
|
|
||
| } // namespace privacy | ||
|
|
||
| #endif // ns_privacy_hh | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| #ifndef privacy_hh | ||
| #define privacy_hh | ||
| #include <iostream> | ||
| #include <filesystem> | ||
| #include <tuple> | ||
|
|
||
| namespace fs = std::filesystem; | ||
|
|
||
| class test | ||
| { | ||
| public: | ||
| test() = default; | ||
| ~test() = default; | ||
|
|
||
| private: | ||
| fs::path path; ///<! | ||
| fs::path persistent_path; | ||
| }; | ||
|
|
||
| class test1 { | ||
| private: | ||
| struct Inner { struct Most {}; }; | ||
| std::unique_ptr<Inner> unique_data; | ||
| Inner *ptr_data; | ||
| }; | ||
|
|
||
| class test2 { | ||
| private: | ||
| test1 transient_data; ///<! | ||
| test1 persistent_data; | ||
| }; | ||
|
|
||
| class test3 { | ||
| private: | ||
| struct Inner {}; | ||
| std::tuple<int, Inner> persistent_data; | ||
| std::tuple<int, int, Inner> transient_data; ///<! | ||
| }; | ||
|
|
||
| class test4 { | ||
| private: | ||
| test3 transient_data; ///<! | ||
| }; | ||
|
|
||
| #endif |
Empty file.
Empty file.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| #include "ns_privacy.hh" | ||
|
|
||
| int privacyInterp() { | ||
|
|
||
| const char *names[] = { | ||
| "privacy::test", | ||
| "privacy::test1", | ||
| "privacy::test2", | ||
| "privacy::test3", | ||
| "privacy::test4" | ||
| }; | ||
|
|
||
| for(auto name : names) { | ||
| auto cl = TClass::GetClass(name); | ||
| if (!cl) { | ||
| std::cout << "Could not find class " << name << "\n"; | ||
| return 1; | ||
| } | ||
| std::cout << "Data member list for " << name << '\n'; | ||
| for(auto member : *cl->GetStreamerInfo()->GetElements()) { | ||
| if (auto el = dynamic_cast<TStreamerElement*>(member)) { | ||
| std::cout << " " << el->GetTypeName(); | ||
| if (el->IsaPointer() && !TString(el->GetTypeName()).Contains("*")) | ||
| std::cout << "*"; | ||
| std::cout << " " << el->GetName() << '\n'; | ||
| } | ||
| } | ||
| std::cout << '\n'; | ||
| } | ||
|
|
||
| return 0; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| Warning in <TStreamerInfo::Build>: privacy::test: filesystem::path has no streamer or dictionary, data member "persistent_path" will not be saved | ||
| Error in <TStreamerInfo::Build>: privacy::test1: privacy::test1::Inner has no streamer or dictionary, data member unique_data will not be saved | ||
| Error in <TStreamerInfo::Build>: privacy::test1: privacy::test1::Inner* has no streamer or dictionary, data member ptr_data will not be saved | ||
| Warning in <TStreamerInfo::Build>: privacy::test2: privacy::test1 has no streamer or dictionary, data member "persistent_data" will not be saved | ||
| Error in <Load>: Could not declare alternate type for tuple<int,privacy::test3::Inner> since privacy::test3::Inner (or one of its context) is private or protected | ||
| Warning in <TClass::Init>: no dictionary for class tuple<int,privacy::test3::Inner> is available | ||
| Warning in <TStreamerInfo::Build>: privacy::test3: tuple<int,privacy::test3::Inner> has no streamer or dictionary, data member "persistent_data" will not be saved |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
|
|
||
| Processing /home/pcanal/root_working/code/root/roottest/root/io/uniquePointer/privacyInterp.C... | ||
| Data member list for privacy::test | ||
| filesystem::path persistent_path | ||
|
|
||
| Data member list for privacy::test1 | ||
| privacy::test1::Inner* unique_data | ||
| privacy::test1::Inner* ptr_data | ||
|
|
||
| Data member list for privacy::test2 | ||
| privacy::test1 persistent_data | ||
|
|
||
| Data member list for privacy::test3 | ||
| tuple<int,privacy::test3::Inner> persistent_data | ||
|
|
||
| Data member list for privacy::test4 | ||
|
|
||
| (int) 0 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| #pragma link C++ class test+; | ||
|
|
||
| // We can generate the dictionary for this class even-though it has | ||
| // data members whose types is private. There will be a clear error | ||
| // message if the user request the StreamerInfo for this class. | ||
| #pragma link C++ class test1+; | ||
|
|
||
| // Dictionary of private classes is not supported, uncommented this leads | ||
| // to the expected warning message explaining this. | ||
| // #pragma link C++ class test1::Inner+; | ||
|
|
||
| #pragma link C++ class test2+; | ||
| #pragma link C++ class test3+; | ||
| #pragma link C++ class test4+; | ||
|
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| int privacyLoad() { | ||
| gSystem->Load("privacy"); | ||
|
|
||
| // On Windows <fstream> leads to a forward declaration of | ||
| // std::filesystem::path and since we do not generate a dictonary for that | ||
| // class, there is also no autoparsing. This leads to a state that is | ||
| // different from the state in other platform and incurred an additional | ||
| // spurrious: | ||
| // ```Warning in <TClass::Init>: no dictionary for class filesystem::path is available``` | ||
| // (due to the forward declaration only state). | ||
| gInterpreter->Declare("#include <filesystem>"); | ||
|
|
||
| const char *names[] = { | ||
| "test", | ||
| "test1", | ||
| "test2", | ||
| "test3", | ||
| "test4" | ||
| }; | ||
|
|
||
| for(auto name : names) { | ||
| auto cl = TClass::GetClass(name); | ||
| if (!cl) { | ||
| std::cout << "Could not find class " << name << '\n'; | ||
| return 1; | ||
| } | ||
| std::cout << "Data member list for " << name << '\n'; | ||
| for(auto member : *cl->GetStreamerInfo()->GetElements()) { | ||
| if (auto el = dynamic_cast<TStreamerElement*>(member)) { | ||
| std::cout << " " << el->GetTypeName(); | ||
| if (el->IsaPointer() && !TString(el->GetTypeName()).Contains("*")) | ||
| std::cout << "*"; | ||
| std::cout << " " << el->GetName() << '\n'; | ||
| } | ||
| } | ||
| std::cout << '\n'; | ||
| } | ||
|
|
||
| return 0; | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| Warning in <TStreamerInfo::Build>: test: filesystem::path has no streamer or dictionary, data member "persistent_path" will not be saved | ||
| Error in <TStreamerInfo::Build>: test1: test1::Inner has no streamer or dictionary, data member unique_data will not be saved | ||
| Error in <TStreamerInfo::Build>: test1: test1::Inner* has no streamer or dictionary, data member ptr_data will not be saved | ||
| Error in <Load>: Could not declare alternate type for tuple<int,test3::Inner> since test3::Inner (or one of its context) is private or protected | ||
| Warning in <TClass::Init>: no dictionary for class tuple<int,test3::Inner> is available | ||
| Warning in <TStreamerInfo::Build>: test3: tuple<int,test3::Inner> has no streamer or dictionary, data member "persistent_data" will not be saved |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
|
|
||
| Processing /home/pcanal/root_working/code/root/roottest/root/io/uniquePointer/privacyLoad.C... | ||
| Data member list for test | ||
| filesystem::path persistent_path | ||
|
|
||
| Data member list for test1 | ||
| test1::Inner* unique_data | ||
| test1::Inner* ptr_data | ||
|
|
||
| Data member list for test2 | ||
| test1 persistent_data | ||
|
|
||
| Data member list for test3 | ||
| tuple<int,test3::Inner> persistent_data | ||
|
|
||
| Data member list for test4 | ||
|
|
||
| (int) 0 |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.