diff --git a/src/abg-ir.cc b/src/abg-ir.cc index 4bf17fe2..4a1ecc9f 100644 --- a/src/abg-ir.cc +++ b/src/abg-ir.cc @@ -2141,15 +2141,26 @@ function_decl::get_pretty_representation() const dynamic_cast(this); string result = mem_fn ? "method ": "function "; - decl_base_sptr type = dynamic_pointer_cast(get_return_type()); + decl_base_sptr type = + mem_fn + ? get_type_declaration(mem_fn->get_type()->get_return_type()) + : get_type_declaration(get_type()->get_return_type()); if (type) result += type->get_qualified_name() + " "; + else if (!(mem_fn && (mem_fn->is_destructor() || mem_fn->is_constructor()))) + result += "void "; if (mem_fn && mem_fn->is_destructor()) result += "~"; - result += get_qualified_name() + "("; + if (mem_fn) + result += mem_fn->get_type()->get_class_type()->get_qualified_name() + + "::" + mem_fn->get_name(); + else + result += get_qualified_name(); + + result += "("; parameters::const_iterator i = get_parameters().begin(), end = get_parameters().end(); diff --git a/tests/data/test-bidiff/test-enum0-report.txt b/tests/data/test-bidiff/test-enum0-report.txt index aa33379f..74ee2059 100644 --- a/tests/data/test-bidiff/test-enum0-report.txt +++ b/tests/data/test-bidiff/test-enum0-report.txt @@ -8,7 +8,7 @@ 1 changed declaration: 'function void foo(E)' was changed to 'function void foo(E)': - parameter 0 of type 'E' changed: + parameter 0 of type 'enum E' changed: 1 enumerator deletion: 'E::e2' value '1' diff --git a/tests/data/test-bidiff/test-enum1-report.txt b/tests/data/test-bidiff/test-enum1-report.txt index c0e7399c..3845f8a6 100644 --- a/tests/data/test-bidiff/test-enum1-report.txt +++ b/tests/data/test-bidiff/test-enum1-report.txt @@ -8,7 +8,7 @@ 1 changed declaration: 'function void foo(E)' was changed to 'function void foo(E)': - parameter 0 of type 'E' changed: + parameter 0 of type 'enum E' changed: 1 enumerator insertion: 'E::e1' value '1' diff --git a/tests/data/test-bidiff/test-qual-type0-report.txt b/tests/data/test-bidiff/test-qual-type0-report.txt index 780f8bca..d2b12b37 100644 --- a/tests/data/test-bidiff/test-qual-type0-report.txt +++ b/tests/data/test-bidiff/test-qual-type0-report.txt @@ -3,7 +3,7 @@ size changed from 32 to 64 bits 1 member type change: 'typedef S0::S0' changed: - underlying type class S0 changed; details are being reported + underlying type 'class S0' changed; details are being reported 1 data member insertion: 'char S0::m1', at offset 32 (in bits) diff --git a/tests/data/test-bidiff/test-struct0-report.txt b/tests/data/test-bidiff/test-struct0-report.txt index 559ef83a..40f819b3 100644 --- a/tests/data/test-bidiff/test-struct0-report.txt +++ b/tests/data/test-bidiff/test-struct0-report.txt @@ -3,10 +3,10 @@ size changed from 64 to 96 bits 1 member type change: 'typedef s0::s0' changed: - underlying type class s0 changed; details are being reported + underlying type 'class s0' changed; details are being reported 1 data member change: - 'char s0::m1' type changed: + type of 'char s0::m1' changed: name changed from 'char' to 'unsigned int' size changed from 8 to 32 bits alignment changed from 8 to 32 bits diff --git a/tests/data/test-bidiff/test-struct1-report.txt b/tests/data/test-bidiff/test-struct1-report.txt index 2134f1b1..2176824a 100644 --- a/tests/data/test-bidiff/test-struct1-report.txt +++ b/tests/data/test-bidiff/test-struct1-report.txt @@ -4,9 +4,9 @@ size changed from 192 to 256 bits 2 member type changes: 'typedef s0::s0' changed: - underlying type class s0 changed; details are being reported + underlying type 'class s0' changed; details are being reported 'typedef s0::number_type' changed: - underlying type changed: + underlying type 'int' changed: name changed from 'int' to 'char' size changed from 32 to 8 bits alignment changed from 32 to 8 bits @@ -18,8 +18,8 @@ 'char s0::m1', at offset 96 (in bits) 2 data member changes: - 's0::m2' offset changed from 128 to 192 - 'int s0::m0' type changed: + 'unsigned int s0::m2' offset changed from 128 to 192 + type of 'int s0::m0' changed: name changed from 'int' to 'char' size changed from 32 to 8 bits alignment changed from 32 to 8 bits