diff options
author | Henri Chataing <henrichataing@google.com> | 2023-12-07 22:09:59 +0000 |
---|---|---|
committer | Henri Chataing <henrichataing@google.com> | 2023-12-14 18:47:34 +0000 |
commit | 280ac734ed5a8cf56f2d3ceed4159ccfc339cd27 (patch) | |
tree | 208a36b8908f8dc28bd829e9dd6cfc9a1105b995 | |
parent | 44ca5590c46999d074ce8f573a2b9586b87a86ed (diff) | |
download | aidl-280ac734ed5a8cf56f2d3ceed4159ccfc339cd27.tar.gz |
Update fmtlib to 10.1.1
Test: m
Bug: 310046696
Change-Id: I8925824ee86de1fca1fb3a1a311706251fcc23f8
-rw-r--r-- | aidl_to_cpp_common.cpp | 6 | ||||
-rw-r--r-- | aidl_unittest.cpp | 2 |
2 files changed, 4 insertions, 4 deletions
diff --git a/aidl_to_cpp_common.cpp b/aidl_to_cpp_common.cpp index 2856bf14..82ec44c3 100644 --- a/aidl_to_cpp_common.cpp +++ b/aidl_to_cpp_common.cpp @@ -353,7 +353,7 @@ void GenerateParcelableComparisonOperators(CodeWriter& out, const AidlParcelable auto name = parcelable.GetName(); auto max_tag = parcelable.GetFields().back()->GetName(); auto min_tag = parcelable.GetFields().front()->GetName(); - auto tmpl = R"--(static int _cmp(const {name}& _lhs, const {name}& _rhs) {{ + constexpr auto tmpl = R"--(static int _cmp(const {name}& _lhs, const {name}& _rhs) {{ return _cmp_value(_lhs.getTag(), _rhs.getTag()) || _cmp_value_at<{max_tag}>(_lhs, _rhs); }} template <Tag _Tag> @@ -576,7 +576,7 @@ void UnionWriter::PublicFields(CodeWriter& out) const { field_types.push_back(name_of(f->GetType(), typenames)); } auto typelist = Join(field_types, ", "); - auto tmpl = R"--( + constexpr auto tmpl = R"--( template <Tag _Tag> using _at = typename std::tuple_element<static_cast<size_t>(_Tag), std::tuple<{typelist}>>::type; template <Tag _Tag, typename _Type> @@ -612,7 +612,7 @@ void set(_Type&& _arg) {{ const auto& default_value = name_of(first_field->GetType(), typenames) + "(" + first_field->ValueString(decorator) + ")"; - auto tmpl = R"--( + constexpr auto tmpl = R"--( template<typename _Tp> static constexpr bool _not_self = !std::is_same_v<std::remove_cv_t<std::remove_reference_t<_Tp>>, {name}>; diff --git a/aidl_unittest.cpp b/aidl_unittest.cpp index 3ddbb36b..dce0ba6b 100644 --- a/aidl_unittest.cpp +++ b/aidl_unittest.cpp @@ -5701,7 +5701,7 @@ class AidlTypeParamTest io.SetFileContents("a/Enum.aidl", "package a; enum Enum { A }"); io.SetFileContents("a/Union.aidl", "package a; union Union { int a; }"); io.SetFileContents("a/Foo.aidl", "package a; parcelable Foo { int a; }"); - std::string decl = fmt::format(generic_type_decl, std::get<1>(param).literal); + std::string decl = fmt::format(fmt::runtime(generic_type_decl), std::get<1>(param).literal); if (nullable) { decl = "@nullable " + decl; } |