No functional change intended.
gcc/cp/ChangeLog:
* error.cc (cp_adjust_diagnostic_info): Convert "context" arg from
ptr to const &.
gcc/ChangeLog:
* diagnostics/context.cc (context::get_any_inlining_info): Convert
"context" arg of m_set_locations_cb from ptr to const &.
(context::report_diagnostic): Convert "context" arg of
m_adjust_diagnostic_info from ptr to const &.
* diagnostics/context.h (context::set_locations_callback_t):
Likewise.
(context::set_adjust_diagnostic_info_callback): Likewise.
(context::m_adjust_diagnostic_info): Likewise.
* tree-diagnostic.cc (set_inlining_locations): Likewise.
Signed-off-by: David Malcolm <dmalcolm@redhat.com>
issue an error if we later need to instantiate the template. */
static void
-cp_adjust_diagnostic_info (diagnostics::context *context,
+cp_adjust_diagnostic_info (const diagnostics::context &context,
diagnostics::diagnostic_info *diagnostic)
{
if (diagnostic->m_kind == diagnostics::kind::error)
{
diagnostic->m_option_id = OPT_Wtemplate_body;
- if (context->m_permissive)
+ if (context.m_permissive)
diagnostic->m_kind = diagnostics::kind::warning;
bool existed;
/* Retrieve the locations into which the expression about to be
diagnosed has been inlined, including those of all the callers
all the way down the inlining stack. */
- m_set_locations_cb (this, diagnostic);
+ m_set_locations_cb (*this, diagnostic);
else
{
/* When there's no callback use just the one location provided
}
if (m_adjust_diagnostic_info)
- m_adjust_diagnostic_info (this, diagnostic);
+ m_adjust_diagnostic_info (*this, diagnostic);
if (diagnostic->m_kind == kind::pedwarn)
{
friend class text_sink;
friend class buffer;
- typedef void (*set_locations_callback_t) (context *,
+ typedef void (*set_locations_callback_t) (const context &,
diagnostic_info *);
void initialize (int n_opts);
}
void
- set_adjust_diagnostic_info_callback (void (*cb) (context *,
+ set_adjust_diagnostic_info_callback (void (*cb) (const context &,
diagnostic_info *))
{
m_adjust_diagnostic_info = cb;
/* Client hook to adjust properties of the given diagnostic that we're
about to issue, such as its kind. */
- void (*m_adjust_diagnostic_info)(context *, diagnostic_info *);
+ void (*m_adjust_diagnostic_info)(const context &, diagnostic_info *);
/* Owned by the context; this would be a std::unique_ptr if
context had a proper ctor. */
to the DIAGNOSTIC location. */
static void
-set_inlining_locations (diagnostics::context *,
+set_inlining_locations (const diagnostics::context &,
diagnostics::diagnostic_info *diagnostic)
{
location_t loc = diagnostic_location (diagnostic);