Update copyright notices

This commit is contained in:
Jonathan Müller 2022-02-07 20:43:22 +01:00
commit 62e571a4d6
133 changed files with 936 additions and 1103 deletions

View file

@ -1,6 +1,5 @@
// Copyright (C) 2017-2019 Jonathan Müller <jonathanmueller.dev@gmail.com>
// This file is subject to the license terms in the LICENSE file
// found in the top-level directory of this distribution.
// Copyright (C) 2017-2022 Jonathan Müller and cppast contributors
// SPDX-License-Identifier: MIT
#include <cppast/cpp_function.hpp>
@ -104,15 +103,15 @@ void n(int i = int());
else if (param.name() == "b")
{
REQUIRE(equal_types(idx, param.type(),
*cpp_pointer_type::build(
cpp_builtin_type::build(cpp_float))));
*cpp_pointer_type::build(
cpp_builtin_type::build(cpp_float))));
REQUIRE(param.default_value());
REQUIRE(
equal_expressions(param.default_value().value(),
*cpp_unexposed_expression::
build(cpp_pointer_type::build(
cpp_builtin_type::build(cpp_float)),
cpp_token_string::tokenize("nullptr"))));
equal_expressions(param.default_value().value(),
*cpp_unexposed_expression::
build(cpp_pointer_type::build(
cpp_builtin_type::build(cpp_float)),
cpp_token_string::tokenize("nullptr"))));
}
else
REQUIRE(false);
@ -124,14 +123,14 @@ void n(int i = int());
else if (func.name() == "c")
{
REQUIRE(
equal_types(idx, func.return_type(),
*cpp_reference_type::
build(cpp_array_type::build(cpp_builtin_type::build(cpp_int),
cpp_literal_expression::
build(cpp_builtin_type::build(
cpp_ulonglong),
"10")),
cpp_ref_lvalue)));
equal_types(idx, func.return_type(),
*cpp_reference_type::
build(cpp_array_type::build(cpp_builtin_type::build(cpp_int),
cpp_literal_expression::
build(cpp_builtin_type::build(
cpp_ulonglong),
"10")),
cpp_ref_lvalue)));
REQUIRE(func.signature() == "(decltype(42),...)");
auto count = 0u;
@ -140,10 +139,10 @@ void n(int i = int());
if (param.name() == "a")
{
REQUIRE(equal_types(idx, param.type(),
*cpp_decltype_type::build(
cpp_unexposed_expression::
build(cpp_builtin_type::build(cpp_int),
cpp_token_string::tokenize("42")))));
*cpp_decltype_type::build(
cpp_unexposed_expression::
build(cpp_builtin_type::build(cpp_int),
cpp_token_string::tokenize("42")))));
REQUIRE(!param.default_value());
}
else
@ -166,10 +165,10 @@ void n(int i = int());
REQUIRE(equal_types(idx, param.type(), *cpp_builtin_type::build(cpp_int)));
REQUIRE(param.default_value());
REQUIRE(equal_expressions(param.default_value().value(),
*cpp_unexposed_expression::
build(cpp_pointer_type::build(
cpp_builtin_type::build(cpp_int)),
cpp_token_string::tokenize("int()"))));
*cpp_unexposed_expression::
build(cpp_pointer_type::build(
cpp_builtin_type::build(cpp_int)),
cpp_token_string::tokenize("int()"))));
}
else
REQUIRE(false);
@ -192,20 +191,20 @@ void n(int i = int());
auto bool_t = cpp_builtin_type::build(cpp_bool);
if (func.name() == "d")
REQUIRE(
equal_expressions(func.noexcept_condition().value(),
*cpp_literal_expression::build(std::move(bool_t), "true")));
equal_expressions(func.noexcept_condition().value(),
*cpp_literal_expression::build(std::move(bool_t), "true")));
else if (func.name() == "e")
REQUIRE(
equal_expressions(func.noexcept_condition().value(),
*cpp_unexposed_expression::build(std::move(bool_t),
cpp_token_string::tokenize(
"false"))));
equal_expressions(func.noexcept_condition().value(),
*cpp_unexposed_expression::build(std::move(bool_t),
cpp_token_string::tokenize(
"false"))));
else if (func.name() == "f")
REQUIRE(
equal_expressions(func.noexcept_condition().value(),
*cpp_unexposed_expression::build(std::move(bool_t),
cpp_token_string::tokenize(
"noexcept(d())"))));
equal_expressions(func.noexcept_condition().value(),
*cpp_unexposed_expression::build(std::move(bool_t),
cpp_token_string::tokenize(
"noexcept(d())"))));
}
else if (func.name() == "g" || func.name() == "h" || func.name() == "i"
|| func.name() == "j")
@ -259,8 +258,8 @@ void n(int i = int());
else if (func.name() == "m")
{
REQUIRE(equal_types(idx, func.return_type(),
*cpp_user_defined_type::build(
cpp_type_ref(cpp_entity_id(""), "ns::m"))));
*cpp_user_defined_type::build(
cpp_type_ref(cpp_entity_id(""), "ns::m"))));
REQUIRE(count_children(func.parameters()) == 0u);
REQUIRE(!func.is_variadic());
REQUIRE(!func.noexcept_condition());
@ -362,9 +361,9 @@ void foo::a() {}
REQUIRE(equal_types(idx, func.return_type(), *cpp_builtin_type::build(cpp_int)));
REQUIRE(func.noexcept_condition());
REQUIRE(
equal_expressions(func.noexcept_condition().value(),
*cpp_literal_expression::build(cpp_builtin_type::build(cpp_bool),
"true")));
equal_expressions(func.noexcept_condition().value(),
*cpp_literal_expression::build(cpp_builtin_type::build(cpp_bool),
"true")));
REQUIRE(!func.is_constexpr());
REQUIRE(func.body_kind() == cpp_function_definition);
}