C++: Print numeric template arguments in NamePrettyPrinter

Improve type printed for template specializations with numeric
or bool values.

Code example:
template<bool B, class T> struct enable_if{};
template<class T> struct enable_if<true, T>{ typedef T type; };

In outline: "enable_if<_Tp1, T> <T>" becomes "enable_if<true, T> <T>"

TemplateArgument class holds pointer to numeric literal owned
by CppDocument, so remove Control::squeeze() to not release
numericLiterals in CppDocument::releaseSourceAndAST()

This based on TemplateArgument class introduced in commit
9ee693ee22

Change-Id: Ib787a5e402c3e8d8467b520347a26afa6087d4bd
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
Volodymyr Zibarov
2020-06-02 13:11:18 +03:00
parent d1a2de747e
commit 586ce5b472
4 changed files with 7 additions and 11 deletions

View File

@@ -711,8 +711,6 @@ void Document::releaseSourceAndAST()
if (!_keepSourceAndASTCount.deref()) {
_source.clear();
_translationUnit->release();
if (_control)
_control->squeeze();
}
}