]> gcc.gnu.org Git - gcc.git/commit
cgraph: flatten and same_body aliases [PR96078]
authorJason Merrill <jason@redhat.com>
Fri, 12 Feb 2021 03:01:19 +0000 (22:01 -0500)
committerJason Merrill <jason@redhat.com>
Thu, 4 Mar 2021 01:28:43 +0000 (20:28 -0500)
commitd455130553544ee838b5215e76ccad22304cde39
tree04379e8a9badc82fc80191307e5df67fa1689f16
parentbf49d83570ddb4df7893c3d605f7fc89db13792d
cgraph: flatten and same_body aliases [PR96078]

The patch for PR92372 made us start warning about a flatten attribute on an
alias.  But in the case of C++ 'tor base/complete variants, the user didn't
create the alias.  If the alias target also has the attribute, the alias
points to a flattened function, so we shouldn't warn.

gcc/ChangeLog:

PR c++/96078
* cgraphunit.c (process_function_and_variable_attributes): Don't
warn about flatten on an alias if the target also has it.
* cgraph.h (symtab_node::get_alias_target_tree): New.

gcc/testsuite/ChangeLog:

PR c++/96078
* g++.dg/ext/attr-flatten1.C: New test.
gcc/cgraph.h
gcc/cgraphunit.c
gcc/testsuite/g++.dg/ext/attr-flatten1.C [new file with mode: 0644]
This page took 0.059212 seconds and 5 git commands to generate.