From 5432cca123061181886860b481fe8872100c397d Mon Sep 17 00:00:00 2001 From: Luke D'Alessandro Date: Thu, 12 Oct 2023 21:46:27 +0000 Subject: [PATCH] Fix for `SST_ELI_DECLARE_NEW_BASE` when `BuilderInfo` is a dependent name. This is easier to describe with an example first. Imagine the following code: ```c++ template struct MyComponentBase : public Component { SST_ELI_DECLARE_NEW_BASE(Component, MyComponentBase); // tools that help us with SST::Component interfaces }; struct MyComponent : MyComponentBase { // A custom component }; struct MyRouter : MyComponentBase { // A merlin router implementation }; ``` In this context, inside the `SST_ELI_DECLARE_NEW_BASE`, the `BuilderInfo` is a dependent name in the `addDerivedInfo` template function, and can't be found without qualification. The qualified name is `__LocalEliBase::BuilderInfo` and it needs a `typename` pre-C++20. This patch adds that typename to support this template pattern. This pattern allows us to write utility code that can be injected into _any_ component hierarchy. --- src/sst/core/eli/elibase.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/sst/core/eli/elibase.h b/src/sst/core/eli/elibase.h index ffa04f31b..d3a50afd2 100644 --- a/src/sst/core/eli/elibase.h +++ b/src/sst/core/eli/elibase.h @@ -187,6 +187,7 @@ class LoadedLibraries template \ static bool addDerivedInfo(const std::string& lib, const std::string& elem) \ { \ + using BuilderInfo = typename __LocalEliBase::BuilderInfo; \ return addInfo(lib, elem, new BuilderInfo(lib, elem, (__TT*)nullptr)); \ }