From 478fd4e90cc134158f87686ac9c4ed6ad99421e4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonathan=20M=C3=BCller?= Date: Mon, 30 Oct 2017 09:47:32 +0100 Subject: [PATCH] Fix compilation errors --- src/libclang/template_parser.cpp | 2 +- src/libclang/type_parser.cpp | 2 +- test/cpp_attribute.cpp | 24 ++++++++++++++---------- 3 files changed, 16 insertions(+), 12 deletions(-) diff --git a/src/libclang/template_parser.cpp b/src/libclang/template_parser.cpp index 96117f8..1ba1281 100644 --- a/src/libclang/template_parser.cpp +++ b/src/libclang/template_parser.cpp @@ -116,7 +116,7 @@ namespace detail::parse_type(context, cur, type), is_variadic, std::move(def)); result->add_attribute(attributes); - return result; + return std::move(result); } std::unique_ptr parse_template_parameter( diff --git a/src/libclang/type_parser.cpp b/src/libclang/type_parser.cpp index b17e429..bfbd946 100644 --- a/src/libclang/type_parser.cpp +++ b/src/libclang/type_parser.cpp @@ -769,5 +769,5 @@ std::unique_ptr detail::parse_cpp_type_alias(const detail::parse_con result->add_attribute(detail::parse_attributes(stream)); } - return result; + return std::move(result); } diff --git a/test/cpp_attribute.cpp b/test/cpp_attribute.cpp index 72ea3f4..733ce98 100644 --- a/test/cpp_attribute.cpp +++ b/test/cpp_attribute.cpp @@ -45,8 +45,7 @@ alignas(type) int var; auto check_attribute = [](const cpp_attribute& attr, const char* name, type_safe::optional scope, bool variadic, - const char* args = "", - cpp_attribute_kind kind = cpp_attribute_kind::unknown) { + const char* args, cpp_attribute_kind kind) { REQUIRE(attr.kind() == kind); REQUIRE(attr.name() == name); REQUIRE(attr.scope() == scope); @@ -71,27 +70,32 @@ alignas(type) int var; REQUIRE(has_attribute(e, "attribute1")); REQUIRE(has_attribute(e, "attribute2")); check_attribute(attr, "attribute1", type_safe::nullopt, - false); + false, "", cpp_attribute_kind::unknown); check_attribute(attributes[1u], "attribute2", - type_safe::nullopt, false); + type_safe::nullopt, false, "", + cpp_attribute_kind::unknown); } else if (e.name() == "c") - check_attribute(attr, "variadic", type_safe::nullopt, - true); + check_attribute(attr, "variadic", type_safe::nullopt, true, + "", cpp_attribute_kind::unknown); else if (e.name() == "d") { REQUIRE(has_attribute(e, "ns::attribute")); - check_attribute(attr, "attribute", "ns", false); + check_attribute(attr, "attribute", "ns", false, "", + cpp_attribute_kind::unknown); } else if (e.name() == "e") check_attribute(attr, "attribute", type_safe::nullopt, - false, R"(arg1,arg2,+(){},42,"Hello!")"); + false, R"(arg1,arg2,+(){},42,"Hello!")", + cpp_attribute_kind::unknown); else if (e.name() == "f") { REQUIRE(attributes.size() == 2u); - check_attribute(attr, "attribute", "ns", false, "+,-,0 4"); + check_attribute(attr, "attribute", "ns", false, "+,-,0 4", + cpp_attribute_kind::unknown); check_attribute(attributes[1u], "other_attribute", - type_safe::nullopt, false); + type_safe::nullopt, false, "", + cpp_attribute_kind::unknown); } else if (e.name() == "g") {