forked from qt-creator/qt-creator
CPlusPlus: Differentiate declarations with an initializer
... from those without one, and display the former like write accesses. Task-number: QTCREATORBUG-24894 Change-Id: I5e2d83b2a3ec4735054441c346687f97eeb039fb Reviewed-by: André Hartmann <aha_1980@gmx.de>
This commit is contained in:
@@ -383,8 +383,11 @@ Usage::Type FindUsages::getType(int line, int column, int tokenIndex)
|
||||
continue;
|
||||
}
|
||||
if (const auto declarator = (*it)->asDeclarator()) {
|
||||
if (containsToken(declarator->core_declarator))
|
||||
if (containsToken(declarator->core_declarator)) {
|
||||
if (declarator->initializer)
|
||||
return Usage::Type::Initialization;
|
||||
return Usage::Type::Declaration;
|
||||
}
|
||||
if (const auto decl = (*(it + 1))->asSimpleDeclaration()) {
|
||||
if (decl->symbols && decl->symbols->value) {
|
||||
return checkPotentialWrite(
|
||||
|
||||
@@ -39,7 +39,7 @@ namespace CPlusPlus {
|
||||
class CPLUSPLUS_EXPORT Usage
|
||||
{
|
||||
public:
|
||||
enum class Type { Declaration, Read, Write, WritableRef, Other };
|
||||
enum class Type { Declaration, Initialization, Read, Write, WritableRef, Other };
|
||||
|
||||
Usage() = default;
|
||||
Usage(const Utils::FilePath &path, const QString &lineText, Type t, int line, int col, int len)
|
||||
|
||||
Reference in New Issue
Block a user