forked from qt-creator/qt-creator
QmlJS: Fix static variable initialization
You cannot use the variable itself in its initializer... Change-Id: Ibaf64b717b0ad5523b4ef8cf20ce4bf967a64a43 Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: Marco Benelli <marco.benelli@qt.io>
This commit is contained in:
committed by
Orgad Shaneh
parent
c7b51f2ad3
commit
4c6c2032f6
@@ -417,10 +417,11 @@ bool Scanner::isKeyword(const QString &text) const
|
|||||||
|
|
||||||
QStringList Scanner::keywords()
|
QStringList Scanner::keywords()
|
||||||
{
|
{
|
||||||
static QStringList words = [&]() {
|
static QStringList words = []() {
|
||||||
|
QStringList res;
|
||||||
for (const QString *word = begin(js_keywords); word != end(js_keywords); ++word)
|
for (const QString *word = begin(js_keywords); word != end(js_keywords); ++word)
|
||||||
words.append(*word);
|
res.append(*word);
|
||||||
return words;
|
return res;
|
||||||
}();
|
}();
|
||||||
return words;
|
return words;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user