[applied] Fix compilation with Clang
Commit Message
Hello,
* include/abg-comparison.h (class type_diff_base): Remove private
default constructor. Rather, declare it as a deleted default
constructor.
(class ptr_to_mbr_diff): The default contructor is deleted, not
defaulted.
* src/abg-dwarf-reader.cc (get_die_qualified_name): Remove unused
function.
(die_enum_flat_representation): Add missing parenthesis around
"?:" expression coming after the << operator.
* src/abg-ir.cc (collect_non_anonymous_data_members): Fix unused
variable.
* src/abg-suppression.cc (is_negated_suppression): Fix expression
that might not be evaluated.
* src/abg-tools-utils.cc (ANONYMOUS_SUBRANGE_INTERNAL_NAME_LEN):
Remove useless static variable.
Signed-off-by: Dodji Seketeli <dodji@redhat.com>
Applied to the mainline.
---
include/abg-comparison.h | 6 +++---
src/abg-dwarf-reader.cc | 24 ++++--------------------
src/abg-ir.cc | 2 +-
src/abg-suppression.cc | 4 +++-
src/abg-tools-utils.cc | 3 ---
5 files changed, 11 insertions(+), 28 deletions(-)
@@ -1188,8 +1188,6 @@ class type_diff_base : public diff
struct priv;
std::unique_ptr<priv> priv_;
- type_diff_base();
-
protected:
type_diff_base(type_base_sptr first_subject,
type_base_sptr second_subject,
@@ -1197,6 +1195,8 @@ protected:
public:
+ type_diff_base() = delete;
+
virtual enum change_kind
has_local_changes() const = 0;
@@ -1454,7 +1454,7 @@ class ptr_to_mbr_diff : public type_diff_base
struct priv;
std::unique_ptr<priv> priv_;
- ptr_to_mbr_diff() = default;
+ ptr_to_mbr_diff() = delete;
protected:
ptr_to_mbr_diff(const ptr_to_mbr_type_sptr& first,
@@ -3287,25 +3287,6 @@ public:
return i->second;
}
- /// Get the qualified name of a given DIE.
- ///
- /// If the name of the DIE was already computed before just return
- /// that name from a cache. Otherwise, build the name, cache it and
- /// return it.
- ///
- /// @param die the DIE to consider.
- ///
- /// @param where_offset where in the DIE stream we logically are.
- ///
- /// @return the interned string representing the qualified name of
- /// @p die.
- interned_string
- get_die_qualified_name(Dwarf_Die *die, size_t where_offset) const
- {
- return const_cast<reader*>(this)->
- get_die_qualified_name(die, where_offset);
- }
-
/// Get the qualified name of a given DIE which is considered to be
/// the DIE for a type.
///
@@ -10994,7 +10975,10 @@ die_enum_flat_representation(const reader& rdr,
while (dwarf_siblingof(&child, &child) == 0);
}
- o << one_line ? string("}") : "\n" + indent;
+ o << (one_line
+ ? string("}")
+ : "\n" + indent);
+
o << "}";
return o.str();
@@ -5840,7 +5840,7 @@ collect_non_anonymous_data_members(const class_or_union* cou,
result = true;
}
}
- return true;
+ return result;
}
/// Collect all the non-anonymous data members of a class or union type.
@@ -312,7 +312,9 @@ is_negated_suppression(const suppression_base& s)
bool result = true;
try
{
- dynamic_cast<const negated_suppression_base&>(s);
+ if (const negated_suppression_base* s_prime =
+ &dynamic_cast<const negated_suppression_base&>(s))
+ return !!s_prime;
}
catch (...)
{
@@ -615,9 +615,6 @@ const char*
get_anonymous_union_internal_name_prefix()
{return ANONYMOUS_UNION_INTERNAL_NAME;}
-static int ANONYMOUS_SUBRANGE_INTERNAL_NAME_LEN =
- strlen(ANONYMOUS_SUBRANGE_INTERNAL_NAME);
-
/// Getter of the prefix for the name of anonymous enums.
///
/// @reaturn the prefix for the name of anonymous enums.