Bug 18535 - abidiff reports false positive ABI difference for libstdc++
When the DWARF reader of libabigail sees a data member for a given
class flagged as being a declaration, it considers the declaration as
being a definition. The reason why it doesn't strictly trust the
"is_declaration" flag of DWARF is that some DWARF producers sometimes
wrongly emit that flag.
But then, it turns out that a class declaration can have a *static*
data member without loosing its declaration-only property. This patch
thus changes the behaviour of the DWARF reader to make it consider the
class declaration as being a definition when the class has a
*non-static* data member; a static data member only is not enough to
make the class declaration become a definition.
* src/abg-dwarf-reader.cc (build_class_type_and_add_to_ir): The
presence of a data member shouldn't make a declaration-only class
loose its declaration-only-ness; the presence of a enon-static*
data member should.
* tests/data/test-read-dwarf/test15-pr18892.so.abi: Adjust.
* tests/data/test-read-dwarf/test16-pr18904.so.abi: Likewise.
* tests/data/test-diff-filter/test31-pr18535-libstdc++-4.8.3.so:
New binary test input.
* tests/data/test-diff-filter/test31-pr18535-libstdc++-4.9.2.so:
Likewise.
* tests/data/test-diff-filter/test31-pr18535-libstdc++-report-0.txt:
New test reference output.
* tests/data/Makefile.am: Add the new test material to the build
system.
* tests/test-diff-filter.cc (in_out_specs): Add the new test
inputs to the set of inputs to consider.