Test for name normalization involving size_t template argument#1302
Closed
pcanal wants to merge 3 commits intoroot-project:masterfrom
Closed
Test for name normalization involving size_t template argument#1302pcanal wants to merge 3 commits intoroot-project:masterfrom
pcanal wants to merge 3 commits intoroot-project:masterfrom
Conversation
hahnjo
reviewed
Apr 21, 2025
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 | ||
| } |
Member
There was a problem hiding this comment.
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:
- The problem is not particular to
size_t, it just has to be a builtin type whereprintIntegraldecides to print a suffix. - It has nothing to do with
usingdeclarations that "forward" a template argument. - It is not even required for the inner type to be a
template.
FYI @vgvassilev (not a standalone reproducer yet)
Member
Author
There was a problem hiding this comment.
If I recalled correctly, it does not add the suffix for int. I.e. being an unsigned type might be the discriminant.
Member
There was a problem hiding this comment.
Yes, as I write
it just has to be a builtin type where
printIntegraldecides to print a suffix
That's not the case for int, but also includes signed long for example.
Member
Author
|
This was replaced by root-project/root#18464 |
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 is the companion PR of root-project/root#18373