libabigail/tests
Dodji Seketeli a03d9c0e64 Avoid missing member types while reading bi files
* include/abg-fwd.h (get_type_declaration): Declare function.
	* include/abg-ir.h (class decl_base): Add class_decl as a friend.
	This to be able to call decl_base::set_scope from class_decl.
	(scope_decl::add_member_decl): Make this virtual protected, so
	that it can be called (virtually) from e.g, class_decl.
	(type_decl_sptr, typedef_decl_sptr): New convenience typedefs.
	(class_decl::add_member_decl): New virtual overload for
	scope_decl::add_member_decl.
	(class_decl::{add_member_type, add_data_member,
	add_member_function}): New overloads.
	* src/abg-ir.cc (add_decl_to_scope): Benign style cleanup.
	(get_type_declaration): Define new function.
	(class_decl::add_member_decl): New method.
	(class_decl::add_member_type): Avoid silently added a new member
	type when that member type has already been (perhaps
	inadvertently) added to a scope already.  Rather, put a strict
	assert in place there.  Also add a new overload that constructs
	the member type out of a classic type and adds it to the class.
	(class_decl::{add_data_member, add_member_function}): Likewise.
	(class_decl::{add_member_function_template,
	add_member_class_template}): Avoid silently added a new member
	template when that template has already been (perhaps
	inadvertently) added to a scope already.  Rather, put a strict
	assert in place there.
	* src/abg-reader.cc (push_decl_to_current_scope): Take a an extra
	flag saying if the current decl should be added to the current
	scope as well (in addition to being pushed onto the stack of
	scopes maintained in the reader context).
	(push_and_key_type_decl): Likewise, take that extra flag and pass
	it to push_decl_to_current_scope.
	(build_function_decl, build_var_decl, build_type_decl)
	(build_qualified_type_decl, build_pointer_type_def)
	(build_reference_type_def, build_enum_type_decl, build_typedef_decl)
	(build_function_tdecl, build_class_tdecl): Likewise.
	(build_class_decl): Likewise.  When building member data, types,
	and functions, make sure /not/ to add the data, type of function to
	the current scope before adding it to the class_decl.  This was
	making the member not being added to the class because it already
	had a scope.
	(build_type_tparameter, build_type_composition)
	(build_non_type_tparameter, build_template_tparameter)
	(build_type): Adjust to add the template parm to the current scope
	explicitly, like previously.
	(handle_type_decl): Use build_type_decl function. Add the
	type_decl to the current scope, like previously.
	(handle_namespace_decl, handle_qualified_type_decl)
	(handle_pointer_type_def, handle_reference_type_def)
	(handle_enum_type_decl, handle_typedef_decl, handle_var_decl)
	(handle_function_decl, handle_class_decl, handle_function_tdecl)
	(handle_class_tdecl): Adjust to add the decl to the current scope,
	like previously.
	* tests/data/test-read-write/test21.xml: New test input with
	member type(def).

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
2013-11-19 11:27:49 +01:00
..
data Avoid missing member types while reading bi files 2013-11-19 11:27:49 +01:00
Makefile.am Initial regression test facility for core diff algorithms 2013-11-19 11:20:03 +01:00
test-core-diff.cc Re-write middle snakes management in core diff algorithms 2013-11-19 11:25:47 +01:00
test-diff2.cc Re-write middle snakes management in core diff algorithms 2013-11-19 11:25:47 +01:00
test-dot.cc Correct DOT merge. 2013-07-23 23:13:55 +02:00
test-read-write.cc Avoid missing member types while reading bi files 2013-11-19 11:27:49 +01:00
test-svg.cc Add svg generation. 2013-07-23 23:13:54 +02:00
test-utils.cc Initial version of an archive manipulation program: biar 2013-08-29 17:08:47 +02:00
test-utils.h Initial version of an archive manipulation program: biar 2013-08-29 17:08:47 +02:00
test-walker.cc Simplify interface for serializing/deserializing translation_units. 2013-08-14 15:07:18 +02:00
test-write-read-archive.cc Initial version of an archive manipulation program: biar 2013-08-29 17:08:47 +02:00