On Tue, Dec 23, 2025 at 11:01:36AM +0530, Dhruv Chawla wrote:
> Committed as:
> - r16-6347-g84058c3cc805f7

This broke building gcc with C++14 system compilers.
../../gcc/auto-profile.cc: In member function ‘std::pair<const char*, int> 
autofdo::string_table::get_original_name(const char*) const’:
../../gcc/auto-profile.cc:1129:7: warning: init-statement in selection 
statements only available with ‘-std=c++17’ or ‘-std=gnu++17’ 
[-Wc++17-extensions]
 1129 |   if (symtab_node *n
      |       ^~~~~~~~~~~
This is valid only in C++17 and later.

Fixed thusly, committed to trunk as obvious.

2025-12-29  Jakub Jelinek  <[email protected]>

        * auto-profile.cc (string_table::get_original_name): Avoid using
        init-statement in selection statement.

--- gcc/auto-profile.cc.jj      2025-12-29 13:58:20.210597143 +0100
+++ gcc/auto-profile.cc 2025-12-29 13:55:32.638401205 +0100
@@ -1126,9 +1126,9 @@ string_table::get_original_name (const c
 
   /* Try to find a function from the current TU.  */
   gcc_checking_assert (clash->second.length () >= 1);
-  if (symtab_node *n
-      = cgraph_node::get_for_asmname (get_identifier (stripped->second));
-      n && is_a<cgraph_node *> (n))
+  symtab_node *n
+    = cgraph_node::get_for_asmname (get_identifier (stripped->second));
+  if (n && is_a<cgraph_node *> (n))
     for (cgraph_node *cn = dyn_cast<cgraph_node *> (n); cn;)
       {
        /* Check if there is a symbol in the current TU that has the same name


        Jakub

Reply via email to