forked from qt-creator/qt-creator
Clang: Improve interfaces
The interfaces should never used to handle ownership. So it is now using protected destructors. Copy operations are forbidden too. https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md#c35-a-base-class-destructor-should-be-either-public-and-virtual-or-protected-and-nonvirtual Change-Id: Ib0b60a73a7ec130973b5cb0095cc5b2f10fa0758 Reviewed-by: Ivan Donchevskii <ivan.donchevskii@qt.io>
This commit is contained in:
@@ -47,7 +47,10 @@ enum class SymbolType
|
||||
class SymbolQueryInterface
|
||||
{
|
||||
public:
|
||||
virtual ~SymbolQueryInterface() {}
|
||||
SymbolQueryInterface() = default;
|
||||
SymbolQueryInterface(const SymbolQueryInterface &) = delete;
|
||||
SymbolQueryInterface &operator=(const SymbolQueryInterface &) = delete;
|
||||
|
||||
virtual SourceLocations locationsAt(ClangBackEnd::FilePathId filePathId,
|
||||
int line,
|
||||
int utf8Column) const = 0;
|
||||
@@ -57,6 +60,9 @@ public:
|
||||
virtual Symbols symbolsContaining(SymbolType symbolType,
|
||||
Utils::SmallStringView regularExpression) const = 0;
|
||||
virtual Functions functionsContaining(Utils::SmallStringView regularExpression) const = 0;
|
||||
|
||||
protected:
|
||||
~SymbolQueryInterface() = default;
|
||||
};
|
||||
|
||||
} // namespace ClangRefactoring
|
||||
|
||||
Reference in New Issue
Block a user