diff options
author | Stephan Bergmann <sbergman@redhat.com> | 2016-12-12 15:31:35 +0100 |
---|---|---|
committer | Stephan Bergmann <sbergman@redhat.com> | 2016-12-12 18:02:57 +0000 |
commit | 385f6240278b38643894158d2eb7001f25fc965b (patch) | |
tree | f971df1481b714bd2f95c06bef997cf49e02243d /compilerplugins/clang | |
parent | 8845ccc1d46fe09eae7b37367a6fbc774fd0b7a4 (diff) |
Prevent use of ORowSetValue with sal_Bool as TINYINT
sal_Bool and sal_uInt8 are typedefs for the same underlying type, so any use of
ORowSetValue with sal_Bool instead of bool, apparently intending to treat the
value as a boolean, actually treated it as a TINYINT. (See e.g. recent
7b0c57b2faec875c790051d233d1e9abaed2a3bc "some compilers don't like implicit
bool-to-ORowSetValue conversion".)
Now that there's no way to create a sal_uInt8 ORowSetValue, getUInt8 and the
m_uInt8 union member can probably go away, too.
Change-Id: Ia27554f76e7e9edce6410284b578064573e54fd3
Reviewed-on: https://gerrit.libreoffice.org/31909
Tested-by: Jenkins <ci@libreoffice.org>
Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'compilerplugins/clang')
-rw-r--r-- | compilerplugins/clang/salbool.cxx | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/compilerplugins/clang/salbool.cxx b/compilerplugins/clang/salbool.cxx index a443234e779c..2da581111264 100644 --- a/compilerplugins/clang/salbool.cxx +++ b/compilerplugins/clang/salbool.cxx @@ -647,7 +647,9 @@ bool SalBool::VisitFunctionDecl(FunctionDecl const * decl) { if (ignoreLocation(decl)) { return true; } - if (isSalBool(compat::getReturnType(*decl).getNonReferenceType())) { + if (isSalBool(compat::getReturnType(*decl).getNonReferenceType()) + && !(decl->isDeletedAsWritten() && isa<CXXConversionDecl>(decl))) + { FunctionDecl const * f = decl->getCanonicalDecl(); OverrideKind k = getOverrideKind(f); if (k != OverrideKind::YES |