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>
This commit is contained in:
Stephan Bergmann 2017-12-23 22:43:45 +01:00
parent baccbd4508
commit c926a1e346

View File

@ -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;
}