diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2022-03-17 01:10:31 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2022-03-17 01:10:31 +0000 |
commit | 43a2cd36ccd9465d7d980ef976059b476af2f2da (patch) | |
tree | d9555eec197b545429eb2c53976a4ee4b5f6c920 | |
parent | 8753efc05d9022cfd6127d7ea478ed720d710eef (diff) | |
parent | 6324f414bc40cb3c1cb63ee90fe12a0af59c81dd (diff) | |
download | hidl-43a2cd36ccd9465d7d980ef976059b476af2f2da.tar.gz |
Snap for 8310722 from 6324f414bc40cb3c1cb63ee90fe12a0af59c81dd to tm-release
Change-Id: I944f2c449d6bb7b0ae3a91485b06ccb03e3babda
-rw-r--r-- | ConstantExpression.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/ConstantExpression.cpp b/ConstantExpression.cpp index 02fbf760..6930c0f4 100644 --- a/ConstantExpression.cpp +++ b/ConstantExpression.cpp @@ -137,6 +137,11 @@ T handleBinaryCommon(T lval, const std::string& op, T rval) { return static_cast<T>(0xdeadbeef); } +// The compiler doesn't know T is at least KIND_INT32, and will instantiate bool +// version of this function, and will warn about converting the result of '<<' +// to a boolean. +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wint-in-bool-context" template <class T> T handleShift(T lval, const std::string& op, int64_t rval) { // just cast rval to int64_t and it should fit. @@ -147,6 +152,7 @@ T handleShift(T lval, const std::string& op, int64_t rval) { << lval << " " << op << " " << rval; return static_cast<T>(0xdeadbeef); } +#pragma GCC diagnostic pop bool handleLogical(bool lval, const std::string& op, bool rval) { COMPUTE_BINARY(||); |