Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Next x3 grammar v2 #59

Open
wants to merge 14 commits into
base: main
Choose a base branch
from
Open

Next x3 grammar v2 #59

wants to merge 14 commits into from

Conversation

ibis-hdl
Copy link
Owner

Merge into Main in 2024

Olaf and others added 12 commits June 30, 2022 14:11
- import of old branch of rework
- rebased to current main branch (and dated forward)

ToDo:
- tagging doesn't work as expected, see syntax.cpp; there where backports
  from github IIRC???
  * Node 'struct entity_declaration' not tagged - internal error, BUT
  * works with architecture_body !!! There is a discrepancy
- the label match check API is insufficient to gather these errors easily
- rewrite TESTs
- x3::rule<..>( name ) names the rule for error handling; getting it
  the right name lowers the lookup in make_error_description()
  inside error_handler.
- disabled since compile time increases dramatically
- added comment rule to grammar
- replaced phrase_parse() by parse() and removed skipper.hpp
- replace design_file entry with grammar_entry
- cleanup parser's parse.hpp API
- add comment
- parse() catches also x3::expectation_failure
- using testsuite namespace for all test; it's single test suite which
  shouldn't collide with other test during compile time
- added test for
  - bit_string_literal
- fix GPL3-or-later
- apply Clang-format
- add testsuite for Spirit X3 charset:
  - Spirit X3 doesn't support full set, also compare function for
    x3::no_case doesn't work
- todo.md extended
- add soft hyphen to charset, also documentation
Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

There were too many comments to post at once. Showing the first 25 out of 64. Check the log or trigger a new build to see more.

@@ -5,11 +5,21 @@

#pragma once

#include <ibis/vhdl/ast/node/association_element.hpp>
#include <ibis/vhdl/ast/util/variant.hpp>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: 'ibis/vhdl/ast/util/variant.hpp' file not found [clang-diagnostic-error]

#include <ibis/vhdl/ast/util/variant.hpp>
         ^

#include <vector>

namespace ibis::vhdl::ast {

struct association_element : position_tagged {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: constructor does not initialize these fields: formal_part, actual_part [cppcoreguidelines-pro-type-member-init]

source/vhdl/include/ibis/vhdl/ast/node/association_list.hpp:18:

-     optional<ast::formal_part> formal_part;
-     ast::actual_part actual_part;
+     optional<ast::formal_part> formal_part{};
+     ast::actual_part actual_part{};

@@ -6,6 +6,7 @@
#pragma once

#include <ibis/vhdl/ast/util/position_tagged.hpp>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: 'ibis/vhdl/ast/util/position_tagged.hpp' file not found [clang-diagnostic-error]

#include <ibis/vhdl/ast/util/position_tagged.hpp>
         ^

ast::primary primary_lhs;
operator_token operator_;
ast::primary primary_rhs;
struct chunk {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: constructor does not initialize these fields: operator_, primary [cppcoreguidelines-pro-type-member-init]

source/vhdl/include/ibis/vhdl/ast/node/factor.hpp:19:

-         operator_token operator_;
-         ast::primary primary;
+         operator_token operator_{};
+         ast::primary primary{};

@@ -8,12 +8,13 @@
#include <ibis/vhdl/ast/util/position_tagged.hpp>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: 'ibis/vhdl/ast/util/position_tagged.hpp' file not found [clang-diagnostic-error]

#include <ibis/vhdl/ast/util/position_tagged.hpp>
         ^

constexpr std::size_t len = (Strs.size() + ... + 0);
std::array<char, len + 1> arr{};
auto append = [i = 0, &arr](auto const& s) mutable {
for (auto c : s) arr[i++] = c;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: statement should be inside braces [readability-braces-around-statements]

Suggested change
for (auto c : s) arr[i++] = c;
for (auto c : s) { arr[i++] = c;
}

constexpr std::size_t len = (Strs.size() + ... + 0);
std::array<char, len + 1> arr{};
auto append = [i = 0, &arr](auto const& s) mutable {
for (auto c : s) arr[i++] = c;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: variable name 'c' is too short, expected at least 3 characters [readability-identifier-length]

            for (auto c : s) arr[i++] = c;
                      ^

};
// Helper to get the value out
template <std::string_view const&... Strs>
static constexpr auto join_v = join<Strs...>::value;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: 'join_v' is a static definition in anonymous namespace; static is redundant here [readability-static-definition-in-anonymous-namespace]

Suggested change
static constexpr auto join_v = join<Strs...>::value;
constexpr auto join_v = join<Strs...>::value;

// NOLINTNEXTLINE(cppcoreguidelines-macro-usage)
#define BOOST_TEST_MODULE Spirit X3 Test Suite

#include <boost/test/unit_test.hpp> // IWYU pragma: keep
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: 'boost/test/unit_test.hpp' file not found [clang-diagnostic-error]

#include <boost/test/unit_test.hpp>  // IWYU pragma: keep
         ^


#pragma once

#include <testsuite/util/dataset_loader.hpp>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: 'testsuite/util/dataset_loader.hpp' file not found [clang-diagnostic-error]

#include <testsuite/util/dataset_loader.hpp>
         ^

Copy link
Contributor

Cpp-Linter Report ⚠️

Some files did not pass the configured checks!

clang-format (v18.1.3) reports: 8 file(s) not formatted
  • source/common/include/ibis/util/file/file_loader.hpp
  • source/vhdl/include/ibis/vhdl/analyze/check/label_match.hpp
  • source/vhdl/include/ibis/vhdl/ast.hpp
  • source/vhdl/include/ibis/vhdl/ast/basic_ast_walker.hpp
  • source/vhdl/include/ibis/vhdl/parser/grammar_def.hpp
  • source/vhdl/src/ast/ast_printer.cpp
  • testsuite/spirit_x3/src/test/lexical_elements.cpp
  • testsuite/vhdl/grammar/include/testsuite/vhdl/grammar/dataset.hpp
clang-tidy (v18.1.3) reports: 131 concern(s)
  • testsuite/spirit_x3/src/test/lexical_elements.cpp:4:1: warning: [misc-include-cleaner]

    included header x3.hpp is not used directly

        4 | #include <boost/spirit/home/x3.hpp>
          | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        5 | #include <boost/spirit/home/x3/support/utility/error_reporting.hpp>
  • testsuite/spirit_x3/src/test/lexical_elements.cpp:5:1: warning: [misc-include-cleaner]

    included header error_reporting.hpp is not used directly

        5 | #include <boost/spirit/home/x3/support/utility/error_reporting.hpp>
          | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        6 | 
  • testsuite/spirit_x3/src/test/lexical_elements.cpp:9:1: warning: [misc-include-cleaner]

    included header iomanip is not used directly

        9 | #include <iomanip>
          | ^~~~~~~~~~~~~~~~~~
       10 | 
  • testsuite/spirit_x3/src/test/lexical_elements.cpp:23:24: warning: [misc-include-cleaner]

    no header providing "std::size_t" is directly included

        7 |         constexpr std::size_t len = (Strs.size() + ... + 0);
          |                        ^
  • testsuite/spirit_x3/src/test/lexical_elements.cpp:25:24: warning: [readability-identifier-length]

    variable name 'i' is too short, expected at least 3 characters

       25 |         auto append = [i = 0, &arr](auto const& s) mutable {
          |                        ^
  • testsuite/spirit_x3/src/test/lexical_elements.cpp:25:49: warning: [readability-identifier-length]

    parameter name 's' is too short, expected at least 3 characters

       25 |         auto append = [i = 0, &arr](auto const& s) mutable {
          |                                                 ^
  • testsuite/spirit_x3/src/test/lexical_elements.cpp:26:23: warning: [readability-identifier-length]

    variable name 'c' is too short, expected at least 3 characters

       26 |             for (auto c : s) arr[i++] = c;
          |                       ^
  • testsuite/spirit_x3/src/test/lexical_elements.cpp:26:29: warning: [readability-braces-around-statements]

    statement should be inside braces

       26 |             for (auto c : s) arr[i++] = c;
          |                             ^             
          |                              {
  • testsuite/spirit_x3/src/test/lexical_elements.cpp:26:30: warning: [cppcoreguidelines-pro-bounds-constant-array-index]

    do not use array subscript when the index is not an integer constant expression

       26 |             for (auto c : s) arr[i++] = c;
          |                              ^
  • testsuite/spirit_x3/src/test/lexical_elements.cpp:39:23: warning: [readability-static-definition-in-anonymous-namespace]

    'join_v' is a static definition in anonymous namespace; static is redundant here

       39 | static constexpr auto join_v = join<Strs...>::value;
          |                       ^
    note: this fix will not be applied because it overlaps with another fix
  • testsuite/spirit_x3/src/test/lexical_elements.cpp:39:23: warning: [readability-static-definition-in-anonymous-namespace]

    'join_v<vhdl::upper_case_letter, vhdl::digit, vhdl::special_character, vhdl::lower_case_letter, vhdl::other_special_character>' is a static definition in anonymous namespace; static is redundant here

    note: this fix will not be applied because it overlaps with another fix
  • testsuite/spirit_x3/src/test/lexical_elements.cpp:39:23: warning: [readability-static-definition-in-anonymous-namespace]

    'join_v<vhdl::upper_case_letter, vhdl::digit, vhdl::special_character>' is a static definition in anonymous namespace; static is redundant here

    note: this fix will not be applied because it overlaps with another fix
  • testsuite/spirit_x3/src/test/lexical_elements.cpp:39:23: warning: [readability-static-definition-in-anonymous-namespace]

    'join_v<vhdl::upper_case_letter, vhdl::lower_case_letter>' is a static definition in anonymous namespace; static is redundant here

    note: this fix will not be applied because it overlaps with another fix
  • testsuite/spirit_x3/src/test/lexical_elements.cpp:67:1: warning: [misc-include-cleaner]

    no header providing "BOOST_AUTO_TEST_SUITE" is directly included

        7 | BOOST_AUTO_TEST_SUITE(lexical_elements)
          | ^
  • testsuite/spirit_x3/src/test/lexical_elements.cpp:70:1: warning: [misc-include-cleaner]

    no header providing "BOOST_AUTO_TEST_CASE" is directly included

       70 | BOOST_AUTO_TEST_CASE(character_set)
          | ^
  • testsuite/spirit_x3/src/test/lexical_elements.cpp:85:40: warning: [misc-include-cleaner]

    no header providing "boost::spirit::x3::rule" is directly included

        5 |     auto const graphic_character = x3::rule<struct _, char>{ "graphic_character" } = [&]() {
          |                                        ^
  • testsuite/spirit_x3/src/test/lexical_elements.cpp:90:35: warning: [misc-include-cleaner]

    no header providing "boost::spirit::x3::iso8859_1::graph" is directly included

        5 |             return x3::iso8859_1::graph;
          |                                   ^
  • testsuite/spirit_x3/src/test/lexical_elements.cpp:93:24: warning: [misc-include-cleaner]

    no header providing "boost::spirit::x3::char_" is directly included

        5 |             return x3::char_(std::string(graphic_character_v));
          |                        ^
  • testsuite/spirit_x3/src/test/lexical_elements.cpp:93:35: warning: [misc-include-cleaner]

    no header providing "std::string" is directly included

        7 |             return x3::char_(std::string(graphic_character_v));
          |                                   ^
  • testsuite/spirit_x3/src/test/lexical_elements.cpp:106:35: warning: [misc-include-cleaner]

    no header providing "boost::spirit::x3::parse" is directly included

        5 |         bool const parse_ok = x3::parse(begin(chr_set), end(chr_set), 
          |                                   ^
  • testsuite/spirit_x3/src/test/lexical_elements.cpp:107:39: warning: [misc-include-cleaner]

    no header providing "boost::spirit::x3::eoi" is directly included

        5 |             +graphic_character >> x3::eoi, attr);
          |                                       ^
  • testsuite/spirit_x3/src/test/lexical_elements.cpp:108:9: warning: [misc-include-cleaner]

    no header providing "BOOST_TEST" is directly included

        7 |         BOOST_TEST(parse_ok == true);
          |         ^
  • testsuite/spirit_x3/src/test/lexical_elements.cpp:131:35: warning: [misc-include-cleaner]

    no header providing "boost::spirit::x3::iso8859_1::alpha" is directly included

      131 |             return x3::iso8859_1::alpha;
          |                                   ^
  • testsuite/spirit_x3/src/test/lexical_elements.cpp:149:17: warning: [misc-include-cleaner]

    no header providing "boost::spirit::x3::no_case" is directly included

        5 |             x3::no_case[ +identifier ]  >> x3::eoi,
          |                 ^
  • testsuite/spirit_x3/src/test/lexical_elements.cpp:157:1: warning: [misc-include-cleaner]

    no header providing "BOOST_AUTO_TEST_SUITE_END" is directly included

      157 | BOOST_AUTO_TEST_SUITE_END()
          | ^
  • testsuite/vhdl/grammar/include/testsuite/vhdl/grammar/dataset.hpp:10:1: warning: [misc-include-cleaner]

    included header monomorphic.hpp is not used directly

       10 | #include <boost/test/data/monomorphic.hpp>
          | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       11 | 
  • testsuite/vhdl/grammar/include/testsuite/vhdl/grammar/dataset.hpp:51:8: warning: [misc-include-cleaner]

    no header providing "boost::unit_test::data::monomorphic::is_dataset" is directly included

       13 | struct is_dataset<testsuite::dataset> : boost::mpl::true_ {
          |        ^
  • testsuite/vhdl/grammar/include/testsuite/vhdl/grammar/dataset.hpp:51:53: warning: [misc-include-cleaner]

    no header providing "boost::mpl::true_" is directly included

       13 | struct is_dataset<testsuite::dataset> : boost::mpl::true_ {
          |                                                     ^
  • testsuite/vhdl/grammar/include/testsuite/vhdl/grammar/detail/pch_default.hpp:9:1: warning: [misc-include-cleaner]

    included header filesystem is not used directly

        9 | #include <filesystem>
          | ^~~~~~~~~~~~~~~~~~~~~
       10 | #include <fstream>
  • testsuite/vhdl/grammar/include/testsuite/vhdl/grammar/detail/pch_default.hpp:10:1: warning: [misc-include-cleaner]

    included header fstream is not used directly

       10 | #include <fstream>
          | ^~~~~~~~~~~~~~~~~~
       11 | #include <iterator>
  • testsuite/vhdl/grammar/include/testsuite/vhdl/grammar/detail/pch_default.hpp:11:1: warning: [misc-include-cleaner]

    included header iterator is not used directly

       11 | #include <iterator>
          | ^~~~~~~~~~~~~~~~~~~
       12 | #include <optional>
  • testsuite/vhdl/grammar/include/testsuite/vhdl/grammar/detail/pch_default.hpp:12:1: warning: [misc-include-cleaner]

    included header optional is not used directly

       12 | #include <optional>
          | ^~~~~~~~~~~~~~~~~~~
       13 | #include <regex>
  • testsuite/vhdl/grammar/include/testsuite/vhdl/grammar/detail/pch_default.hpp:13:1: warning: [misc-include-cleaner]

    included header regex is not used directly

       13 | #include <regex>
          | ^~~~~~~~~~~~~~~~
       14 | #include <set>
  • testsuite/vhdl/grammar/include/testsuite/vhdl/grammar/detail/pch_default.hpp:14:1: warning: [misc-include-cleaner]

    included header set is not used directly

       14 | #include <set>
          | ^~~~~~~~~~~~~~
       15 | #include <string_view>
  • testsuite/vhdl/grammar/include/testsuite/vhdl/grammar/detail/pch_default.hpp:15:1: warning: [misc-include-cleaner]

    included header string_view is not used directly

       15 | #include <string_view>
          | ^~~~~~~~~~~~~~~~~~~~~~
       16 | 
  • testsuite/vhdl/grammar/include/testsuite/vhdl/grammar/detail/pch_default.hpp:18:1: warning: [misc-include-cleaner]

    included header bind.hpp is not used directly

       18 | #include <boost/bind/bind.hpp>
          | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       19 | 
  • testsuite/vhdl/grammar/include/testsuite/vhdl/grammar/detail/pch_default.hpp:20:1: warning: [misc-include-cleaner]

    included header test_tools.hpp is not used directly

       20 | #include <boost/test/test_tools.hpp>
          | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       21 | #include <boost/test/unit_test_suite.hpp>
  • testsuite/vhdl/grammar/include/testsuite/vhdl/grammar/detail/pch_default.hpp:21:1: warning: [misc-include-cleaner]

    included header unit_test_suite.hpp is not used directly

       21 | #include <boost/test/unit_test_suite.hpp>
          | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       22 | #include <boost/test/results_collector.hpp>
  • testsuite/vhdl/grammar/include/testsuite/vhdl/grammar/detail/pch_default.hpp:22:1: warning: [misc-include-cleaner]

    included header results_collector.hpp is not used directly

       22 | #include <boost/test/results_collector.hpp>
          | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       23 | #include <boost/test/tools/output_test_stream.hpp>
  • testsuite/vhdl/grammar/include/testsuite/vhdl/grammar/detail/pch_default.hpp:23:1: warning: [misc-include-cleaner]

    included header output_test_stream.hpp is not used directly

       23 | #include <boost/test/tools/output_test_stream.hpp>
          | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       24 | #include <boost/test/data/size.hpp>
  • testsuite/vhdl/grammar/include/testsuite/vhdl/grammar/detail/pch_default.hpp:24:1: warning: [misc-include-cleaner]

    included header size.hpp is not used directly

       24 | #include <boost/test/data/size.hpp>
          | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       25 | #include <boost/test/data/monomorphic.hpp>
  • testsuite/vhdl/grammar/include/testsuite/vhdl/grammar/detail/pch_default.hpp:25:1: warning: [misc-include-cleaner]

    included header monomorphic.hpp is not used directly

       25 | #include <boost/test/data/monomorphic.hpp>
          | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       26 | #include <boost/test/data/for_each_sample.hpp>
  • testsuite/vhdl/grammar/include/testsuite/vhdl/grammar/detail/pch_default.hpp:26:1: warning: [misc-include-cleaner]

    included header for_each_sample.hpp is not used directly

       26 | #include <boost/test/data/for_each_sample.hpp>
          | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       27 | #include <boost/test/utils/string_cast.hpp>
  • testsuite/vhdl/grammar/include/testsuite/vhdl/grammar/detail/pch_default.hpp:27:1: warning: [misc-include-cleaner]

    included header string_cast.hpp is not used directly

       27 | #include <boost/test/utils/string_cast.hpp>
          | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       28 | 
  • testsuite/vhdl/grammar/include/testsuite/vhdl/grammar/detail/pch_default.hpp:29:1: warning: [misc-include-cleaner]

    included header auxiliary.hpp is not used directly

       29 | #include <boost/spirit/home/x3/auxiliary.hpp>
          | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       30 | #include <boost/spirit/home/x3/char.hpp>
  • testsuite/vhdl/grammar/include/testsuite/vhdl/grammar/detail/pch_default.hpp:30:1: warning: [misc-include-cleaner]

    included header char.hpp is not used directly

       30 | #include <boost/spirit/home/x3/char.hpp>
          | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       31 | #include <boost/spirit/home/x3/directive.hpp>
  • testsuite/vhdl/grammar/include/testsuite/vhdl/grammar/detail/pch_default.hpp:31:1: warning: [misc-include-cleaner]

    included header directive.hpp is not used directly

       31 | #include <boost/spirit/home/x3/directive.hpp>
          | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       32 | #include <boost/spirit/home/x3/nonterminal.hpp>
  • testsuite/vhdl/grammar/include/testsuite/vhdl/grammar/detail/pch_default.hpp:32:1: warning: [misc-include-cleaner]

    included header nonterminal.hpp is not used directly

       32 | #include <boost/spirit/home/x3/nonterminal.hpp>
          | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       33 | #include <boost/spirit/home/x3/numeric.hpp>
  • testsuite/vhdl/grammar/include/testsuite/vhdl/grammar/detail/pch_default.hpp:33:1: warning: [misc-include-cleaner]

    included header numeric.hpp is not used directly

       33 | #include <boost/spirit/home/x3/numeric.hpp>
          | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       34 | #include <boost/spirit/home/x3/operator.hpp>
  • testsuite/vhdl/grammar/include/testsuite/vhdl/grammar/detail/pch_default.hpp:34:1: warning: [misc-include-cleaner]

    included header operator.hpp is not used directly

       34 | #include <boost/spirit/home/x3/operator.hpp>
          | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       35 | #include <boost/spirit/home/x3/string.hpp>
  • testsuite/vhdl/grammar/include/testsuite/vhdl/grammar/detail/pch_default.hpp:35:1: warning: [misc-include-cleaner]

    included header string.hpp is not used directly

       35 | #include <boost/spirit/home/x3/string.hpp>
          | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       36 | #include <boost/spirit/home/x3/support/ast/variant.hpp>
  • testsuite/vhdl/grammar/include/testsuite/vhdl/grammar/detail/pch_default.hpp:36:1: warning: [misc-include-cleaner]

    included header variant.hpp is not used directly

       36 | #include <boost/spirit/home/x3/support/ast/variant.hpp>
          | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       37 | #include <boost/spirit/home/x3/support/traits/tuple_traits.hpp>
  • testsuite/vhdl/grammar/include/testsuite/vhdl/grammar/detail/pch_default.hpp:37:1: warning: [misc-include-cleaner]

    included header tuple_traits.hpp is not used directly

       37 | #include <boost/spirit/home/x3/support/traits/tuple_traits.hpp>
          | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       38 | #include <boost/spirit/home/x3/support/traits/is_variant.hpp>
  • testsuite/vhdl/grammar/include/testsuite/vhdl/grammar/detail/pch_default.hpp:38:1: warning: [misc-include-cleaner]

    included header is_variant.hpp is not used directly

       38 | #include <boost/spirit/home/x3/support/traits/is_variant.hpp>
          | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  • testsuite/vhdl/grammar/include/testsuite/vhdl/grammar/detail/pch_ibis.hpp:8:1: warning: [misc-include-cleaner]

    included header indent_stream.hpp is not used directly

        8 | #include <ibis/util/indent_stream.hpp>
          | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        9 | #include <ibis/util/pretty_typename.hpp>
  • testsuite/vhdl/grammar/include/testsuite/vhdl/grammar/detail/pch_ibis.hpp:9:1: warning: [misc-include-cleaner]

    included header pretty_typename.hpp is not used directly

        9 | #include <ibis/util/pretty_typename.hpp>
          | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       10 | 
  • testsuite/vhdl/grammar/include/testsuite/vhdl/grammar/detail/pch_ibis.hpp:11:1: warning: [misc-include-cleaner]

    included header ast_fwd.hpp is not used directly

       11 | #include <ibis/vhdl/ast_fwd.hpp>
          | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       12 | #include <ibis/vhdl/ast.hpp>
  • testsuite/vhdl/grammar/include/testsuite/vhdl/grammar/detail/pch_ibis.hpp:12:1: warning: [misc-include-cleaner]

    included header ast.hpp is not used directly

       12 | #include <ibis/vhdl/ast.hpp>
          | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
       13 | 
  • testsuite/vhdl/grammar/include/testsuite/vhdl/grammar/detail/pch_ibis.hpp:14:1: warning: [misc-include-cleaner]

    included header ast_printer.hpp is not used directly

       14 | #include <ibis/vhdl/ast/ast_printer.hpp>
          | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       15 | 
  • testsuite/vhdl/grammar/include/testsuite/vhdl/grammar/detail/pch_ibis.hpp:16:1: warning: [misc-include-cleaner]

    included header parser_config.hpp is not used directly

       16 | #include <ibis/vhdl/parser/parser_config.hpp>
          | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  • testsuite/vhdl/grammar/include/testsuite/vhdl/grammar/failure_diagnostic_fixture.hpp:29:14: warning: [misc-include-cleaner]

    no header providing "std::string_view" is directly included

        8 |         std::string_view input_extension() const override;
          |              ^
  • testsuite/vhdl/grammar/include/testsuite/vhdl/grammar/testsuite_parse.hpp:10:1: warning: [misc-include-cleaner]

    included header context.hpp is not used directly

       10 | #include <ibis/vhdl/parser/context.hpp>
          | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       11 | #include <ibis/vhdl/parser/parse.hpp>
  • testsuite/vhdl/grammar/include/testsuite/vhdl/grammar/testsuite_parse.hpp:12:1: warning: [misc-include-cleaner]

    included header ast.hpp is not used directly

       12 | #include <ibis/vhdl/ast.hpp>
          | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
       13 | 
  • testsuite/vhdl/grammar/include/testsuite/vhdl/grammar/testsuite_parse.hpp:14:1: warning: [misc-include-cleaner]

    included header ast_printer.hpp is not used directly

       14 | #include <ibis/vhdl/ast/ast_printer.hpp>
          | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       15 | #include <ibis/util/pretty_typename.hpp>
  • testsuite/vhdl/grammar/include/testsuite/vhdl/grammar/testsuite_parse.hpp:15:1: warning: [misc-include-cleaner]

    included header pretty_typename.hpp is not used directly

       15 | #include <ibis/util/pretty_typename.hpp>
          | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       16 | 
  • testsuite/vhdl/grammar/include/testsuite/vhdl/grammar/testsuite_parse.hpp:17:1: warning: [misc-include-cleaner]

    included header iostream is not used directly

       17 | #include <iostream>
          | ^~~~~~~~~~~~~~~~~~~
       18 | #include <filesystem>
  • testsuite/vhdl/grammar/include/testsuite/vhdl/grammar/testsuite_parse.hpp:18:1: warning: [misc-include-cleaner]

    included header filesystem is not used directly

       18 | #include <filesystem>
          | ^~~~~~~~~~~~~~~~~~~~~
       19 | 
  • testsuite/vhdl/grammar/include/testsuite/vhdl/grammar/testsuite_parse.hpp:20:1: warning: [misc-include-cleaner]

    included header namespace_alias.hpp is not used directly

       20 | #include <testsuite/namespace_alias.hpp>
          | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       21 | 
  • testsuite/vhdl/grammar/include/testsuite/vhdl/grammar/testsuite_parse.hpp:26:5: warning: [cppcoreguidelines-pro-type-member-init]

    constructor does not initialize these fields: filename

       26 |     testsuite_parse(fs::path const filename_)
          |     ^
  • testsuite/vhdl/grammar/include/testsuite/vhdl/grammar/testsuite_parse.hpp:26:21: error: [clang-diagnostic-error]

    use of undeclared identifier 'fs'

       26 |     testsuite_parse(fs::path const filename_)
          |                     ^
  • testsuite/vhdl/grammar/include/testsuite/vhdl/grammar/testsuite_parse.hpp:32:26: warning: [misc-include-cleaner]

    no header providing "std::string_view" is directly included

       20 | #include <testsuite/namespace_alias.hpp>
       21 | 
       22 | namespace testsuite {
       23 | 
       24 | class testsuite_parse {
       25 | public:
       26 |     testsuite_parse(fs::path const filename_)
       27 |         : filename{ filename_ }
       28 |     {
       29 |     }
       30 | 
       31 | public:
       32 |     bool operator()(std::string_view contents, vhdl::ast::design_file& design_file);
          |                          ^
  • testsuite/vhdl/grammar/include/testsuite/vhdl/grammar/testsuite_parse.hpp:40:10: warning: [misc-include-cleaner]

    no header providing "std::string" is directly included

       20 |     std::string output() const { return os.str(); }
          |          ^
  • testsuite/vhdl/grammar/include/testsuite/vhdl/grammar/testsuite_parse.hpp:46:5: error: [clang-diagnostic-error]

    use of undeclared identifier 'fs'

       46 |     fs::path const filename;
          |     ^
  • testsuite/vhdl/grammar/include/testsuite/vhdl/grammar/testsuite_parse.hpp:46:20: warning: [cppcoreguidelines-avoid-const-or-ref-data-members]

    member 'filename' of type 'const int' is const qualified

       46 |     fs::path const filename;
          |                    ^
  • testsuite/vhdl/grammar/src/dataset.cpp:7:1: warning: [misc-include-cleaner]

    included header cli_args.hpp is not used directly

        7 | #include <testsuite/util/cli_args.hpp>
          | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        8 | 
  • testsuite/vhdl/grammar/src/dataset.cpp:9:1: warning: [misc-include-cleaner]

    included header namespace_alias.hpp is not used directly

        9 | #include <testsuite/namespace_alias.hpp>
          | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
       10 | 
  • testsuite/vhdl/grammar/src/dataset.cpp:21:23: warning: [misc-include-cleaner]

    no header providing "std::string_view" is directly included

        6 | #include <testsuite/vhdl/grammar/dataset.hpp>
        7 | #include <testsuite/util/cli_args.hpp>
        8 | 
        9 | #include <testsuite/namespace_alias.hpp>
       10 | 
       11 | namespace testsuite {
       12 | 
       13 | // Quiet compiler warning: ... has no out-of-line virtual method definitions; its vtable will be
       14 | // emitted in every translation unit [-Wweak-vtables]
       15 | dataset::~dataset() = default;
       16 | 
       17 | // Quiet compiler warning: ... has no out-of-line virtual method definitions; its vtable will be
       18 | // emitted in every translation unit [-Wweak-vtables]
       19 | dataset::compile_builtin::~compile_builtin() = default;
       20 | 
       21 | dataset::dataset(std::string_view testcase_group)
          |                       ^
  • testsuite/vhdl/grammar/src/dataset.cpp:22:24: warning: [misc-include-cleaner]

    no header providing "testsuite::util::dataset_loader" is directly included

       10 | 
       11 | namespace testsuite {
       12 | 
       13 | // Quiet compiler warning: ... has no out-of-line virtual method definitions; its vtable will be
       14 | // emitted in every translation unit [-Wweak-vtables]
       15 | dataset::~dataset() = default;
       16 | 
       17 | // Quiet compiler warning: ... has no out-of-line virtual method definitions; its vtable will be
       18 | // emitted in every translation unit [-Wweak-vtables]
       19 | dataset::compile_builtin::~compile_builtin() = default;
       20 | 
       21 | dataset::dataset(std::string_view testcase_group)
       22 |     : testsuite::util::dataset_loader(testcase_group)
          |                        ^
  • testsuite/vhdl/grammar/src/dataset.cpp:24:22: warning: [misc-include-cleaner]

    no header providing "std::make_unique" is directly included

        6 |     set_builtin(std::make_unique<dataset::compile_builtin>());
          |                      ^
  • testsuite/vhdl/grammar/src/failure_diagnostic_fixture.cpp:14:22: warning: [misc-include-cleaner]

    no header providing "std::make_unique" is directly included

        6 | #include <testsuite/vhdl/grammar/failure_diagnostic_fixture.hpp>
        7 | 
        8 | namespace testsuite {
        9 | 
       10 | void failure_diagnostic_fixture::setup()
       11 | {
       12 |     set_name("vhdl/grammar/failure_diagnostic_fixture");
       13 | 
       14 |     set_builtin(std::make_unique<failure_diagnostic_fixture::compile_builtin>());
          |                      ^
  • testsuite/vhdl/grammar/src/test/literal.cpp:19:6: warning: [misc-include-cleaner]

    no header providing "std::string_view" is directly included

        6 | #include <testsuite/vhdl/grammar/testsuite_parse.hpp>
        7 | #include <testsuite/namespace_alias.hpp>  // IWYU pragma: keep
        8 | 
        9 | #include <ibis/vhdl/ast/basic_ast_walker.hpp>
       10 | 
       11 | #include <boost/test/unit_test.hpp>  // IWYU pragma: keep
       12 | 
       13 | #include <fmt/format.h>
       14 | 
       15 | #include <iostream>
       16 | 
       17 | namespace data {
       18 | 
       19 | std::string_view const input = R"(
          |      ^
  • testsuite/vhdl/grammar/src/test/literal.cpp:60:29: warning: [misc-include-cleaner]

    no header providing "ibis::vhdl::ast::bit_string_literal" is directly included

       16 | using base_specifier = ast::bit_string_literal::base_specifier;
          |                             ^
    /home/runner/work/compiler/compiler/testsuite/vhdl/grammar/src/test/literal.cpp:63:1: warning: do not declare C-style arrays, use std::array<> instead [cppcoreguidelines-avoid-c-arrays,modernize-avoid-c-arrays]
       63 | struct {
          | ^
  • testsuite/vhdl/grammar/src/test/literal.cpp:68:35: warning: [misc-include-cleaner]

    no header providing "std::operator""sv" is directly included

       68 |     { base_specifier::hex, "01234"sv },
          |                                   ^
  • testsuite/vhdl/grammar/src/test/literal.cpp:98:26: warning: [misc-include-cleaner]

    no header providing "ibis::vhdl::ast::constant_declaration" is directly included

       16 |     void operator()(ast::constant_declaration const& node, [[maybe_unused]] std::string_view) const
          |                          ^
  • testsuite/vhdl/grammar/src/test/literal.cpp:98:93: warning: [readability-named-parameter]

    all parameters should be named in a function

       98 |     void operator()(ast::constant_declaration const& node, [[maybe_unused]] std::string_view) const
          |                                                                                             ^
          |                                                                                              /*unused*/
  • testsuite/vhdl/grammar/src/test/literal.cpp:101:25: warning: [misc-include-cleaner]

    no header providing "ibis::vhdl::ast::printer" is directly included

       16 |             static ast::printer print(os);
          |                         ^
  • testsuite/vhdl/grammar/src/test/literal.cpp:108:91: warning: [readability-named-parameter]

    all parameters should be named in a function

      108 |     void operator()(ast::bit_string_literal const& node, [[maybe_unused]] std::string_view) const
          |                                                                                           ^
          |                                                                                            /*unused*/
  • testsuite/vhdl/grammar/src/test/literal.cpp:110:9: warning: [misc-include-cleaner]

    no header providing "assert" is directly included

        6 |         assert(test_index < expected_size && "test_index reached count of expected array size!");
          |         ^
  • testsuite/vhdl/grammar/src/test/literal.cpp:112:9: warning: [cppcoreguidelines-avoid-do-while]

    avoid do-while loops

      112 |         BOOST_TEST(node.base_type == expected[test_index].base_type);
          |         ^
    /home/runner/.conan2/p/b/boost2ffced804fbe0/p/include/boost/test/tools/interface.hpp:156:8: note: expanded from macro 'BOOST_TEST'
      156 |     2, BOOST_TEST_TOOL_UNIV, BOOST_TEST_TOOL_UNIV_EX, CHECK, __VA_ARGS__ )  \
          |        ^
  • testsuite/vhdl/grammar/src/test/literal.cpp:112:9: warning: [misc-include-cleaner]

    no header providing "BOOST_TEST" is directly included

       16 |         BOOST_TEST(node.base_type == expected[test_index].base_type);
          |         ^
  • testsuite/vhdl/grammar/src/test/literal.cpp:113:9: warning: [cppcoreguidelines-avoid-do-while]

    avoid do-while loops

      113 |         BOOST_TEST(node.literal == expected[test_index].literal);
          |         ^
    /home/runner/.conan2/p/b/boost2ffced804fbe0/p/include/boost/test/tools/interface.hpp:156:8: note: expanded from macro 'BOOST_TEST'
      156 |     2, BOOST_TEST_TOOL_UNIV, BOOST_TEST_TOOL_UNIV_EX, CHECK, __VA_ARGS__ )  \
          |        ^
  • testsuite/vhdl/grammar/src/test/literal.cpp:118:50: warning: [readability-named-parameter]

    all parameters should be named in a function

      118 |     void operator()([[maybe_unused]] NodeT const&, [[maybe_unused]] std::string_view) const
          |                                                  ^                                  
          |                                                   /*unused*/                         /*unused*/
  • testsuite/vhdl/grammar/src/test/literal.cpp:122:22: warning: [cppcoreguidelines-avoid-const-or-ref-data-members]

    member 'expected' of type 'const ExpectedT &' is a reference

      122 |     ExpectedT const& expected;
          |                      ^
  • testsuite/vhdl/grammar/src/test/literal.cpp:122:22: warning: [cppcoreguidelines-avoid-const-or-ref-data-members]

    member 'expected' of type 'const data::(unnamed struct at /home/runner/work/compiler/compiler/testsuite/vhdl/grammar/src/test/literal.cpp:63:1) &[17]' is a reference

  • testsuite/vhdl/grammar/src/test/literal.cpp:122:22: warning: [misc-non-private-member-variables-in-classes]

    member variable 'expected' has public visibility

  • testsuite/vhdl/grammar/src/test/literal.cpp:123:10: warning: [misc-include-cleaner]

    no header providing "std::size_t" is directly included

        6 |     std::size_t const expected_size;
          |          ^
  • testsuite/vhdl/grammar/src/test/literal.cpp:123:23: warning: [cppcoreguidelines-avoid-const-or-ref-data-members]

    member 'expected_size' of type 'const std::size_t' (aka 'const unsigned long') is const qualified

      123 |     std::size_t const expected_size;
          |                       ^
  • testsuite/vhdl/grammar/src/test/literal.cpp:123:23: warning: [misc-non-private-member-variables-in-classes]

    member variable 'expected_size' has public visibility

  • testsuite/vhdl/grammar/src/test/literal.cpp:124:19: warning: [cppcoreguidelines-avoid-const-or-ref-data-members]

    member 'os' of type 'std::ostream &' (aka 'basic_ostream &') is a reference

      124 |     std::ostream& os;
          |                   ^
  • testsuite/vhdl/grammar/src/test/literal.cpp:124:19: warning: [misc-non-private-member-variables-in-classes]

    member variable 'os' has public visibility

  • testsuite/vhdl/grammar/src/test/literal.cpp:125:25: warning: [misc-non-private-member-variables-in-classes]

    member variable 'test_index' has public visibility

      125 |     std::size_t mutable test_index = 0;
          |                         ^
  • testsuite/vhdl/grammar/src/test/literal.cpp:139:1: warning: [misc-include-cleaner]

    no header providing "BOOST_AUTO_TEST_CASE" is directly included

       16 | BOOST_AUTO_TEST_CASE(bit_string_literal)
          | ^
  • testsuite/vhdl/grammar/src/test/literal.cpp:139:1: warning: [readability-identifier-length]

    variable name 't' is too short, expected at least 3 characters

    /home/runner/.conan2/p/b/boost2ffced804fbe0/p/include/boost/test/unit_test_suite.hpp:212:9: note: expanded from macro 'BOOST_AUTO_TEST_CASE'
      212 |         BOOST_AUTO_TEST_CASE_NO_DECOR,                                  \
          |         ^
  • testsuite/vhdl/grammar/src/test/literal.cpp:142:22: warning: [misc-include-cleaner]

    no header providing "ibis::vhdl::ast::design_file" is directly included

       16 |     using vhdl::ast::design_file;
          |                      ^
  • testsuite/vhdl/grammar/src/test/literal.cpp:145:21: error: [clang-diagnostic-error]

    no matching constructor for initialization of 'testsuite_parse'

      145 |     testsuite_parse parse("bit_string_literal");
          |                     ^     ~~~~~~~~~~~~~~~~~~~~
    /home/runner/work/compiler/compiler/testsuite/vhdl/grammar/include/testsuite/vhdl/grammar/testsuite_parse.hpp:24:7: note: candidate constructor (the implicit copy constructor) not viable: no known conversion from 'const char[19]' to 'const testsuite_parse' for 1st argument
       24 | class testsuite_parse {
          |       ^~~~~~~~~~~~~~~
    /home/runner/work/compiler/compiler/testsuite/vhdl/grammar/include/testsuite/vhdl/grammar/testsuite_parse.hpp:24:7: note: candidate constructor (the implicit move constructor) not viable: no known conversion from 'const char[19]' to 'testsuite_parse' for 1st argument
       24 | class testsuite_parse {
          |       ^~~~~~~~~~~~~~~
    /home/runner/work/compiler/compiler/testsuite/vhdl/grammar/include/testsuite/vhdl/grammar/testsuite_parse.hpp:24:7: note: candidate constructor (the implicit default constructor) not viable: requires 0 arguments, but 1 was provided
  • testsuite/vhdl/grammar/src/test/literal.cpp:149:5: warning: [cppcoreguidelines-avoid-do-while]

    avoid do-while loops

      149 |     BOOST_TEST(parse(input, ast) == true);
          |     ^
    /home/runner/.conan2/p/b/boost2ffced804fbe0/p/include/boost/test/tools/interface.hpp:156:8: note: expanded from macro 'BOOST_TEST'
      156 |     2, BOOST_TEST_TOOL_UNIV, BOOST_TEST_TOOL_UNIV_EX, CHECK, __VA_ARGS__ )  \
          |        ^
  • testsuite/vhdl/grammar/src/test/literal.cpp:155:5: warning: [cppcoreguidelines-avoid-do-while]

    avoid do-while loops

      155 |     BOOST_TEST(parse.output() == expected_failure, btt::per_element());
          |     ^
    /home/runner/.conan2/p/b/boost2ffced804fbe0/p/include/boost/test/tools/interface.hpp:156:30: note: expanded from macro 'BOOST_TEST'
      156 |     2, BOOST_TEST_TOOL_UNIV, BOOST_TEST_TOOL_UNIV_EX, CHECK, __VA_ARGS__ )  \
          |                              ^
  • testsuite/vhdl/grammar/src/test/simple.cpp:15:1: warning: [misc-include-cleaner]

    included header iostream is not used directly

       15 | #include <iostream>
          | ^~~~~~~~~~~~~~~~~~~
       16 | 
  • testsuite/vhdl/grammar/src/test/simple.cpp:17:36: warning: [misc-include-cleaner]

    no header providing "boost::unit_test::framework::current_test_case" is directly included

       16 | 
       17 | using boost::unit_test::framework::current_test_case;
          |                                    ^
  • testsuite/vhdl/grammar/src/test/simple.cpp:21:1: warning: [misc-include-cleaner]

    no header providing "BOOST_FIXTURE_TEST_SUITE" is directly included

       16 | 
       17 | using boost::unit_test::framework::current_test_case;
       18 | using testsuite::failure_diagnostic_fixture;
       19 | 
       20 | // NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables)
       21 | BOOST_FIXTURE_TEST_SUITE(grammar_rules_1, failure_diagnostic_fixture)
          | ^
  • testsuite/vhdl/grammar/src/test/simple.cpp:24:1: warning: [readability-identifier-length]

    variable name 't' is too short, expected at least 3 characters

       24 | BOOST_DATA_TEST_CASE(design_file_1,                                                   // --
          | ^
    /home/runner/.conan2/p/b/boost2ffced804fbe0/p/include/boost/test/data/test_case.hpp:326:22: note: expanded from macro 'BOOST_DATA_TEST_CASE'
      326 |                      BOOST_DATA_TEST_CASE_WITH_PARAMS) (                \
          |                      ^
  • testsuite/vhdl/grammar/src/test/simple.cpp:25:32: warning: [misc-include-cleaner]

    no header providing "boost::unit_test::data::make_delayed" is directly included

       16 | 
       17 | using boost::unit_test::framework::current_test_case;
       18 | using testsuite::failure_diagnostic_fixture;
       19 | 
       20 | // NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables)
       21 | BOOST_FIXTURE_TEST_SUITE(grammar_rules_1, failure_diagnostic_fixture)
       22 | 
       23 | // NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables)
       24 | BOOST_DATA_TEST_CASE(design_file_1,                                                   // --
       25 |                      utf_data::make_delayed<testsuite::dataset>("abstract_literal"),  // --
          |                                ^
  • testsuite/vhdl/grammar/src/test/simple.cpp:26:29: warning: [misc-unused-parameters]

    parameter 'expected' is unused

       26 |                      input, expected, test_case_name)
          |                             ^~~~~~~~
          |                              /*expected*/
    /home/runner/.conan2/p/b/boost2ffced804fbe0/p/include/boost/test/data/test_case.hpp:327:55: note: expanded from macro 'BOOST_DATA_TEST_CASE'
      327 |                         BOOST_AUTO_TEST_CASE_FIXTURE, __VA_ARGS__)      \
          |                                                       ^
    /home/runner/.conan2/p/b/boost2ffced804fbe0/p/include/boost/test/data/test_case.hpp:297:57: note: expanded from macro 'BOOST_DATA_TEST_CASE_WITH_PARAMS'
      297 |                                BOOST_PP_VARIADIC_TO_SEQ(__VA_ARGS__) )  \
          |                                                         ^
    /home/runner/.conan2/p/b/boost2ffced804fbe0/p/include/boost/preprocessor/variadic/to_seq.hpp:21:63: note: expanded from macro 'BOOST_PP_VARIADIC_TO_SEQ'
       21 | # define BOOST_PP_VARIADIC_TO_SEQ(...) BOOST_PP_TUPLE_TO_SEQ((__VA_ARGS__))
          |                                                               ^
    note: (skipping 28 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
    /home/runner/.conan2/p/b/boost2ffced804fbe0/p/include/boost/test/data/test_case.hpp:242:82: note: expanded from macro 'BOOST_DATA_TEST_CASE_PARAM'
      242 | #define BOOST_DATA_TEST_CASE_PARAM(r, _, i, param)  (BOOST_PP_CAT(Arg, i) const& param)
          |                                                                                  ^
    /home/runner/.conan2/p/b/boost2ffced804fbe0/p/include/boost/preprocessor/seq/enum.hpp:30:93: note: expanded from macro 'BOOST_PP_SEQ_ENUM'
       30 | #    define BOOST_PP_SEQ_ENUM(seq) BOOST_PP_CAT(BOOST_PP_SEQ_ENUM_, BOOST_PP_SEQ_SIZE(seq)) seq
          |                                                                                             ^
    /home/runner/.conan2/p/b/boost2ffced804fbe0/p/include/boost/preprocessor/seq/limits/enum_256.hpp:16:33: note: expanded from macro 'BOOST_PP_SEQ_ENUM_2'
       16 | # define BOOST_PP_SEQ_ENUM_2(x) x, BOOST_PP_SEQ_ENUM_1
          |                                 ^
  • testsuite/vhdl/grammar/src/test/simple.cpp:26:39: warning: [misc-unused-parameters]

    parameter 'test_case_name' is unused

       26 |                      input, expected, test_case_name)
          |                                       ^~~~~~~~~~~~~~
          |                                        /*test_case_name*/
    /home/runner/.conan2/p/b/boost2ffced804fbe0/p/include/boost/test/data/test_case.hpp:327:55: note: expanded from macro 'BOOST_DATA_TEST_CASE'
      327 |                         BOOST_AUTO_TEST_CASE_FIXTURE, __VA_ARGS__)      \
          |                                                       ^
    /home/runner/.conan2/p/b/boost2ffced804fbe0/p/include/boost/test/data/test_case.hpp:297:57: note: expanded from macro 'BOOST_DATA_TEST_CASE_WITH_PARAMS'
      297 |                                BOOST_PP_VARIADIC_TO_SEQ(__VA_ARGS__) )  \
          |                                                         ^
    /home/runner/.conan2/p/b/boost2ffced804fbe0/p/include/boost/preprocessor/variadic/to_seq.hpp:21:63: note: expanded from macro 'BOOST_PP_VARIADIC_TO_SEQ'
       21 | # define BOOST_PP_VARIADIC_TO_SEQ(...) BOOST_PP_TUPLE_TO_SEQ((__VA_ARGS__))
          |                                                               ^
    note: (skipping 35 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
    /home/runner/.conan2/p/b/boost2ffced804fbe0/p/include/boost/test/data/test_case.hpp:242:82: note: expanded from macro 'BOOST_DATA_TEST_CASE_PARAM'
      242 | #define BOOST_DATA_TEST_CASE_PARAM(r, _, i, param)  (BOOST_PP_CAT(Arg, i) const& param)
          |                                                                                  ^
    /home/runner/.conan2/p/b/boost2ffced804fbe0/p/include/boost/preprocessor/seq/enum.hpp:30:93: note: expanded from macro 'BOOST_PP_SEQ_ENUM'
       30 | #    define BOOST_PP_SEQ_ENUM(seq) BOOST_PP_CAT(BOOST_PP_SEQ_ENUM_, BOOST_PP_SEQ_SIZE(seq)) seq
          |                                                                                             ^
    /home/runner/.conan2/p/b/boost2ffced804fbe0/p/include/boost/preprocessor/seq/limits/enum_256.hpp:15:33: note: expanded from macro 'BOOST_PP_SEQ_ENUM_1'
       15 | # define BOOST_PP_SEQ_ENUM_1(x) x
          |                                 ^
  • testsuite/vhdl/grammar/src/test/simple.cpp:29:22: warning: [misc-include-cleaner]

    no header providing "ibis::vhdl::ast::design_file" is directly included

       16 | 
       17 | using boost::unit_test::framework::current_test_case;
       18 | using testsuite::failure_diagnostic_fixture;
       19 | 
       20 | // NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables)
       21 | BOOST_FIXTURE_TEST_SUITE(grammar_rules_1, failure_diagnostic_fixture)
       22 | 
       23 | // NOLINTNEXTLINE(cppcoreguidelines-avoid-non-const-global-variables)
       24 | BOOST_DATA_TEST_CASE(design_file_1,                                                   // --
       25 |                      utf_data::make_delayed<testsuite::dataset>("abstract_literal"),  // --
       26 |                      input, expected, test_case_name)
       27 | {
       28 |     using testsuite::testsuite_parse;
       29 |     using vhdl::ast::design_file;
          |                      ^
  • testsuite/vhdl/grammar/src/test/simple.cpp:31:5: warning: [misc-const-correctness]

    variable 'ast' of type 'ast::design_file' (aka 'vectorast::design_unit') can be declared 'const'

       31 |     ast::design_file ast;
          |     ^
          |                      const 
  • testsuite/vhdl/grammar/src/test/simple.cpp:32:21: error: [clang-diagnostic-error]

    no matching constructor for initialization of 'testsuite_parse'

       32 |     testsuite_parse parse(current_test_case().p_name.get());
          |                     ^     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    /home/runner/work/compiler/compiler/testsuite/vhdl/grammar/include/testsuite/vhdl/grammar/testsuite_parse.hpp:24:7: note: candidate constructor (the implicit copy constructor) not viable: no known conversion from 'const std::basic_string<char>' to 'const testsuite_parse' for 1st argument
       24 | class testsuite_parse {
          |       ^~~~~~~~~~~~~~~
    /home/runner/work/compiler/compiler/testsuite/vhdl/grammar/include/testsuite/vhdl/grammar/testsuite_parse.hpp:24:7: note: candidate constructor (the implicit move constructor) not viable: no known conversion from 'const std::basic_string<char>' to 'testsuite_parse' for 1st argument
       24 | class testsuite_parse {
          |       ^~~~~~~~~~~~~~~
    /home/runner/work/compiler/compiler/testsuite/vhdl/grammar/include/testsuite/vhdl/grammar/testsuite_parse.hpp:24:7: note: candidate constructor (the implicit default constructor) not viable: requires 0 arguments, but 1 was provided
  • testsuite/vhdl/grammar/src/test/simple.cpp:36:5: warning: [cppcoreguidelines-avoid-do-while]

    avoid do-while loops

       36 |     BOOST_TEST(parse_ok);
          |     ^
    /home/runner/.conan2/p/b/boost2ffced804fbe0/p/include/boost/test/tools/interface.hpp:156:8: note: expanded from macro 'BOOST_TEST'
      156 |     2, BOOST_TEST_TOOL_UNIV, BOOST_TEST_TOOL_UNIV_EX, CHECK, __VA_ARGS__ )  \
          |        ^
  • testsuite/vhdl/grammar/src/test/simple.cpp:36:5: warning: [misc-include-cleaner]

    no header providing "BOOST_TEST" is directly included

       16 |     BOOST_TEST(parse_ok);
          |     ^
  • testsuite/vhdl/grammar/src/test/simple.cpp:47:1: warning: [misc-include-cleaner]

    no header providing "BOOST_AUTO_TEST_SUITE_END" is directly included

       47 | BOOST_AUTO_TEST_SUITE_END()
          | ^
  • testsuite/vhdl/grammar/src/testsuite_parse.cpp:8:39: warning: [misc-include-cleaner]

    no header providing "std::string_view" is directly included

        4 | #include <testsuite/vhdl/grammar/testsuite_parse.hpp>
        5 | 
        6 | namespace testsuite {
        7 | 
        8 | bool testsuite_parse::operator()(std::string_view contents, vhdl::ast::design_file& design_file)
          |                                       ^
  • testsuite/vhdl/grammar/src/testsuite_parse.cpp:8:72: warning: [misc-include-cleaner]

    no header providing "ibis::vhdl::ast::design_file" is directly included

        5 | 
        6 | namespace testsuite {
        7 | 
        8 | bool testsuite_parse::operator()(std::string_view contents, vhdl::ast::design_file& design_file)
          |                                                                        ^
  • testsuite/vhdl/grammar/src/testsuite_parse.cpp:13:9: warning: [misc-const-correctness]

    variable 'position_cache' of type 'parser::position_cacheparser::iterator_type' (aka 'position_cache<const char *>') can be declared 'const'

       13 |         parser::position_cache<parser::iterator_type> position_cache;
          |         ^
          |                                                       const 
  • testsuite/vhdl/grammar/src/testsuite_parse.cpp:13:17: warning: [misc-include-cleaner]

    no header providing "ibis::vhdl::parser::position_cache" is directly included

        5 | 
        6 | namespace testsuite {
        7 | 
        8 | bool testsuite_parse::operator()(std::string_view contents, vhdl::ast::design_file& design_file)
        9 | {
       10 |     bool parse_ok = false;
       11 | 
       12 |     try {
       13 |         parser::position_cache<parser::iterator_type> position_cache;
          |                 ^
  • testsuite/vhdl/grammar/src/testsuite_parse.cpp:13:40: warning: [misc-include-cleaner]

    no header providing "ibis::vhdl::parser::iterator_type" is directly included

        5 | 
        6 | namespace testsuite {
        7 | 
        8 | bool testsuite_parse::operator()(std::string_view contents, vhdl::ast::design_file& design_file)
        9 | {
       10 |     bool parse_ok = false;
       11 | 
       12 |     try {
       13 |         parser::position_cache<parser::iterator_type> position_cache;
          |                                        ^
  • testsuite/vhdl/grammar/src/testsuite_parse.cpp:14:9: warning: [misc-const-correctness]

    variable 'parse' of type 'parser::parse' can be declared 'const'

       14 |         parser::parse parse{ os };
          |         ^
          |                       const 
  • testsuite/vhdl/grammar/src/testsuite_parse.cpp:14:17: warning: [misc-include-cleaner]

    no header providing "ibis::vhdl::parser::parse" is directly included

        5 | 
        6 | namespace testsuite {
        7 | 
        8 | bool testsuite_parse::operator()(std::string_view contents, vhdl::ast::design_file& design_file)
        9 | {
       10 |     bool parse_ok = false;
       11 | 
       12 |     try {
       13 |         parser::position_cache<parser::iterator_type> position_cache;
       14 |         parser::parse parse{ os };
          |                 ^
  • testsuite/vhdl/grammar/src/testsuite_parse.cpp:15:9: warning: [misc-const-correctness]

    variable 'ctx' of type 'parser::context' (aka 'ibis::vhdl::context') can be declared 'const'

       15 |         parser::context ctx;
          |         ^
          |                         const 
  • testsuite/vhdl/grammar/src/testsuite_parse.cpp:15:17: warning: [misc-include-cleaner]

    no header providing "ibis::vhdl::parser::context" is directly included

        5 | 
        6 | namespace testsuite {
        7 | 
        8 | bool testsuite_parse::operator()(std::string_view contents, vhdl::ast::design_file& design_file)
        9 | {
       10 |     bool parse_ok = false;
       11 | 
       12 |     try {
       13 |         parser::position_cache<parser::iterator_type> position_cache;
       14 |         parser::parse parse{ os };
       15 |         parser::context ctx;
          |                 ^
  • testsuite/vhdl/grammar/src/testsuite_parse.cpp:21:27: warning: [misc-include-cleaner]

    no header providing "ibis::vhdl::failure_status" is directly included

        5 |         using ibis::vhdl::failure_status;
          |                           ^
  • testsuite/vhdl/grammar/src/testsuite_parse.cpp:25:17: warning: [misc-include-cleaner]

    no header providing "std::exception" is directly included

        4 |     catch (std::exception const& e) {
          |                 ^

Have any feedback or feature suggestions? Share it here.

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

There were too many comments to post at once. Showing the first 25 out of 38. Check the log or trigger a new build to see more.

#include <boost/test/data/monomorphic.hpp>

#include <string_view>

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: included header string_view is not used directly [misc-include-cleaner]

Suggested change


// C++
#include <filesystem>
#include <fstream>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: included header filesystem is not used directly [misc-include-cleaner]

Suggested change
#include <fstream>
#include <fstream>

// C++
#include <filesystem>
#include <fstream>
#include <iterator>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: included header fstream is not used directly [misc-include-cleaner]

Suggested change
#include <iterator>
#include <iterator>

#include <filesystem>
#include <fstream>
#include <iterator>
#include <optional>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: included header iterator is not used directly [misc-include-cleaner]

Suggested change
#include <optional>
#include <optional>

#include <fstream>
#include <iterator>
#include <optional>
#include <regex>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: included header optional is not used directly [misc-include-cleaner]

Suggested change
#include <regex>
#include <regex>

using base_specifier = ast::bit_string_literal::base_specifier;
using namespace std::literals::string_view_literals;

struct {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: do not declare C-style arrays, use std::array<> instead [cppcoreguidelines-avoid-c-arrays]

struct {
^

{
}

void operator()(ast::constant_declaration const& node, [[maybe_unused]] std::string_view) const
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: all parameters should be named in a function [readability-named-parameter]

Suggested change
void operator()(ast::constant_declaration const& node, [[maybe_unused]] std::string_view) const
void operator()(ast::constant_declaration const& node, [[maybe_unused]] std::string_view /*unused*/) const

}
}

void operator()(ast::bit_string_literal const& node, [[maybe_unused]] std::string_view) const
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: all parameters should be named in a function [readability-named-parameter]

Suggested change
void operator()(ast::bit_string_literal const& node, [[maybe_unused]] std::string_view) const
void operator()(ast::bit_string_literal const& node, [[maybe_unused]] std::string_view /*unused*/) const


void operator()(ast::bit_string_literal const& node, [[maybe_unused]] std::string_view) const
{
assert(test_index < expected_size && "test_index reached count of expected array size!");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: implicit conversion 'const char *' -> 'bool' [readability-implicit-bool-conversion]

Suggested change
assert(test_index < expected_size && "test_index reached count of expected array size!");
assert(test_index < expected_size && true);

}

template <typename NodeT>
void operator()([[maybe_unused]] NodeT const&, [[maybe_unused]] std::string_view) const
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: all parameters should be named in a function [readability-named-parameter]

Suggested change
void operator()([[maybe_unused]] NodeT const&, [[maybe_unused]] std::string_view) const
void operator()([[maybe_unused]] NodeT const& /*unused*/, [[maybe_unused]] std::string_view /*unused*/) const

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

clang-tidy made some suggestions

{
}

ExpectedT const& expected;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: member 'expected' of type 'const ExpectedT &' is a reference [cppcoreguidelines-avoid-const-or-ref-data-members]

    ExpectedT const& expected;
                     ^

{
}

ExpectedT const& expected;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: member variable 'expected' has public visibility [misc-non-private-member-variables-in-classes]

    ExpectedT const& expected;
                     ^

}

ExpectedT const& expected;
std::size_t const expected_size;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: member 'expected_size' of type 'const std::size_t' (aka 'const unsigned long') is const qualified [cppcoreguidelines-avoid-const-or-ref-data-members]

    std::size_t const expected_size;
                      ^

}

ExpectedT const& expected;
std::size_t const expected_size;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: member variable 'expected_size' has public visibility [misc-non-private-member-variables-in-classes]

    std::size_t const expected_size;
                      ^

}

ExpectedT const& expected;
std::size_t const expected_size;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: no header providing "std::size_t" is directly included [misc-include-cleaner]

testsuite/vhdl/grammar/src/test/literal.cpp:5:

- #include <testsuite/vhdl/grammar/testsuite_parse.hpp>
+ #include <cstddef>
+ #include <testsuite/vhdl/grammar/testsuite_parse.hpp>


} // namespace data

BOOST_AUTO_TEST_CASE(bit_string_literal)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: variable 'bit_string_literal' is non-const and globally accessible, consider making it const [cppcoreguidelines-avoid-non-const-global-variables]

BOOST_AUTO_TEST_CASE(bit_string_literal)
                     ^

// SPDX-License-Identifier: GPL-3.0-or-later
//

#include <testsuite/vhdl/grammar/testsuite_parse.hpp>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: 'testsuite/vhdl/grammar/testsuite_parse.hpp' file not found [clang-diagnostic-error]

#include <testsuite/vhdl/grammar/testsuite_parse.hpp>
         ^

#include <boost/test/data/test_case.hpp>

#include <iostream>

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: included header iostream is not used directly [misc-include-cleaner]

Suggested change

// NOLINTNEXTLINE(cppcoreguidelines-macro-usage)
#define BOOST_TEST_MODULE VHDL Grammar Test Suite

#include <boost/test/unit_test.hpp> // IWYU pragma: keep
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: 'boost/test/unit_test.hpp' file not found [clang-diagnostic-error]

#include <boost/test/unit_test.hpp>  // IWYU pragma: keep
         ^

// Copyright (c) 2017-2022 Olaf (<[email protected]>).
// SPDX-License-Identifier: GPL-3.0-or-later

#include <testsuite/vhdl/grammar/testsuite_parse.hpp>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

warning: 'testsuite/vhdl/grammar/testsuite_parse.hpp' file not found [clang-diagnostic-error]

#include <testsuite/vhdl/grammar/testsuite_parse.hpp>
         ^

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant