Skip to content

Commit 02fd55a

Browse files
committed
[cling] Ensure correct template argument printing for large integers
We do not need a patch to set `ULL` suffix manually on top of Clang. `Policy.AlwaysIncludeTypeForTemplateArgument = true` does the job.
1 parent 93ac579 commit 02fd55a

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

core/clingutils/src/TClingUtils.cxx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4164,6 +4164,7 @@ void ROOT::TMetaUtils::GetNormalizedName(std::string &norm_name, const clang::Qu
41644164
policy.SuppressTagKeyword = true; // Never get the class or struct keyword
41654165
policy.SuppressScope = true; // Force the scope to be coming from a clang::ElaboratedType.
41664166
policy.AnonymousTagLocations = false; // Do not extract file name + line number for anonymous types.
4167+
policy.AlwaysIncludeTypeForTemplateArgument = true; // Always include type for template arguments
41674168
// The scope suppression is required for getting rid of the anonymous part of the name of a class defined in an anonymous namespace.
41684169
// This gives us more control vs not using the clang::ElaboratedType and relying on the Policy.SuppressUnwrittenScope which would
41694170
// strip both the anonymous and the inline namespace names (and we probably do not want the later to be suppressed).

interpreter/cling/lib/Utils/AST.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1760,6 +1760,7 @@ namespace utils {
17601760
PrintingPolicy Policy(Ctx.getPrintingPolicy());
17611761
Policy.SuppressScope = false;
17621762
Policy.AnonymousTagLocations = false;
1763+
Policy.AlwaysIncludeTypeForTemplateArgument = true;
17631764
return FQQT.getAsString(Policy);
17641765
}
17651766

0 commit comments

Comments
 (0)