diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2017-12-23 22:43:45 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2017-12-24 00:19:20 +0100 |
commit | c926a1e34672afaa5b7de0e3b08b1537e88fbb6f (patch) | |
tree | a15db0ec3f6615958f597e229583eea6ef823761 /compilerplugins | |
parent | baccbd4508a375090f4d95a2dab02c8b5d404ee2 (diff) |
Fix compilerplugins/clang/test/passstuffbyref.cxx
...after 2a1fb4401da16f6a18c0bd05fe4b460a3048f9b5 "loplugin:passstuffbyref
improved returns", where compiling as C++17 causes a false positive for
S2::set1, whose return statement consists of
> `-ReturnStmt 0x9ef8d78 <col:23, col:44>
> `-ExprWithCleanups 0x9ef8d60 <col:30, col:44> 'class rtl::OUString'
> `-CXXFunctionalCastExpr 0x9ef8d38 <col:30, col:44> 'class rtl::OUString' functional cast to class rtl::OUString <ConstructorConversion>
> `-CXXBindTemporaryExpr 0x9ef8d18 <col:30, col:44> 'class rtl::OUString' (CXXTemporary 0x9ef8d10)
> `-CXXConstructExpr 0x9ef8cd0 <col:30, col:44> 'class rtl::OUString' 'void (char const &[4], typename libreoffice_internal::ConstCharArrayDetector<char const[4], libreoffice_internal::Dummy>::Type)'
> |-StringLiteral 0x9ef7160 <col:39> 'const char [4]' lvalue "xxx"
> `-CXXDefaultArgExpr 0x9ef8cb0 <<invalid sloc>> 'libreoffice_internal::Dummy':'struct rtl::libreoffice_internal::Dummy'
Change-Id: I7b9de7ce6b5604c7d686c8a4a7034019cd1d75c4
Reviewed-on: https://gerrit.libreoffice.org/47029
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'compilerplugins')
-rw-r--r-- | compilerplugins/clang/passstuffbyref.cxx | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/compilerplugins/clang/passstuffbyref.cxx b/compilerplugins/clang/passstuffbyref.cxx index 5901a587594e..98b75abac960 100644 --- a/compilerplugins/clang/passstuffbyref.cxx +++ b/compilerplugins/clang/passstuffbyref.cxx @@ -332,6 +332,9 @@ bool PassStuffByRef::isReturnExprDisqualified(const Expr* expr) else return true; } + if (isa<CXXFunctionalCastExpr>(expr)) { + return true; + } if (isa<MaterializeTemporaryExpr>(expr)) { return true; } |