File tree Expand file tree Collapse file tree 2 files changed +10
-0
lines changed
interpreter/llvm-project/clang Expand file tree Collapse file tree 2 files changed +10
-0
lines changed Original file line number Diff line number Diff line change @@ -76,6 +76,7 @@ struct PrintingPolicy {
7676 SuppressImplicitBase(false ), FullyQualifiedName(false ),
7777 PrintCanonicalTypes(false ), PrintInjectedClassNameWithArguments(true ),
7878 UsePreferredNames(true ), AlwaysIncludeTypeForTemplateArgument(false ),
79+ NeverIncludeTypeForTemplateArgument(false ),
7980 CleanUglifiedParameters(false ), EntireContentsOfLargeArray(true ),
8081 UseEnumerators(true ) {}
8182
@@ -326,6 +327,13 @@ struct PrintingPolicy {
326327 LLVM_PREFERRED_TYPE (bool )
327328 unsigned AlwaysIncludeTypeForTemplateArgument : 1;
328329
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+
329337 // / Whether to strip underscores when printing reserved parameter names.
330338 // / e.g. std::vector<class _Tp> becomes std::vector<class Tp>.
331339 // / 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 {
240240bool TemplateParameterList::shouldIncludeTypeForArgument (
241241 const PrintingPolicy &Policy, const TemplateParameterList *TPL,
242242 unsigned Idx) {
243+ if (Policy.NeverIncludeTypeForTemplateArgument )
244+ return false ;
243245 if (!TPL || Idx >= TPL->size () || Policy.AlwaysIncludeTypeForTemplateArgument )
244246 return true ;
245247 const NamedDecl *TemplParam = TPL->getParam (Idx);
You can’t perform that action at this time.
0 commit comments