Skip to content

Test for name normalization involving size_t template argument #1302

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
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

pcanal
Copy link
Member

@pcanal pcanal commented Apr 11, 2025

This is the companion PR of root-project/root#18373

Comment on lines +4 to +10
namespace reco {
template <size_t I, bool B> struct PFRecHitSoALayout {
template <size_t II, bool B1, bool B2, bool B3> struct ViewTemplateFreeParams {};
using View = ViewTemplateFreeParams<I, B, true, true>;
};
using PFRecHitSoA = PFRecHitSoALayout<128,false>; // The result is the same with 128UL or 128ul
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The minimal reproducer to trigger the problem is:

template <unsigned I> struct PFRecHitSoALayout {
   struct View {}; 
};

This normalizes to PFRecHitSoALayout<128U>::View.

A couple of conclusions:

  1. The problem is not particular to size_t, it just has to be a builtin type where printIntegral decides to print a suffix.
  2. It has nothing to do with using declarations that "forward" a template argument.
  3. It is not even required for the inner type to be a template.

FYI @vgvassilev (not a standalone reproducer yet)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I recalled correctly, it does not add the suffix for int. I.e. being an unsigned type might be the discriminant.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, as I write

it just has to be a builtin type where printIntegral decides to print a suffix

That's not the case for int, but also includes signed long for example.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants