diff options
author | Volodymyr Zibarov <gogan419@gmail.com> | 2020-05-14 23:07:05 +0300 |
---|---|---|
committer | Volodymyr Zibarov <gogan419@gmail.com> | 2020-05-29 12:39:28 +0000 |
commit | 9ee693ee229d28bd618e8dd44bc6b12750d43a29 (patch) | |
tree | 7a2a4dd6679fd3647228b5c39d1fc2724ff133a3 /src/plugins/cpptools/cppcodeformatter.cpp | |
parent | be97943372bc80d2440daa20cd658599d765b9a9 (diff) | |
download | qt-creator-9ee693ee229d28bd618e8dd44bc6b12750d43a29.tar.gz |
C++: fix built-in code model to work with shared_ptr on MSVC 2017
These changes target Find Usages feature to work with shared_ptr.
Improve libs/3rdparty/cplusplus and plugins/cplusplus:
parse __declspec() attribute,
call to variadic function template without specified template arguments,
if constexpr,
c++11 attributes [[value]],
function templates with default parameters,
resolve order for function vs template with default parameter,
template operator->() with default arguments,
template specialization with numeric values,
find best partial specialization,
fix partial specialization for non-first specialized argument
Fixes: QTCREATORBUG-7866
Fixes: QTCREATORBUG-20781
Fixes: QTCREATORBUG-22857
Fixes: QTCREATORBUG-17825
Change-Id: I31a080f7729edfb2ee9650f1aff48daeba5a673b
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Reviewed-by: Nikolai Kosjar <pinaceae.pinus@gmail.com>
Diffstat (limited to 'src/plugins/cpptools/cppcodeformatter.cpp')
-rw-r--r-- | src/plugins/cpptools/cppcodeformatter.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/plugins/cpptools/cppcodeformatter.cpp b/src/plugins/cpptools/cppcodeformatter.cpp index 4d4cf6e795..6925b711c8 100644 --- a/src/plugins/cpptools/cppcodeformatter.cpp +++ b/src/plugins/cpptools/cppcodeformatter.cpp @@ -863,6 +863,7 @@ bool CodeFormatter::tryDeclaration() case T_AUTO: case T___TYPEOF__: case T___ATTRIBUTE__: + case T___DECLSPEC: case T_STATIC: case T_FRIEND: case T_CONST: @@ -1590,7 +1591,7 @@ void QtStyleCodeFormatter::adjustIndent(const Tokens &tokens, int lexerState, in if (m_styleSettings.indentDeclarationsRelativeToAccessSpecifiers && topState.type == class_open) { if (tokenAt(1).is(T_COLON) || tokenAt(2).is(T_COLON) - || (tokenAt(tokenCount() - 1).is(T_COLON) && tokenAt(1).is(T___ATTRIBUTE__))) { + || (tokenAt(tokenCount() - 1).is(T_COLON) && (tokenAt(1).is(T___ATTRIBUTE__) || tokenAt(1).is(T___DECLSPEC)))) { *indentDepth = topState.savedIndentDepth; if (m_styleSettings.indentAccessSpecifiers) *indentDepth += m_tabSettings.m_indentSize; |