diff options
author | Tomasz Wasilczyk <twasilczyk@google.com> | 2023-12-05 19:47:43 +0000 |
---|---|---|
committer | Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com> | 2023-12-05 19:47:43 +0000 |
commit | 5e4c06a8b3aedca1e3cd29ae02edba71dc5d48c9 (patch) | |
tree | 5586ac54ef1ff41f0d48c97c1a7c21702b92a705 | |
parent | 1331cab63375a7bcf0185b3dc67493dd29f108df (diff) | |
parent | 9baff9c12e71fd8cc15ec2fdd724a64bcec8c898 (diff) | |
download | keymaster-5e4c06a8b3aedca1e3cd29ae02edba71dc5d48c9.tar.gz |
Fix C++20 build am: 693745f801 am: 813b3f8eb4 am: 9baff9c12e
Original change: https://android-review.googlesource.com/c/platform/system/keymaster/+/2858029
Change-Id: I255382c4fe3923e9059ddf5cd2154ac0944b50dd
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
-rw-r--r-- | include/keymaster/keymaster_tags.h | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/include/keymaster/keymaster_tags.h b/include/keymaster/keymaster_tags.h index 29eae7c..dbd195c 100644 --- a/include/keymaster/keymaster_tags.h +++ b/include/keymaster/keymaster_tags.h @@ -102,7 +102,7 @@ template <keymaster_tag_type_t tag_type, keymaster_tag_t tag> class TypedTag { // Ensure that it's impossible to create a TypedTag instance whose 'tag' doesn't have type // 'tag_type'. Attempting to instantiate a tag with the wrong type will result in a compile // error (no match for template specialization StaticAssert<false>), with no run-time cost. - StaticAssert<(tag & tag_type) == tag_type>::check(); + StaticAssert<(static_cast<keymaster_tag_type_t>(tag) & tag_type) == tag_type>::check(); StaticAssert<(tag_type != KM_ENUM) && (tag_type != KM_ENUM_REP)>::check(); } // NOLINTNEXTLINE(google-explicit-constructor) @@ -120,7 +120,7 @@ class TypedEnumTag { // Ensure that it's impossible to create a TypedTag instance whose 'tag' doesn't have type // 'tag_type'. Attempting to instantiate a tag with the wrong type will result in a compile // error (no match for template specialization StaticAssert<false>), with no run-time cost. - StaticAssert<(tag & tag_type) == tag_type>::check(); + StaticAssert<(static_cast<keymaster_tag_type_t>(tag) & tag_type) == tag_type>::check(); StaticAssert<(tag_type == KM_ENUM) || (tag_type == KM_ENUM_REP)>::check(); } // NOLINTNEXTLINE(google-explicit-constructor) |