Fix call to NamedDecl::getName
...which fails at least with clang-8.0.0-3.fc30.x86_64 with "clang-8: /usr/include/clang/AST/Decl.h:277: llvm::StringRef clang::NamedDecl::getName() const: Assertion `Name.isIdentifier() && "Name is not a simple identifier"' failed." Change-Id: I6999240e2b518b6818a43d1e5ac92224300b343f Reviewed-on: https://gerrit.libreoffice.org/81415 Tested-by: Michael Stahl <michael.stahl@cib.de> Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
This commit is contained in:
parent
12eb32fcce
commit
6facd4811a
1 changed files with 7 additions and 4 deletions
|
@ -274,10 +274,13 @@ bool BufferAdd::isMethodOkToMerge(CXXMemberCallExpr const* memberCall)
|
|||
if (methodDecl->getNumParams() == 0)
|
||||
return true;
|
||||
|
||||
auto name = methodDecl->getName();
|
||||
if (name == "appendUninitialized" || name == "setLength" || name == "remove" || name == "insert"
|
||||
|| name == "appendAscii" || name == "appendUtf32")
|
||||
return false;
|
||||
if (auto const id = methodDecl->getIdentifier())
|
||||
{
|
||||
auto name = id->getName();
|
||||
if (name == "appendUninitialized" || name == "setLength" || name == "remove"
|
||||
|| name == "insert" || name == "appendAscii" || name == "appendUtf32")
|
||||
return false;
|
||||
}
|
||||
|
||||
auto rhs = memberCall->getArg(0);
|
||||
if (!isSideEffectFree(rhs))
|
||||
|
|
Loading…
Reference in a new issue