Skip to content
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

Fix for SST_ELI_DECLARE_NEW_BASE when BuilderInfo is a dependent name. #1006

Merged
merged 1 commit into from
Oct 14, 2023

Conversation

ldalessa
Copy link
Contributor

This resolves #1005.

Imagine the following code:

template <class Component>
struct MyComponentBase : public Component {
    SST_ELI_DECLARE_NEW_BASE(Component, MyComponentBase);
    // tools that help us with SST::Component interfaces
};

struct MyComponent : MyComponentBase<SST::Component> {
    // A custom component
};

struct MyRouter : MyComponentBase<SST::Merlin::Router> {
    // 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.

…name.

This is easier to describe with an example first. Imagine the following code:

```c++
template <class Component>
struct MyComponentBase : public Component {
    SST_ELI_DECLARE_NEW_BASE(Component, MyComponentBase);
    // tools that help us with SST::Component interfaces
};

struct MyComponent : MyComponentBase<SST::Component> {
    // A custom component
};

struct MyRouter : MyComponentBase<SST::Merlin::Router> {
    // 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.
@github-actions github-actions bot added AT: WIP Mark PR as a Work in Progress (No Autotesting Performed) AT: CLANG-FORMAT PASS and removed AT: WIP Mark PR as a Work in Progress (No Autotesting Performed) labels Oct 12, 2023
@github-actions
Copy link

CLANG-FORMAT TEST - PASSED

@github-actions
Copy link

CMAKE-FORMAT TEST - PASSED

@sst-autotester
Copy link
Contributor

Status Flag 'Pre-Test Inspection' - - This Pull Request Requires Inspection... The code must be inspected by a member of the Team before Testing/Merging
NO INSPECTION HAS BEEN PERFORMED ON THIS PULL REQUEST! - This PR must be inspected by setting label 'AT: PRE-TEST INSPECTED'.

@sst-autotester
Copy link
Contributor

Status Flag 'Pre-Test Inspection' - SUCCESS: The last commit to this Pull Request has been INSPECTED by label AT: PRE-TEST INSPECTED! Autotester is Removing Label; this inspection will remain valid until a new commit to source branch is performed.

@sst-autotester
Copy link
Contributor

Status Flag 'Pull Request AutoTester' - Testing Jenkins Projects:

Pull Request Auto Testing STARTING (click to expand)

Build Information

Test Name: SST__AutotestGen2_NewFW_sst-test_OMPI-4.1.4_PY3.6_sst-elements

  • Build Num: 1235
  • Status: STARTED

Build Information

Test Name: SST__AutotestGen2_NewFW_sst-test_OMPI-4.1.4_PY3.6_sst-elements_MR-2

  • Build Num: 1216
  • Status: STARTED

Build Information

Test Name: SST__AutotestGen2_NewFW_sst-test_OMPI-4.1.4_PY3.6_sst-elements_MT-2

  • Build Num: 1218
  • Status: STARTED

Build Information

Test Name: SST__AutotestGen2_NewFW_sst-test_OMPI-4.1.4_PY3.6_sst-macro_withsstcore

  • Build Num: 476
  • Status: STARTED

Build Information

Test Name: SST__AutotestGen2_NewFW_sst-test_OMPI-4.1.4_PY3.6_sst-core

  • Build Num: 394
  • Status: STARTED

Build Information

Test Name: SST__AutotestGen2_NewFW_sst-test_OMPI-4.1.4_PY3.6_sst-core_Make-Dist

  • Build Num: 352
  • Status: STARTED

Build Information

Test Name: SST__AutotestGen2_NewFW_sst-test_Clang-Format_sst-core

  • Build Num: 306
  • Status: STARTED

Build Information

Test Name: SST__AutotestGen2_NewFW_OSX-13.2-XC14-ARM_OMPI-4.1.4_PY3.10_sst-elements

  • Build Num: 575
  • Status: STARTED

Build Information

Test Name: SST__AutotestGen2_NewFW_OSX-13.2-XC14-ARM_OMPI-4.1.4_PY3.10_sst-macro_withsstcore

  • Build Num: 139
  • Status: STARTED

Using Repos:

Repo: CORE (ldalessa/sst-core)
  • Branch: devel
  • SHA: 5432cca
  • Mode: TEST_REPO
Repo: SQE (sstsimulator/sst-sqe)
  • Branch: devel
  • SHA: 80baff68611f785721e42fed56804f27109084e0
  • Mode: SUPPORT_REPO
Repo: ELEMENTS (sstsimulator/sst-elements)
  • Branch: devel
  • SHA: 20b6fa3fbca9e6c1b049971771434534a69ed3f5
  • Mode: SUPPORT_REPO
Repo: MACRO (sstsimulator/sst-macro)
  • Branch: devel
  • SHA: 432426e6e6a709368feb9abc6f91c654ffad9b6f
  • Mode: SUPPORT_REPO

Pull Request Author: ldalessa

@sst-autotester
Copy link
Contributor

Status Flag 'Pull Request AutoTester' - Jenkins Testing: all Jobs PASSED

Pull Request Auto Testing has PASSED (click to expand)

Build Information

Test Name: SST__AutotestGen2_NewFW_sst-test_OMPI-4.1.4_PY3.6_sst-elements

  • Build Num: 1235
  • Status: PASSED

Build Information

Test Name: SST__AutotestGen2_NewFW_sst-test_OMPI-4.1.4_PY3.6_sst-elements_MR-2

  • Build Num: 1216
  • Status: PASSED

Build Information

Test Name: SST__AutotestGen2_NewFW_sst-test_OMPI-4.1.4_PY3.6_sst-elements_MT-2

  • Build Num: 1218
  • Status: PASSED

Build Information

Test Name: SST__AutotestGen2_NewFW_sst-test_OMPI-4.1.4_PY3.6_sst-macro_withsstcore

  • Build Num: 476
  • Status: PASSED

Build Information

Test Name: SST__AutotestGen2_NewFW_sst-test_OMPI-4.1.4_PY3.6_sst-core

  • Build Num: 394
  • Status: PASSED

Build Information

Test Name: SST__AutotestGen2_NewFW_sst-test_OMPI-4.1.4_PY3.6_sst-core_Make-Dist

  • Build Num: 352
  • Status: PASSED

Build Information

Test Name: SST__AutotestGen2_NewFW_sst-test_Clang-Format_sst-core

  • Build Num: 306
  • Status: PASSED

Build Information

Test Name: SST__AutotestGen2_NewFW_OSX-13.2-XC14-ARM_OMPI-4.1.4_PY3.10_sst-elements

  • Build Num: 575
  • Status: PASSED

Build Information

Test Name: SST__AutotestGen2_NewFW_OSX-13.2-XC14-ARM_OMPI-4.1.4_PY3.10_sst-macro_withsstcore

  • Build Num: 139
  • Status: PASSED

@sst-autotester
Copy link
Contributor

Status Flag 'Pre-Merge Inspection' - - This Pull Request Requires Inspection... The code must be inspected by a member of the Team before Testing/Merging
NO REVIEWS HAVE BEEN PERFORMED ON THIS PULL REQUEST!

@sst-autotester
Copy link
Contributor

All Jobs Finished; status = PASSED, However Inspection must be performed before merge can occur...

9 similar comments
@sst-autotester
Copy link
Contributor

All Jobs Finished; status = PASSED, However Inspection must be performed before merge can occur...

@sst-autotester
Copy link
Contributor

All Jobs Finished; status = PASSED, However Inspection must be performed before merge can occur...

@sst-autotester
Copy link
Contributor

All Jobs Finished; status = PASSED, However Inspection must be performed before merge can occur...

@sst-autotester
Copy link
Contributor

All Jobs Finished; status = PASSED, However Inspection must be performed before merge can occur...

@sst-autotester
Copy link
Contributor

All Jobs Finished; status = PASSED, However Inspection must be performed before merge can occur...

@sst-autotester
Copy link
Contributor

All Jobs Finished; status = PASSED, However Inspection must be performed before merge can occur...

@sst-autotester
Copy link
Contributor

All Jobs Finished; status = PASSED, However Inspection must be performed before merge can occur...

@sst-autotester
Copy link
Contributor

All Jobs Finished; status = PASSED, However Inspection must be performed before merge can occur...

@sst-autotester
Copy link
Contributor

All Jobs Finished; status = PASSED, However Inspection must be performed before merge can occur...

@sst-autotester
Copy link
Contributor

Status Flag 'Pre-Merge Inspection' - SUCCESS: The last commit to this Pull Request has been INSPECTED AND APPROVED by [ feldergast ]!

@sst-autotester
Copy link
Contributor

Status Flag 'Pull Request AutoTester' - Pull Request MUST BE MERGED MANUALLY BY Project Team - Forked Repos cannot Automerge

@feldergast feldergast merged commit a29db3c into sstsimulator:devel Oct 14, 2023
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants