[metacling] Instantiate empty parameter packs#21292
[metacling] Instantiate empty parameter packs#21292hahnjo 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. |
|
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? |
'What' is the mechanism that makes it fails? Is it invalid to do so? If it is invalid is there a (simple) way to inquire whether it is/will-be invalid? |
Yes, a variant requires at least one type:
(from https://en.cppreference.com/w/cpp/utility/variant.html)
No. |
|
I don't see a good solution for the problems with |
This effectively reverts the change of commit 4b00923. It is needed for working conversion with variadic templates from cppyy.