C++: disable definition generation for pure virtual methods.

This commit is contained in:
Erik Verbruggen
2010-10-06 16:43:42 +02:00
parent 7334ed9ec4
commit e57297f6ee

View File

@@ -282,7 +282,10 @@ QList<CppQuickFixOperation::Ptr> DefFromDecl::match(const CppQuickFixState &stat
if (simpleDecl->symbols && ! simpleDecl->symbols->next) { if (simpleDecl->symbols && ! simpleDecl->symbols->next) {
if (Symbol *symbol = simpleDecl->symbols->value) { if (Symbol *symbol = simpleDecl->symbols->value) {
if (Declaration *decl = symbol->asDeclaration()) { if (Declaration *decl = symbol->asDeclaration()) {
if (decl->type()->isFunctionType() && decl->enclosingScope() && decl->enclosingScope()->isClass()) { if (decl->type()->isFunctionType()
&& !decl->type()->asFunctionType()->isPureVirtual()
&& decl->enclosingScope()
&& decl->enclosingScope()->isClass()) {
DeclaratorAST *declarator = simpleDecl->declarator_list->value; DeclaratorAST *declarator = simpleDecl->declarator_list->value;
if (file.isCursorOn(declarator->core_declarator)) { if (file.isCursorOn(declarator->core_declarator)) {
CppRefactoringChanges refactoring(state.snapshot()); CppRefactoringChanges refactoring(state.snapshot());