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.
2025-12-29 Jakub Jelinek <jakub@redhat.com>
* auto-profile.cc (string_table::get_original_name): Avoid using
init-statement in selection statement.
/* 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