File tree 2 files changed +10
-0
lines changed
interpreter/llvm-project/clang
2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -76,6 +76,7 @@ struct PrintingPolicy {
76
76
SuppressImplicitBase(false ), FullyQualifiedName(false ),
77
77
PrintCanonicalTypes(false ), PrintInjectedClassNameWithArguments(true ),
78
78
UsePreferredNames(true ), AlwaysIncludeTypeForTemplateArgument(false ),
79
+ NeverIncludeTypeForTemplateArgument(false ),
79
80
CleanUglifiedParameters(false ), EntireContentsOfLargeArray(true ),
80
81
UseEnumerators(true ) {}
81
82
@@ -326,6 +327,13 @@ struct PrintingPolicy {
326
327
LLVM_PREFERRED_TYPE (bool )
327
328
unsigned AlwaysIncludeTypeForTemplateArgument : 1;
328
329
330
+ // / Whether to never use type suffixes (eg: 1U) on integral non-type template
331
+ // / parameters. This is useful to cancel the behavior of
332
+ // / TemplateParameterList::shouldIncludeTypeForArgument sometimes request the
333
+ // / type suffix even if AlwaysIncludeTypeForTemplateArgument is not true.
334
+ LLVM_PREFERRED_TYPE (bool )
335
+ unsigned NeverIncludeTypeForTemplateArgument : 1;
336
+
329
337
// / Whether to strip underscores when printing reserved parameter names.
330
338
// / e.g. std::vector<class _Tp> becomes std::vector<class Tp>.
331
339
// / This only affects parameter names, and so describes a compatible API.
Original file line number Diff line number Diff line change @@ -240,6 +240,8 @@ bool TemplateParameterList::hasAssociatedConstraints() const {
240
240
bool TemplateParameterList::shouldIncludeTypeForArgument (
241
241
const PrintingPolicy &Policy, const TemplateParameterList *TPL,
242
242
unsigned Idx) {
243
+ if (Policy.NeverIncludeTypeForTemplateArgument )
244
+ return false ;
243
245
if (!TPL || Idx >= TPL->size () || Policy.AlwaysIncludeTypeForTemplateArgument )
244
246
return true ;
245
247
const NamedDecl *TemplParam = TPL->getParam (Idx);
You can’t perform that action at this time.
0 commit comments