Clang: Treat brace initialization as constructor completion

Try to complete constructor after left brace with fallback
to normal completion.

Task-number: QTCREATORBUG-20957
Change-Id: I6c33790a3ee1e623a3d8abe9a44cfd821b6f3106
Reviewed-by: Marco Bubke <marco.bubke@qt.io>
This commit is contained in:
Ivan Donchevskii
2018-08-20 13:15:13 +02:00
parent b8989f1a8a
commit 8d0391a4f9
8 changed files with 54 additions and 17 deletions

View File

@@ -90,6 +90,7 @@ void ActivationSequenceProcessor::process()
processDot();
processComma();
processLeftParen();
processLeftBrace();
processColonColon();
processArrow();
processDotStar();
@@ -125,6 +126,14 @@ void ActivationSequenceProcessor::processLeftParen()
}
}
void ActivationSequenceProcessor::processLeftBrace()
{
if (m_char3 == QLatin1Char('{') && m_wantFunctionCall) {
m_completionKind = CPlusPlus::T_LBRACE;
m_offset = 1;
}
}
void ActivationSequenceProcessor::processColonColon()
{
if (m_char2 == QLatin1Char(':') && m_char3 == QLatin1Char(':')) {