Internal pretty repr of union cannot be flat representation
authorDodji Seketeli <dodji@redhat.com>
Mon, 8 Apr 2019 09:17:09 +0000 (11:17 +0200)
committerDodji Seketeli <dodji@redhat.com>
Mon, 8 Apr 2019 09:24:25 +0000 (11:24 +0200)
This is the first patch of this series:

    Internal pretty repr of union cannot be flat representation
    Fix anonymous union constructed under the wrong context
    Propagate private type diff category through refs/qualified type diffs

The intent of this series is to fix the bug:

    https://sourceware.org/bugzilla/show_bug.cgi?id=24410
    "Empty change report emitted for libpoppler-qt5.so.1.18.0"

The internal pretty representation of a union must be its fully
qualified name, even when it's a anonymous union.  It cannot be its
flat representation as for anonymous unions, that would lead to
confusion between anonymous unions that have the same flat
representation but are in different scopes.

Fixed thus.

Note that regression tests are all updated in the last patch of the
series

      * src/abg-ir.cc (union_decl::get_pretty_representation):
        Anonymous internal pretty representation of unin is its fully
        qualified name.

Signed-off-by: Dodji Seketeli <dodji@redhat.com>
src/abg-ir.cc

index 54459a334d5ecc7d448b123abff728f341494b0d..96adc58482a136e0a8a959f8116d09464b25f3d7 100644 (file)
@@ -19718,7 +19718,7 @@ string
 union_decl::get_pretty_representation(bool internal) const
 {
   string repr;
-  if (get_is_anonymous())
+  if (get_is_anonymous() && !internal)
     repr = get_class_or_union_flat_representation(this, "",
                                                  /*one_line=*/true);
   else