Hi David, your commit breaks compilation with GCC < 6, here with GCC 5.2:
gcc/analyzer/access-diagram.cc: In member function 'void ana::boundaries::add(const ana::access_range&, ana::boundaries::kind)': gcc/analyzer/access-diagram.cc:655:20: error: 'kind' is not a class, namespace, or enumeration (kind == kind::HARD) ? "HARD" : "soft"); ^ The problem is ... On 09.10.23 00:58, David Malcolm wrote:
Update out-of-bounds diagrams to show existing string values, diff --git a/gcc/analyzer/access-diagram.cc b/gcc/analyzer/access-diagram.cc index a51d594b5b2..2197ec63f53 100644 --- a/gcc/analyzer/access-diagram.cc +++ b/gcc/analyzer/access-diagram.cc @@ -630,8 +630,8 @@ class boundaries public: enum class kind { HARD, SOFT};
...
@@ -646,6 +646,15 @@ public:
Just above the following diff is the line: void add (const access_range &range, enum kind kind)
{ add (range.m_start, kind); add (range.m_next, kind); + if (m_logger) + { + m_logger->start_log_line (); + m_logger->log_partial ("added access_range: "); + range.dump_to_pp (m_logger->get_printer (), true); + m_logger->log_partial (" (%s)", + (kind == kind::HARD) ? "HARD" : "soft"); + m_logger->end_log_line ();
Actual problem: Playing around also with the compiler explorer shows that GCC 5.2 or likewise 5.5 do not like the variable (PARAM_DECL) name "kind" combined with "kind::HARD". The following works: (A) Using "kind == boundaries::kind::HARD" - i.e. adding "boundaries::" (B) Renaming the parameter name "kind" to something else - like "k" as used in the other functions. Can you fix it? Thanks, Tobias ----------------- Siemens Electronic Design Automation GmbH; Anschrift: Arnulfstraße 201, 80634 München; Gesellschaft mit beschränkter Haftung; Geschäftsführer: Thomas Heurung, Frank Thürauf; Sitz der Gesellschaft: München; Registergericht München, HRB 106955