[metacling] Instantiate empty parameter packs#21292
Draft
hahnjo wants to merge 4 commits intoroot-project:masterfrom
Draft
[metacling] Instantiate empty parameter packs#21292hahnjo wants to merge 4 commits intoroot-project:masterfrom
hahnjo wants to merge 4 commits intoroot-project:masterfrom
Conversation
TClassEdit::TSplitType will have an empty string for an empty template parameter list.
This makes it possible to instantiate an empty RLazyDS.
This effectively reverts the change of commit 4b00923.
This was "fixed" by the previous commit enabling the default instantiation of template parameter packs.
Test Results 19 files 19 suites 2d 16h 23m 0s ⏱️ For more details on these failures, see this check. Results for commit 75f513d. ♻️ This comment has been updated with latest results. |
Member
Author
|
So this doesn't work on macOS, mostly because of diff --git a/core/metacling/src/TClingMethodInfo.cxx b/core/metacling/src/TClingMethodInfo.cxx
index bb458163f70..692725d75c0 100644
--- a/core/metacling/src/TClingMethodInfo.cxx
+++ b/core/metacling/src/TClingMethodInfo.cxx
@@ -161,6 +161,9 @@ TClingCXXRecMethIter::InstantiateTemplateWithDefaults(const clang::RedeclarableT
llvm::SmallVector<TemplateArgument, 8> defaultTemplateArgs;
for (const NamedDecl *templateParm: *templateParms) {
if (templateParm->isTemplateParameterPack()) {
+ if (defaultTemplateArgs.size() == 0) {
+ return nullptr;
+ }
defaultTemplateArgs.emplace_back(ArrayRef<TemplateArgument>{}); // empty pack.
} else if (auto TTP = dyn_cast<TemplateTypeParmDecl>(templateParm)) {
if (!TTP->hasDefaultArgument())That would be get me what I need for the histograms, but potentially confusing why other member templates are not instantiated. Opinions? |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
This effectively reverts the change of commit 4b00923. It is needed for working conversion with variadic templates from cppyy.