Better handle decl-only classes being different from their definition
Sincea little while, libabigail can now handle the presence of several
different class types definition that have the same name.
To handle that, we settled that for types originating from C, a
decl-only class would be considered different from a definition of
that class. Especially during type canonicalization.
Now it seems that it's wrong to consider this only for C types. That
is because the same class type foo, defined in a C header, can be
compile either into a C++ compilation unit, or a C one, in the same
binary. That is, in the same binary, a struct type foo can be seen
defined in a C compilation unit *and* in a C++ compilation unit.
So rigth now, the C++ struct type foo would compare equal to a
decl-only struct foo, but the C struct type foo would compare
different to a decl-only struct foo. This leads to spurious change
reports, especiall in the nmap and mariadb package from Fedora 25,
when we run selfcheck.py on fc25 critpath packages.
This patch makes libabigail always consider -- during type
canonicalization -- that a decl-only class is different from a
definition of that class. Not only for C.
* src/abg-comparison.cc (function_decl_diff::report): Don't report
possible vtable changes between a decl-only class and its
definition.
* src/abg-ir.cc (type_base::get_canonical_type_for): Consider that
a decl-only class is different from its definition when comparing
types for the purpose of type canonicalization.
(equals): In the class_or_union overload, only consider the global
decl_only_class_equals_definition() property to know when to
consider that a decl-only class is different from its definition
when comparing two classes.
* src/abg-reader.cc (build_class_decl): Read the size property of
a class, even if it's a decl-only class.
* src/abg-writer.cc (write_class_decl_opening_tag): Write size
property of types even if the types are decl-only classes.
* tests/data/test-annotate/test13-pr18894.so.abi: Adjust.
* tests/data/test-annotate/test14-pr18893.so.abi: Likewise.
* tests/data/test-annotate/test15-pr18892.so.abi: Likewise.
* tests/data/test-annotate/test17-pr19027.so.abi: Likewise.
* tests/data/test-annotate/test18-pr19037-libvtkRenderingLIC-6.1.so.abi:
Likewise.
* tests/data/test-annotate/test19-pr19023-libtcmalloc_and_profiler.so.abi:
Likewise.
* tests/data/test-annotate/test20-pr19025-libvtkParallelCore-6.1.so.abi:
Likewise.
* tests/data/test-annotate/test21-pr19092.so.abi: Likewise.
* tests/data/test-diff-dwarf-abixml/test0-pr19026-libvtkIOSQL-6.1.so.1.abi:
Likewise.
* tests/data/test-diff-filter/test31-pr18535-libstdc++-report-0.txt:
Likewise.
* tests/data/test-diff-filter/test31-pr18535-libstdc++-report-1.txt:
Likewise.
* tests/data/test-read-dwarf/test12-pr18844.so.abi: Likewise.
* tests/data/test-read-dwarf/test13-pr18894.so.abi: Likewise.
* tests/data/test-read-dwarf/test14-pr18893.so.abi: Likewise.
* tests/data/test-read-dwarf/test15-pr18892.so.abi: Likewise.
* tests/data/test-read-dwarf/test17-pr19027.so.abi: Likewise.
* tests/data/test-read-dwarf/test18-pr19037-libvtkRenderingLIC-6.1.so.abi:
Likewise.
* tests/data/test-read-dwarf/test19-pr19023-libtcmalloc_and_profiler.so.abi:
Likewise.
* tests/data/test-read-dwarf/test20-pr19025-libvtkParallelCore-6.1.so.abi:
Likewise.
* tests/data/test-read-dwarf/test21-pr19092.so.abi: Likewise.
* tests/data/test-read-dwarf/test22-pr19097-libstdc++.so.6.0.17.so.abi:
Likewise.
* tests/data/test-read-dwarf/test9-pr18818-clang.so.abi: Likewise.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
26 files changed: