summaryrefslogtreecommitdiff
path: root/camera/common/1.0/default/CameraModule.cpp
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2018-11-26 22:07:08 -0800
committerElliott Hughes <enh@google.com>2018-11-27 16:40:33 +0000
commitd9de6aa270a911e28f982c4c46a9f5c752906e5c (patch)
treecee2b1d7309a5b6d3233c925394cb93b6c188abc /camera/common/1.0/default/CameraModule.cpp
parenta7cf248a8dedef03198cea3dab185931fdedb1fb (diff)
C++17 compatibility: add a non-const char* overload.
C++17 adds a non-const std::basic_string::data, so non-const std::strings in the test are `char*` and the const std::strings are `const char*`. See https://en.cppreference.com/w/cpp/string/basic_string/data for details. Without adding the non-const overload, the varargs overload is preferred, leading to static_assert failures: In file included from hardware/interfaces/keymaster/3.0/vts/functional/keymaster_hidl_hal_test.cpp:33: In file included from hardware/interfaces/keymaster/3.0/vts/functional/authorization_set.h:20: hardware/interfaces/keymaster/3.0/vts/functional/keymaster_tags.h:257:5: error: static_assert failed "Authorization other then TagType::BOOL take exactly one parameter." static_assert(tag_type == TagType::BOOL || (sizeof...(args) == 1), ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ hardware/interfaces/keymaster/3.0/vts/functional/authorization_set.h:213:19: note: in instantiation of function template specialization 'android::hardware::keymaster::V3_0::Authorization<android::hardware::keymaster::V3_0::TagType::BYTES, android::hardware::keymaster::V3_0::Tag::ASSOCIATED_DATA, char *, unsigned long>' requested here push_back(Authorization(tag, std::forward<Value>(val)...)); ^ hardware/interfaces/keymaster/3.0/vts/functional/authorization_set.h:245:9: note: in instantiation of function template specialization 'android::hardware::keymaster::V3_0::AuthorizationSet::push_back<android::hardware::keymaster::V3_0::TypedTag<android::hardware::keymaster::V3_0::TagType::BYTES, android::hardware::keymaster::V3_0::Tag::ASSOCIATED_DATA>, char *, unsigned long>' requested here push_back(ttag, std::forward<ValueType>(value)...); ^ hardware/interfaces/keymaster/3.0/vts/functional/keymaster_hidl_hal_test.cpp:3426:35: note: in instantiation of function template specialization 'android::hardware::keymaster::V3_0::AuthorizationSetBuilder::Authorization<android::hardware::keymaster::V3_0::TypedTag<android::hardware::keymaster::V3_0::TagType::BYTES, android::hardware::keymaster::V3_0::Tag::ASSOCIATED_DATA>, char *, unsigned long>' requested here AuthorizationSetBuilder().Authorization(TAG_ASSOCIATED_DATA, aad.data(), aad.size()); ^ Bug: http://b/111067277 Test: builds Change-Id: I3d70fb5a41db16cc9dff50364cd793e0c3510ed0
Diffstat (limited to 'camera/common/1.0/default/CameraModule.cpp')
0 files changed, 0 insertions, 0 deletions