* [PATCH] abg-reporter: fully qualify std::string and std::ostream
@ 2020-05-29 20:17 Matthias Maennich
2020-06-11 14:51 ` Dodji Seketeli
0 siblings, 1 reply; 2+ messages in thread
From: Matthias Maennich @ 2020-05-29 20:17 UTC (permalink / raw)
To: libabigail; +Cc: dodji, gprocida, kernel-team, maennich, Mark Barolak
In order to not unnecessarily pollute the abigail namespace and to avoid
ambiguity at compile time, fully qualify std::string and std::string.
This also resolves the issue that include/abg-reporter.h could not be
compiled standalone and therefore was broken as a public header. It
required a `using std::string` from a prior include.
* include/abg-reporter.h (reporter_base::report) fully qualify
std::string and std::ostream for all overloads.
(default_reporter::report_local_typedef_changes): Likewise.
(default_reporter::report_local_qualified_type_changes): Likewise.
(default_reporter::report_local_reference_type_changes): Likewise.
(default_reporter::report_local_function_type_changes): Likewise.
(default_reporter::report): Likewise.
(leaf_reporter::report_changes_from_diff_maps): Likewise.
(leaf_reporter::report): Likewise.
Suggested-by: Mark Barolak <mbar@google.com>
Signed-off-by: Matthias Maennich <maennich@google.com>
---
include/abg-reporter.h | 223 ++++++++++++++++++++++-------------------
1 file changed, 118 insertions(+), 105 deletions(-)
diff --git a/include/abg-reporter.h b/include/abg-reporter.h
index 6254be6a49f5..e0d9e66a69a8 100644
--- a/include/abg-reporter.h
+++ b/include/abg-reporter.h
@@ -35,7 +35,6 @@
namespace abigail
{
-using std::ostream;
using abg_compat::shared_ptr;
namespace comparison
@@ -75,79 +74,80 @@ public:
virtual bool diff_to_be_reported(const diff *d) const;
virtual void
- report(const type_decl_diff& d, ostream& out,
- const string& indent = "") const = 0;
+ report(const type_decl_diff& d, std::ostream& out,
+ const std::string& indent = "") const = 0;
virtual void
- report(const enum_diff& d, ostream& out,
- const string& indent = "") const = 0;
+ report(const enum_diff& d, std::ostream& out,
+ const std::string& indent = "") const = 0;
virtual void
- report(const typedef_diff& d, ostream& out,
- const string& indent = "") const = 0;
+ report(const typedef_diff& d, std::ostream& out,
+ const std::string& indent = "") const = 0;
virtual void
- report(const qualified_type_diff& d, ostream& out,
- const string& indent = "") const = 0;
+ report(const qualified_type_diff& d, std::ostream& out,
+ const std::string& indent = "") const = 0;
virtual void
- report(const distinct_diff& d, ostream& out,
- const string& indent = "") const = 0;
+ report(const distinct_diff& d, std::ostream& out,
+ const std::string& indent = "") const = 0;
virtual void
- report(const pointer_diff& d, ostream& out,
- const string& indent = "") const = 0;
+ report(const pointer_diff& d, std::ostream& out,
+ const std::string& indent = "") const = 0;
virtual void
- report(const reference_diff& d, ostream& out,
- const string& indent = "") const = 0;
+ report(const reference_diff& d, std::ostream& out,
+ const std::string& indent = "") const = 0;
virtual void
- report(const array_diff& d, ostream& out,
- const string& indent = "") const = 0;
+ report(const array_diff& d, std::ostream& out,
+ const std::string& indent = "") const = 0;
virtual void
- report(const base_diff& d, ostream& out,
- const string& indent = "") const = 0;
+ report(const base_diff& d, std::ostream& out,
+ const std::string& indent = "") const = 0;
virtual void
- report(const class_or_union_diff& d, ostream& out,
- const string& indent = "") const = 0;
+ report(const class_or_union_diff& d, std::ostream& out,
+ const std::string& indent = "") const = 0;
virtual void
- report(const class_diff& d, ostream& out,
- const string& indent = "") const = 0;
+ report(const class_diff& d, std::ostream& out,
+ const std::string& indent = "") const = 0;
virtual void
- report(const union_diff& d, ostream& out,
- const string& indent = "") const = 0;
+ report(const union_diff& d, std::ostream& out,
+ const std::string& indent = "") const = 0;
virtual void
- report(const scope_diff& d, ostream& out,
- const string& indent = "") const = 0;
+ report(const scope_diff& d, std::ostream& out,
+ const std::string& indent = "") const = 0;
virtual void
- report(const fn_parm_diff& d, ostream& out,
- const string& indent = "") const = 0;
+ report(const fn_parm_diff& d, std::ostream& out,
+ const std::string& indent = "") const = 0;
virtual void
- report(const function_type_diff& d, ostream& out,
- const string& indent = "") const = 0;
+ report(const function_type_diff& d, std::ostream& out,
+ const std::string& indent = "") const = 0;
virtual void
- report(const function_decl_diff& d, ostream& out,
- const string& indent = "") const = 0;
+ report(const function_decl_diff& d, std::ostream& out,
+ const std::string& indent = "") const = 0;
virtual void
- report(const var_diff& d, ostream& out, const string& indent = "") const = 0;
+ report(const var_diff& d, std::ostream& out,
+ const std::string& indent = "") const = 0;
virtual void
- report(const translation_unit_diff& d, ostream& out,
- const string& indent = "") const = 0;
+ report(const translation_unit_diff& d, std::ostream& out,
+ const std::string& indent = "") const = 0;
virtual void
- report(const corpus_diff& d, ostream& out,
- const string& indent = "") const = 0;
+ report(const corpus_diff& d, std::ostream& out,
+ const std::string& indent = "") const = 0;
virtual ~reporter_base() {}
}; //end class reporter_base
@@ -163,92 +163,100 @@ class default_reporter : public reporter_base
public:
virtual void
- report(const type_decl_diff& d, ostream& out,
- const string& indent = "") const;
+ report(const type_decl_diff& d, std::ostream& out,
+ const std::string& indent = "") const;
virtual void
- report(const enum_diff& d, ostream& out,
- const string& indent = "") const;
+ report(const enum_diff& d, std::ostream& out,
+ const std::string& indent = "") const;
void
report_local_typedef_changes(const typedef_diff &d,
- ostream& out,
- const string& indent) const;
+ std::ostream& out,
+ const std::string& indent) const;
virtual void
- report(const typedef_diff& d, ostream& out,
- const string& indent = "") const;
+ report(const typedef_diff& d, std::ostream& out,
+ const std::string& indent = "") const;
bool
report_local_qualified_type_changes(const qualified_type_diff& d,
- ostream& out,
- const string& indent) const;
+ std::ostream& out,
+ const std::string& indent) const;
virtual void
- report(const qualified_type_diff& d, ostream& out,
- const string& indent = "") const;
+ report(const qualified_type_diff& d, std::ostream& out,
+ const std::string& indent = "") const;
virtual void
- report(const pointer_diff& d, ostream& out, const string& indent = "") const;
+ report(const pointer_diff& d, std::ostream& out,
+ const std::string& indent = "") const;
void
report_local_reference_type_changes(const reference_diff& d,
- ostream& out,
- const string& indent) const;
+ std::ostream& out,
+ const std::string& indent) const;
virtual void
- report(const reference_diff& d, ostream& out,
- const string& indent = "") const;
+ report(const reference_diff& d, std::ostream& out,
+ const std::string& indent = "") const;
virtual void
- report(const fn_parm_diff& d, ostream& out,
- const string& indent = "") const;
+ report(const fn_parm_diff& d, std::ostream& out,
+ const std::string& indent = "") const;
void
report_local_function_type_changes(const function_type_diff& d,
- ostream& out,
- const string& indent) const;
+ std::ostream& out,
+ const std::string& indent) const;
virtual void
- report(const function_type_diff& d, ostream& out,
- const string& indent = "") const;
+ report(const function_type_diff& d, std::ostream& out,
+ const std::string& indent = "") const;
virtual void
- report(const array_diff& d, ostream& out, const string& indent = "") const;
+ report(const array_diff& d, std::ostream& out,
+ const std::string& indent = "") const;
virtual void
- report(const base_diff& d, ostream& out, const string& indent = "") const;
+ report(const base_diff& d, std::ostream& out,
+ const std::string& indent = "") const;
virtual void
- report(const scope_diff& d, ostream& out, const string& indent = "") const;
+ report(const scope_diff& d, std::ostream& out,
+ const std::string& indent = "") const;
virtual void
- report(const class_or_union_diff& d, ostream& out,
- const string& indent = "") const;
+ report(const class_or_union_diff& d, std::ostream& out,
+ const std::string& indent = "") const;
virtual void
- report(const class_diff& d, ostream& out, const string& indent = "") const;
+ report(const class_diff& d, std::ostream& out,
+ const std::string& indent = "") const;
virtual void
- report(const union_diff& d, ostream& out, const string& indent = "") const;
+ report(const union_diff& d, std::ostream& out,
+ const std::string& indent = "") const;
virtual void
- report(const distinct_diff& d, ostream& out, const string& indent = "") const;
+ report(const distinct_diff& d, std::ostream& out,
+ const std::string& indent = "") const;
virtual void
- report(const function_decl_diff& d, ostream& out,
- const string& indent = "") const;
+ report(const function_decl_diff& d, std::ostream& out,
+ const std::string& indent = "") const;
virtual void
- report(const var_diff& d, ostream& out, const string& indent = "") const;
+ report(const var_diff& d, std::ostream& out,
+ const std::string& indent = "") const;
virtual void
- report(const translation_unit_diff& d, ostream& out,
- const string& indent = "") const;
+ report(const translation_unit_diff& d, std::ostream& out,
+ const std::string& indent = "") const;
virtual void
- report(const corpus_diff& d, ostream& out,
- const string& indent = "") const;
+ report(const corpus_diff& d, std::ostream& out,
+ const std::string& indent = "") const;
}; // end class default_reporter
/// A reporter that only reports leaf changes
@@ -259,67 +267,72 @@ public:
virtual bool diff_to_be_reported(const diff *d) const;
void
- report_changes_from_diff_maps(const diff_maps&,
- ostream& out,
- const string& indent) const;
+ report_changes_from_diff_maps(const diff_maps&, std::ostream& out,
+ const std::string& indent) const;
virtual void
- report(const typedef_diff& d, ostream& out,
- const string& indent = "") const;
+ report(const typedef_diff& d, std::ostream& out,
+ const std::string& indent = "") const;
virtual void
- report(const qualified_type_diff& d, ostream& out,
- const string& indent = "") const;
+ report(const qualified_type_diff& d, std::ostream& out,
+ const std::string& indent = "") const;
virtual void
- report(const pointer_diff& d, ostream& out,
- const string& indent = "") const;
+ report(const pointer_diff& d, std::ostream& out,
+ const std::string& indent = "") const;
virtual void
- report(const reference_diff& d, ostream& out,
- const string& indent = "") const;
+ report(const reference_diff& d, std::ostream& out,
+ const std::string& indent = "") const;
virtual void
- report(const fn_parm_diff& d, ostream& out,
- const string& indent = "") const;
+ report(const fn_parm_diff& d, std::ostream& out,
+ const std::string& indent = "") const;
virtual void
- report(const function_type_diff& d, ostream& out,
- const string& indent = "") const;
+ report(const function_type_diff& d, std::ostream& out,
+ const std::string& indent = "") const;
virtual void
- report(const array_diff& d, ostream& out, const string& indent = "") const;
+ report(const array_diff& d, std::ostream& out,
+ const std::string& indent = "") const;
virtual void
- report(const scope_diff& d, ostream& out, const string& indent = "") const;
+ report(const scope_diff& d, std::ostream& out,
+ const std::string& indent = "") const;
virtual void
- report(const class_or_union_diff& d, ostream& out,
- const string& indent = "") const;
+ report(const class_or_union_diff& d, std::ostream& out,
+ const std::string& indent = "") const;
virtual void
- report(const class_diff& d, ostream& out, const string& indent = "") const;
+ report(const class_diff& d, std::ostream& out,
+ const std::string& indent = "") const;
virtual void
- report(const union_diff& d, ostream& out, const string& indent = "") const;
+ report(const union_diff& d, std::ostream& out,
+ const std::string& indent = "") const;
virtual void
- report(const distinct_diff& d, ostream& out, const string& indent = "") const;
+ report(const distinct_diff& d, std::ostream& out,
+ const std::string& indent = "") const;
virtual void
- report(const function_decl_diff& d, ostream& out,
- const string& indent = "") const;
+ report(const function_decl_diff& d, std::ostream& out,
+ const std::string& indent = "") const;
virtual void
- report(const var_diff& d, ostream& out, const string& indent = "") const;
+ report(const var_diff& d, std::ostream& out,
+ const std::string& indent = "") const;
virtual void
- report(const translation_unit_diff& d, ostream& out,
- const string& indent = "") const;
+ report(const translation_unit_diff& d, std::ostream& out,
+ const std::string& indent = "") const;
virtual void
- report(const corpus_diff& d, ostream& out,
- const string& indent = "") const;
+ report(const corpus_diff& d, std::ostream& out,
+ const std::string& indent = "") const;
}; // end class leaf_reporter
} // end namespace comparison
--
2.27.0.rc0.183.gde8f92d652-goog
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] abg-reporter: fully qualify std::string and std::ostream
2020-05-29 20:17 [PATCH] abg-reporter: fully qualify std::string and std::ostream Matthias Maennich
@ 2020-06-11 14:51 ` Dodji Seketeli
0 siblings, 0 replies; 2+ messages in thread
From: Dodji Seketeli @ 2020-06-11 14:51 UTC (permalink / raw)
To: Matthias Maennich; +Cc: libabigail, gprocida, kernel-team, Mark Barolak
Matthias Maennich <maennich@google.com> a écrit:
> In order to not unnecessarily pollute the abigail namespace and to avoid
> ambiguity at compile time, fully qualify std::string and std::string.
> This also resolves the issue that include/abg-reporter.h could not be
> compiled standalone and therefore was broken as a public header. It
> required a `using std::string` from a prior include.
>
> * include/abg-reporter.h (reporter_base::report) fully qualify
> std::string and std::ostream for all overloads.
> (default_reporter::report_local_typedef_changes): Likewise.
> (default_reporter::report_local_qualified_type_changes): Likewise.
> (default_reporter::report_local_reference_type_changes): Likewise.
> (default_reporter::report_local_function_type_changes): Likewise.
> (default_reporter::report): Likewise.
> (leaf_reporter::report_changes_from_diff_maps): Likewise.
> (leaf_reporter::report): Likewise.
>
> Suggested-by: Mark Barolak <mbar@google.com>
> Signed-off-by: Matthias Maennich <maennich@google.com>
Acked-by: Dodji Seketeli <dodji@redhat.com>
Applied to master, thanks!
Cheers,
--
Dodji
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-06-11 14:51 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-29 20:17 [PATCH] abg-reporter: fully qualify std::string and std::ostream Matthias Maennich
2020-06-11 14:51 ` Dodji Seketeli
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).