Update clang-format

This commit is contained in:
Jonathan Müller 2018-09-20 19:57:03 +02:00
commit 9f18b7f4d8
89 changed files with 11377 additions and 11546 deletions

View file

@ -12,32 +12,32 @@ using namespace cppast;
namespace
{
const char* get_attribute_name(cpp_attribute_kind kind) noexcept
const char* get_attribute_name(cpp_attribute_kind kind) noexcept
{
switch (kind)
{
switch (kind)
{
case cpp_attribute_kind::alignas_:
return "alignas";
case cpp_attribute_kind::carries_dependency:
return "carries_dependency";
case cpp_attribute_kind::deprecated:
return "deprecated";
case cpp_attribute_kind::fallthrough:
return "fallthrough";
case cpp_attribute_kind::maybe_unused:
return "maybe_unused";
case cpp_attribute_kind::nodiscard:
return "nodiscard";
case cpp_attribute_kind::noreturn:
return "noreturn";
case cpp_attribute_kind::alignas_:
return "alignas";
case cpp_attribute_kind::carries_dependency:
return "carries_dependency";
case cpp_attribute_kind::deprecated:
return "deprecated";
case cpp_attribute_kind::fallthrough:
return "fallthrough";
case cpp_attribute_kind::maybe_unused:
return "maybe_unused";
case cpp_attribute_kind::nodiscard:
return "nodiscard";
case cpp_attribute_kind::noreturn:
return "noreturn";
case cpp_attribute_kind::unknown:
return "unknown";
}
return "<error>";
case cpp_attribute_kind::unknown:
return "unknown";
}
return "<error>";
}
} // namespace
cpp_attribute::cpp_attribute(cpp_attribute_kind kind,
type_safe::optional<cpp_token_string> arguments)
@ -49,13 +49,13 @@ cpp_attribute::cpp_attribute(cpp_attribute_kind kind,
type_safe::optional_ref<const cpp_attribute> cppast::has_attribute(
const cpp_attribute_list& attributes, const std::string& name)
{
auto iter =
std::find_if(attributes.begin(), attributes.end(), [&](const cpp_attribute& attribute) {
if (attribute.scope())
return attribute.scope().value() + "::" + attribute.name() == name;
else
return attribute.name() == name;
});
auto iter
= std::find_if(attributes.begin(), attributes.end(), [&](const cpp_attribute& attribute) {
if (attribute.scope())
return attribute.scope().value() + "::" + attribute.name() == name;
else
return attribute.name() == name;
});
if (iter == attributes.end())
return nullptr;
@ -66,9 +66,9 @@ type_safe::optional_ref<const cpp_attribute> cppast::has_attribute(
type_safe::optional_ref<const cpp_attribute> cppast::has_attribute(
const cpp_attribute_list& attributes, cpp_attribute_kind kind)
{
auto iter =
std::find_if(attributes.begin(), attributes.end(),
[&](const cpp_attribute& attribute) { return attribute.kind() == kind; });
auto iter
= std::find_if(attributes.begin(), attributes.end(),
[&](const cpp_attribute& attribute) { return attribute.kind() == kind; });
if (iter == attributes.end())
return nullptr;