C++: Transfer noexcept specifier for refactoring actions

This applies for e.g.

* "Add Definition..." (on function decl)
* "Move Definition..." (on function decl)
* "Insert Virtual Functions of Base Class" (on class specifier)

Fixes: QTCREATORBUG-11849
Fixes: QTCREATORBUG-19699
Change-Id: I0d259bc1782470f3b3f19617230005a5594a5cca
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
Nikolai Kosjar
2019-10-07 14:31:32 +02:00
parent c2aaa93408
commit 54fefd89b8
8 changed files with 49 additions and 2 deletions

View File

@@ -136,6 +136,7 @@ public:
funTy->setConst(type->isConst());
funTy->setVolatile(type->isVolatile());
funTy->setRefQualifier(type->refQualifier());
funTy->setExceptionSpecification(type->exceptionSpecification());
funTy->setName(rewrite->rewriteName(type->name()));

View File

@@ -487,6 +487,12 @@ void TypePrettyPrinter::visit(Function *type)
? QLatin1String("&")
: QLatin1String("&&");
}
// add exception specifier
if (const StringLiteral *spec = type->exceptionSpecification()) {
appendSpace();
_text += QLatin1String(spec->chars());
}
}
}