libabigail/include
Dodji Seketeli 0c820488d4 Bug 21296 - Reporting diff of const ref against non-const ref aborts
References are always const.  But then GCC sometimes emits DWARF that
represents a const reference.  This leads, for instance, to a given
reference to be considered as different from that same reference wraps
into a const qualifier.  Which is wrong.

Libabigail then represents those const references as a particular case
of a "no-op qualifier".  That is, a qualifier that should be ignored
by the comparison code.

In the case of this issue, the comparison engine considers the two
references (const and non-const) to be equal, but the reporting code
forgets to ignore the ignore no-op qualifier and thus (wrongly)
considers the two references as being different.  That inconsistency
leads to an abort of the process.

This patch moves the code that ignores no-op qualifiers at a lower
level of the comparison engine so that whenever function parameters
are compared, no-op qualifiers are ignored as they should.

	* include/abg-fwd.h (look_through_no_op_qualified_type): Declare
	new function.
	* src/abg-ir.cc (look_through_no_op_qualified_type): Define it.
	(compute_diff_for_types): Use the new
	look_through_no_op_qualified_type here rather than open-coding it.
	(equals): In the overload for function_decl::parameter, use the
	new look_through_no_op_qualified_type function.
	* tests/data/test-diff-dwarf/test40-PR21296-clanggcc.cc: Source
	code of the new test inputs.
	* tests/data/test-diff-dwarf/test40-PR21296-clanggcc-report0.txt:
	New test input.
	* tests/data/test-diff-dwarf/test40-PR21296-libgcc.so: New binary
	test input.
	* tests/data/test-diff-dwarf/test40-PR21296-libclang.so: Likewise.
	* tests/test-diff-dwarf.cc (in_out_specs): Add the new test inputs to
	the test harness.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2017-03-24 12:39:49 +01:00
..
abg-comp-filter.h Very light speed improvements 2016-11-29 17:08:19 +01:00
abg-comparison.h Fix suppression category propagation in diff node graph 2017-01-20 10:59:58 +01:00
abg-config.h Add --version option to several libabigail tools 2015-11-16 12:54:10 +01:00
abg-corpus.h Update copyright year on a bunch of files 2017-01-05 12:51:49 +01:00
abg-diff-utils.h Constify some diff-utils functor operators 2015-09-21 10:46:06 +02:00
abg-dwarf-reader.h Support Linux Kernel binaries 2017-01-06 12:35:22 +01:00
abg-fwd.h Bug 21296 - Reporting diff of const ref against non-const ref aborts 2017-03-24 12:39:49 +01:00
abg-hash.h Update copyright years 2015-01-07 17:52:10 +01:00
abg-ini.h Support empty properties in INI files 2016-11-10 14:09:51 +01:00
abg-interned-str.h Cleanup namespace importing in abg-interned-str.h 2016-10-10 12:57:47 +02:00
abg-ir.h Bug 21228 - Handle cloning union member functions 2017-03-07 11:50:56 +01:00
abg-libxml-utils.h Bug 20970 - Add a --annotate option to abidw 2017-01-24 15:41:37 +01:00
abg-libzip-utils.h Update copyright years 2015-01-07 17:52:10 +01:00
abg-reader.h Drop suppressed ABI artifacts from the IR 2016-09-21 18:35:08 +02:00
abg-sptr-utils.h Setup per-corpus type maps indexed by type names 2016-11-29 16:16:43 +01:00
abg-suppression.h Support Linux Kernel ABI whitelist files 2017-01-06 12:41:57 +01:00
abg-tools-utils.h Support Linux Kernel ABI whitelist files 2017-01-06 12:41:57 +01:00
abg-traverse.h Canonicalize types either early or late after TU reading 2015-02-18 21:32:37 +01:00
abg-version.h.in Add --version option to several libabigail tools 2015-11-16 12:54:10 +01:00
abg-viz-common.h Update copyright years 2015-01-07 17:52:10 +01:00
abg-viz-dot.h Update copyright years 2015-01-07 17:52:10 +01:00
abg-viz-svg.h Update copyright years 2015-01-07 17:52:10 +01:00
abg-workers.h Several fixes and enhancements to abigail::workers 2017-02-27 09:48:08 +01:00
abg-writer.h Bug 20970 - Add a --annotate option to abidw 2017-01-24 15:41:37 +01:00
Makefile.am Split suppression engine off of abg-comparison.{cc,h} 2016-05-08 12:29:57 +02:00