Modernization; no functional change intended.

Successfully bootstrapped & regrtested on x86_64-pc-linux-gnu.
Pushed to trunk as r16-1832-g5bcb841f29a861.

gcc/ChangeLog:
        * diagnostic-color.cc: Use nullptr rather than NULL.
        * diagnostic-format-sarif.cc: Likewise.
        * diagnostic-format-text.cc: Likewise.
        * diagnostic-macro-unwinding.cc: Likewise.
        * diagnostic-path-output.cc: Likewise.
        * diagnostic-path.cc: Likewise.
        * diagnostic-show-locus.cc: Likewise.
        * diagnostic-spec.cc: Likewise.
        * diagnostic.cc: Likewise.
        * lazy-diagnostic-path.cc: Likewise.
        * simple-diagnostic-path.cc: Likewise.
        * tree-diagnostic-client-data-hooks.cc: Likewise.

Signed-off-by: David Malcolm <dmalc...@redhat.com>
---
 gcc/diagnostic-color.cc                  | 14 +++---
 gcc/diagnostic-format-sarif.cc           | 14 +++---
 gcc/diagnostic-format-text.cc            | 14 +++---
 gcc/diagnostic-macro-unwinding.cc        |  6 +--
 gcc/diagnostic-path-output.cc            |  8 ++--
 gcc/diagnostic-path.cc                   |  6 +--
 gcc/diagnostic-show-locus.cc             | 28 ++++++------
 gcc/diagnostic-spec.cc                   |  4 +-
 gcc/diagnostic.cc                        | 54 ++++++++++++------------
 gcc/lazy-diagnostic-path.cc              |  2 +-
 gcc/simple-diagnostic-path.cc            |  2 +-
 gcc/tree-diagnostic-client-data-hooks.cc |  2 +-
 12 files changed, 77 insertions(+), 77 deletions(-)

diff --git a/gcc/diagnostic-color.cc b/gcc/diagnostic-color.cc
index b3bd6f997c6f..e95aaeb869cf 100644
--- a/gcc/diagnostic-color.cc
+++ b/gcc/diagnostic-color.cc
@@ -234,7 +234,7 @@ diagnostic_color_dict::parse_envvar_value (const char 
*const envvar_value)
   size_t name_len = 0, val_len = 0;
 
   name = q = envvar_value;
-  val = NULL;
+  val = nullptr;
   /* From now on, be well-formed or you're gone.  */
   for (;;)
     if (*q == ':' || *q == '\0')
@@ -259,7 +259,7 @@ diagnostic_color_dict::parse_envvar_value (const char 
*const envvar_value)
        if (*q == '\0')
          return true;
        name = ++q;
-       val = NULL;
+       val = nullptr;
       }
     else if (*q == '=')
       {
@@ -269,7 +269,7 @@ diagnostic_color_dict::parse_envvar_value (const char 
*const envvar_value)
        name_len = q - name;
        val = ++q; /* Can be the empty string.  */
       }
-    else if (val == NULL)
+    else if (val == nullptr)
       q++; /* Accumulate name.  */
     else if (*q == ';' || (*q >= '0' && *q <= '9'))
       q++; /* Accumulate val.  Protect the terminal from being sent
@@ -308,7 +308,7 @@ should_colorize (void)
 
   handle = GetStdHandle (STD_ERROR_HANDLE);
 
-  if ((handle != INVALID_HANDLE_VALUE) && (handle != NULL))
+  if ((handle != INVALID_HANDLE_VALUE) && (handle != nullptr))
     isconsole = GetConsoleMode (handle, &mode);
 
 #ifdef ENABLE_VIRTUAL_TERMINAL_PROCESSING
@@ -362,10 +362,10 @@ parse_env_vars_for_urls ()
   const char *p;
 
   p = getenv ("GCC_URLS"); /* Plural! */
-  if (p == NULL)
+  if (p == nullptr)
     p = getenv ("TERM_URLS");
 
-  if (p == NULL)
+  if (p == nullptr)
     return URL_FORMAT_DEFAULT;
 
   if (*p == '\0')
@@ -400,7 +400,7 @@ auto_enable_urls ()
   DWORD mode;
 
   handle = GetStdHandle (STD_ERROR_HANDLE);
-  if ((handle == INVALID_HANDLE_VALUE) || (handle == NULL))
+  if ((handle == INVALID_HANDLE_VALUE) || (handle == nullptr))
     return false;
 
   /* If ansi escape sequences aren't supported by the console, then URLs will
diff --git a/gcc/diagnostic-format-sarif.cc b/gcc/diagnostic-format-sarif.cc
index 3fdc6134a1be..14cdbc2e0cdb 100644
--- a/gcc/diagnostic-format-sarif.cc
+++ b/gcc/diagnostic-format-sarif.cc
@@ -1722,12 +1722,12 @@ bt_callback (void *data, uintptr_t pc, const char 
*filename, int lineno,
 
   /* If we don't have any useful information, don't print
      anything.  */
-  if (filename == NULL && function == NULL)
+  if (filename == nullptr && function == nullptr)
     return 0;
 
   /* Skip functions in diagnostic.cc or diagnostic-global-context.cc.  */
   if (closure->m_frames_arr->size () == 0
-      && filename != NULL
+      && filename != nullptr
       && (strcmp (lbasename (filename), "diagnostic.cc") == 0
          || strcmp (lbasename (filename),
                     "diagnostic-global-context.cc") == 0))
@@ -1741,13 +1741,13 @@ bt_callback (void *data, uintptr_t pc, const char 
*filename, int lineno,
       return 1;
     }
 
-  char *alc = NULL;
-  if (function != NULL)
+  char *alc = nullptr;
+  if (function != nullptr)
     {
       char *str = cplus_demangle_v3 (function,
                                     (DMGL_VERBOSE | DMGL_ANSI
                                      | DMGL_GNU_V3 | DMGL_PARAMS));
-      if (str != NULL)
+      if (str != nullptr)
        {
          alc = str;
          function = str;
@@ -1759,7 +1759,7 @@ bt_callback (void *data, uintptr_t pc, const char 
*filename, int lineno,
          if (strncmp (function, bt_stop[i], len) == 0
              && (function[len] == '\0' || function[len] == '('))
            {
-             if (alc != NULL)
+             if (alc != nullptr)
                free (alc);
              /* Returning a non-zero value stops the backtrace.  */
              return 1;
@@ -1781,7 +1781,7 @@ bt_callback (void *data, uintptr_t pc, const char 
*filename, int lineno,
   frame_obj->set_integer ("lineno", lineno);
   closure->m_frames_arr->append (std::move (frame_obj));
 
-  if (alc != NULL)
+  if (alc != nullptr)
     free (alc);
 
   return 0;
diff --git a/gcc/diagnostic-format-text.cc b/gcc/diagnostic-format-text.cc
index 5df3894a0121..7ecbe5f9563c 100644
--- a/gcc/diagnostic-format-text.cc
+++ b/gcc/diagnostic-format-text.cc
@@ -263,7 +263,7 @@ diagnostic_text_output_format::on_diagram (const 
diagnostic_diagram &diagram)
   pretty_printer *const pp = get_printer ();
 
   char *saved_prefix = pp_take_prefix (pp);
-  pp_set_prefix (pp, NULL);
+  pp_set_prefix (pp, nullptr);
   /* Use a newline before and after and a two-space indent
      to make the diagram stand out a little from the wall of text.  */
   pp_newline (pp);
@@ -471,7 +471,7 @@ update_printer ()
 void
 diagnostic_text_output_format::print_any_cwe (const diagnostic_info 
&diagnostic)
 {
-  if (diagnostic.metadata == NULL)
+  if (!diagnostic.metadata)
     return;
 
   int cwe = diagnostic.metadata->get_cwe ();
@@ -507,7 +507,7 @@ void
 diagnostic_text_output_format::
 print_any_rules (const diagnostic_info &diagnostic)
 {
-  if (diagnostic.metadata == NULL)
+  if (!diagnostic.metadata)
     return;
 
   for (unsigned idx = 0; idx < diagnostic.metadata->get_num_rules (); idx++)
@@ -522,7 +522,7 @@ print_any_rules (const diagnostic_info &diagnostic)
          const char *kind_color
            = diagnostic_get_color_for_kind (diagnostic.kind);
          pp_string (pp, colorize_start (pp_show_color (pp), kind_color));
-         char *url = NULL;
+         char *url = nullptr;
          if (pp->supports_urls_p ())
            {
              url = rule.make_url ();
@@ -639,7 +639,7 @@ void
 diagnostic_text_output_format::report_current_module (location_t where)
 {
   pretty_printer *pp = get_printer ();
-  const line_map_ordinary *map = NULL;
+  const line_map_ordinary *map = nullptr;
 
   if (pp_needs_newline (pp))
     {
@@ -677,7 +677,7 @@ diagnostic_text_output_format::report_current_module 
(location_t where)
              const char *line_col = maybe_line_and_column (s.line, col);
              static const char *const msgs[] =
                {
-                NULL,
+                nullptr,
                 N_("                 from"),
                 N_("In file included from"),   /* 2 */
                 N_("        included from"),
@@ -719,7 +719,7 @@ default_diagnostic_text_finalizer 
(diagnostic_text_output_format &text_output,
 {
   pretty_printer *const pp = text_output.get_printer ();
   char *saved_prefix = pp_take_prefix (pp);
-  pp_set_prefix (pp, NULL);
+  pp_set_prefix (pp, nullptr);
   pp_newline (pp);
   diagnostic_show_locus (&text_output.get_context (),
                         text_output.get_source_printing_options (),
diff --git a/gcc/diagnostic-macro-unwinding.cc 
b/gcc/diagnostic-macro-unwinding.cc
index 6c8f077ddb1d..aa1b81645b6b 100644
--- a/gcc/diagnostic-macro-unwinding.cc
+++ b/gcc/diagnostic-macro-unwinding.cc
@@ -157,11 +157,11 @@ maybe_unwind_expanded_macro_loc 
(diagnostic_text_output_format &text_output,
            comment above.  */
         location_t resolved_def_loc =
           linemap_resolve_location (line_table, iter->where,
-                                    LRK_MACRO_DEFINITION_LOCATION, NULL);
+                                    LRK_MACRO_DEFINITION_LOCATION, nullptr);
 
        /* Don't print trace for locations that are reserved or from
           within a system header.  */
-        const line_map_ordinary *m = NULL;
+        const line_map_ordinary *m = nullptr;
         location_t l =
           linemap_resolve_location (line_table, resolved_def_loc,
                                     LRK_SPELLING_LOCATION,  &m);
@@ -193,7 +193,7 @@ maybe_unwind_expanded_macro_loc 
(diagnostic_text_output_format &text_output,
         location_t resolved_exp_loc =
           linemap_resolve_location (line_table,
                                     iter->map->get_expansion_point_location (),
-                                    LRK_MACRO_DEFINITION_LOCATION, NULL);
+                                    LRK_MACRO_DEFINITION_LOCATION, nullptr);
 
        text_output.append_note (resolved_exp_loc,
                                 "in expansion of macro %qs",
diff --git a/gcc/diagnostic-path-output.cc b/gcc/diagnostic-path-output.cc
index 0a8931871c5d..5c8b7c67faf2 100644
--- a/gcc/diagnostic-path-output.cc
+++ b/gcc/diagnostic-path-output.cc
@@ -806,7 +806,7 @@ path_summary::path_summary (const path_print_policy &policy,
 {
   const unsigned num_events = path.num_events ();
 
-  event_range *cur_event_range = NULL;
+  event_range *cur_event_range = nullptr;
   for (unsigned idx = 0; idx < num_events; idx++)
     {
       const diagnostic_event &event = path.get_event (idx);
@@ -1194,7 +1194,7 @@ print_path_summary_as_html (const path_summary &ps,
                     || this_logical_loc != curr_frame->m_logical_loc)
                {
                  curr_frame = end_html_stack_frame (xp, std::move 
(curr_frame));
-                 if (curr_frame == NULL)
+                 if (curr_frame == nullptr)
                    {
                      curr_frame
                        = begin_html_stack_frame (xp,
@@ -1211,7 +1211,7 @@ print_path_summary_as_html (const path_summary &ps,
       else
        {
          curr_frame = begin_html_stack_frame (xp,
-                                              NULL,
+                                              nullptr,
                                               range->m_logical_loc,
                                               range->m_stack_depth,
                                               logical_loc_mgr);
@@ -1366,7 +1366,7 @@ diagnostic_text_output_format::print_path (const 
diagnostic_path &path)
                              colorize,
                              show_event_links);
        char *saved_prefix = pp_take_prefix (pp);
-       pp_set_prefix (pp, NULL);
+       pp_set_prefix (pp, nullptr);
        print_path_summary_as_text (summary, *this,
                                    get_context ().show_path_depths_p ());
        pp_flush (pp);
diff --git a/gcc/diagnostic-path.cc b/gcc/diagnostic-path.cc
index 6af24ffea380..3e169daa8cd1 100644
--- a/gcc/diagnostic-path.cc
+++ b/gcc/diagnostic-path.cc
@@ -67,7 +67,7 @@ diagnostic_event::meaning::dump_to_pp (pretty_printer *pp) 
const
   pp_character (pp, '}');
 }
 
-/* Get a string (or NULL) for V suitable for use within a SARIF
+/* Get a string (or nullptr) for V suitable for use within a SARIF
    threadFlowLocation "kinds" property (SARIF v2.1.0 section 3.38.8).  */
 
 const char *
@@ -98,7 +98,7 @@ diagnostic_event::meaning::maybe_get_verb_str (enum verb v)
     }
 }
 
-/* Get a string (or NULL) for N suitable for use within a SARIF
+/* Get a string (or nullptr) for N suitable for use within a SARIF
    threadFlowLocation "kinds" property (SARIF v2.1.0 section 3.38.8).  */
 
 const char *
@@ -125,7 +125,7 @@ diagnostic_event::meaning::maybe_get_noun_str (enum noun n)
     }
 }
 
-/* Get a string (or NULL) for P suitable for use within a SARIF
+/* Get a string (or nullptr) for P suitable for use within a SARIF
    threadFlowLocation "kinds" property (SARIF v2.1.0 section 3.38.8).  */
 
 const char *
diff --git a/gcc/diagnostic-show-locus.cc b/gcc/diagnostic-show-locus.cc
index ffb72da138d9..da7637cbcbb1 100644
--- a/gcc/diagnostic-show-locus.cc
+++ b/gcc/diagnostic-show-locus.cc
@@ -1251,9 +1251,9 @@ make_range (file_cache &fc,
            int start_line, int start_col, int end_line, int end_col)
 {
   const expanded_location start_exploc
-    = {"", start_line, start_col, NULL, false};
+    = {"", start_line, start_col, nullptr, false};
   const expanded_location finish_exploc
-    = {"", end_line, end_col, NULL, false};
+    = {"", end_line, end_col, nullptr, false};
   return layout_range (exploc_with_display_col (fc,
                                                start_exploc, def_policy (),
                                                LOCATION_ASPECT_START),
@@ -1264,7 +1264,7 @@ make_range (file_cache &fc,
                       exploc_with_display_col (fc,
                                                start_exploc, def_policy (),
                                                LOCATION_ASPECT_CARET),
-                      0, NULL);
+                      0, nullptr);
 }
 
 /* Selftests for layout_range::contains_point and
@@ -2613,7 +2613,7 @@ layout_printer<Sink>::print_annotation_line (linenum_type 
row,
 struct pod_label_text
 {
   pod_label_text ()
-  : m_buffer (NULL), m_caller_owned (false)
+  : m_buffer (nullptr), m_caller_owned (false)
   {}
 
   pod_label_text (label_text &&other)
@@ -2755,7 +2755,7 @@ layout_printer<Sink>::print_any_labels (linenum_type row)
     FOR_EACH_VEC_ELT (m_layout.m_layout_ranges, i, range)
       {
        /* Most ranges don't have labels, so reject this first.  */
-       if (range->m_label == NULL)
+       if (range->m_label == nullptr)
          continue;
 
        /* The range's caret must be on this line.  */
@@ -2771,10 +2771,10 @@ layout_printer<Sink>::print_any_labels (linenum_type 
row)
        label_text text;
        text = range->m_label->get_text (range->m_original_idx);
 
-       /* Allow for labels that return NULL from their get_text
+       /* Allow for labels that return nullptr from their get_text
           implementation (so e.g. such labels can control their own
           visibility).  */
-       if (text.get () == NULL)
+       if (text.get () == nullptr)
          continue;
 
        labels.safe_push (line_label (range->m_original_idx,
@@ -3861,7 +3861,7 @@ diagnostic_context::maybe_show_locus (const rich_location 
&richloc,
   if (loc == m_last_location
       && richloc.get_num_fixit_hints () == 0
       && richloc.get_num_locations () == 1
-      && richloc.get_range (0)->m_label == NULL)
+      && richloc.get_range (0)->m_label == nullptr)
     return;
 
   m_last_location = loc;
@@ -3895,7 +3895,7 @@ diagnostic_context::maybe_show_locus_as_html (const 
rich_location &richloc,
   if (loc == m_last_location
       && richloc.get_num_fixit_hints () == 0
       && richloc.get_num_locations () == 1
-      && richloc.get_range (0)->m_label == NULL)
+      && richloc.get_range (0)->m_label == nullptr)
     return;
 
   m_last_location = loc;
@@ -4396,11 +4396,11 @@ test_layout_x_offset_display_tab (const line_table_case 
&case_)
       layout_printer<to_text> lp (sink, test_layout, false);
       lp.print (policy);
       const char *out = pp_formatted_text (dc.get_reference_printer ());
-      ASSERT_EQ (NULL, strchr (out, '\t'));
+      ASSERT_EQ (nullptr, strchr (out, '\t'));
       const char *left_quote = strchr (out, '`');
       const char *right_quote = strchr (out, '\'');
-      ASSERT_NE (NULL, left_quote);
-      ASSERT_NE (NULL, right_quote);
+      ASSERT_NE (nullptr, left_quote);
+      ASSERT_NE (nullptr, right_quote);
       ASSERT_EQ (right_quote - left_quote, extra_width[tabstop] + 2);
     }
 
@@ -5061,10 +5061,10 @@ test_one_liner_labels ()
                  dc.test_show_locus (richloc));
   }
 
-  /* Verify that a NULL result from range_label::get_text is
+  /* Verify that a nullptr result from range_label::get_text is
      handled gracefully.  */
   {
-    text_range_label label (NULL);
+    text_range_label label (nullptr);
     gcc_rich_location richloc (bar, &label, nullptr);
 
     test_diagnostic_context dc;
diff --git a/gcc/diagnostic-spec.cc b/gcc/diagnostic-spec.cc
index 4ae2501f112b..df7857988b6a 100644
--- a/gcc/diagnostic-spec.cc
+++ b/gcc/diagnostic-spec.cc
@@ -153,7 +153,7 @@ suppress_warning_at (location_t loc, opt_code opt /* = 
all_warnings */,
 
   const nowarn_spec_t optspec (supp ? opt : opt_code ());
 
-  if (nowarn_spec_t *pspec = nowarn_map ? nowarn_map->get (loc) : NULL)
+  if (nowarn_spec_t *pspec = nowarn_map ? nowarn_map->get (loc) : nullptr)
     {
       if (supp)
        {
@@ -210,7 +210,7 @@ copy_warning (location_t to, location_t from)
 
   nowarn_spec_t *from_spec;
   if (RESERVED_LOCATION_P (from))
-    from_spec = NULL;
+    from_spec = nullptr;
   else
     from_spec = nowarn_map->get (from);
   if (RESERVED_LOCATION_P (to))
diff --git a/gcc/diagnostic.cc b/gcc/diagnostic.cc
index 3c2c9b9fb0f8..088390bc4662 100644
--- a/gcc/diagnostic.cc
+++ b/gcc/diagnostic.cc
@@ -95,7 +95,7 @@ int
 get_terminal_width (void)
 {
   const char * s = getenv ("COLUMNS");
-  if (s != NULL) {
+  if (s != nullptr) {
     int n = atoi (s);
     if (n > 0)
       return n;
@@ -679,7 +679,7 @@ diagnostic_set_info_translated (diagnostic_info 
*diagnostic, const char *msg,
   diagnostic->message.m_format_spec = msg;
   diagnostic->message.m_richloc = richloc;
   diagnostic->richloc = richloc;
-  diagnostic->metadata = NULL;
+  diagnostic->metadata = nullptr;
   diagnostic->kind = kind;
   diagnostic->option_id = 0;
 }
@@ -699,11 +699,11 @@ static const char *const diagnostic_kind_color[] = {
 #define DEFINE_DIAGNOSTIC_KIND(K, T, C) (C),
 #include "diagnostic.def"
 #undef DEFINE_DIAGNOSTIC_KIND
-  NULL
+  nullptr
 };
 
 /* Get a color name for diagnostics of type KIND
-   Result could be NULL.  */
+   Result could be nullptr.  */
 
 const char *
 diagnostic_get_color_for_kind (diagnostic_t kind)
@@ -837,12 +837,12 @@ bt_callback (void *data, uintptr_t pc, const char 
*filename, int lineno,
 
   /* If we don't have any useful information, don't print
      anything.  */
-  if (filename == NULL && function == NULL)
+  if (filename == nullptr && function == nullptr)
     return 0;
 
   /* Skip functions in diagnostic.cc.  */
   if (*pcount == 0
-      && filename != NULL
+      && filename != nullptr
       && strcmp (lbasename (filename), "diagnostic.cc") == 0)
     return 0;
 
@@ -855,13 +855,13 @@ bt_callback (void *data, uintptr_t pc, const char 
*filename, int lineno,
     }
   ++*pcount;
 
-  char *alc = NULL;
-  if (function != NULL)
+  char *alc = nullptr;
+  if (function != nullptr)
     {
       char *str = cplus_demangle_v3 (function,
                                     (DMGL_VERBOSE | DMGL_ANSI
                                      | DMGL_GNU_V3 | DMGL_PARAMS));
-      if (str != NULL)
+      if (str != nullptr)
        {
          alc = str;
          function = str;
@@ -873,7 +873,7 @@ bt_callback (void *data, uintptr_t pc, const char 
*filename, int lineno,
          if (strncmp (function, bt_stop[i], len) == 0
              && (function[len] == '\0' || function[len] == '('))
            {
-             if (alc != NULL)
+             if (alc != nullptr)
                free (alc);
              /* Returning a non-zero value stops the backtrace.  */
              return 1;
@@ -883,11 +883,11 @@ bt_callback (void *data, uintptr_t pc, const char 
*filename, int lineno,
 
   fprintf (stderr, "0x%lx %s\n\t%s:%d\n",
           (unsigned long) pc,
-          function == NULL ? "???" : function,
-          filename == NULL ? "???" : filename,
+          function == nullptr ? "???" : function,
+          filename == nullptr ? "???" : filename,
           lineno);
 
-  if (alc != NULL)
+  if (alc != nullptr)
     free (alc);
 
   return 0;
@@ -973,11 +973,11 @@ diagnostic_context::action_after_output (diagnostic_t 
diag_kind)
            finish ();
          }
 
-       struct backtrace_state *state = NULL;
+       struct backtrace_state *state = nullptr;
        if (diag_kind == DK_ICE)
-         state = backtrace_create_state (NULL, 0, bt_err_callback, NULL);
+         state = backtrace_create_state (nullptr, 0, bt_err_callback, nullptr);
        int count = 0;
-       if (state != NULL)
+       if (state != nullptr)
          backtrace_full (state, 2, bt_callback, bt_err_callback,
                          (void *) &count);
 
@@ -1194,7 +1194,7 @@ print_parseable_fixits (file_cache &fc,
   gcc_assert (richloc);
 
   char *saved_prefix = pp_take_prefix (pp);
-  pp_set_prefix (pp, NULL);
+  pp_set_prefix (pp, nullptr);
 
   for (unsigned i = 0; i < richloc->get_num_fixit_hints (); i++)
     {
@@ -1594,7 +1594,7 @@ diagnostic_context::report_diagnostic (diagnostic_info 
*diagnostic)
       || diagnostic->kind == DK_ICE
       || diagnostic->kind == DK_ICE_NOBT)
     action_after_output (diagnostic->kind);
-  diagnostic->x_data = NULL;
+  diagnostic->x_data = nullptr;
 
   if (m_edit_context_ptr)
     if (diagnostic->richloc->fixits_can_be_auto_applied_p ())
@@ -1793,9 +1793,9 @@ fancy_abort (const char *file, int line, const char 
*function)
 
       /* Attempt to print a backtrace.  */
       struct backtrace_state *state
-       = backtrace_create_state (NULL, 0, bt_err_callback, NULL);
+       = backtrace_create_state (nullptr, 0, bt_err_callback, nullptr);
       int count = 0;
-      if (state != NULL)
+      if (state != nullptr)
        backtrace_full (state, 2, bt_callback, bt_err_callback,
                        (void *) &count);
 
@@ -1900,7 +1900,7 @@ diagnostic_output_format_init (diagnostic_context 
&context,
 
 /* Initialize this context's m_diagrams based on CHARSET.
    Specifically, make a text_art::theme object for m_diagrams.m_theme,
-   (or NULL for "no diagrams").  */
+   (or nullptr for "no diagrams").  */
 
 void
 diagnostic_context::
@@ -2225,7 +2225,7 @@ test_print_parseable_fixits_insert ()
 
   linemap_add (line_table, LC_ENTER, false, "test.c", 0);
   linemap_line_start (line_table, 5, 100);
-  linemap_add (line_table, LC_LEAVE, false, NULL, 0);
+  linemap_add (line_table, LC_LEAVE, false, nullptr, 0);
   location_t where = linemap_position_for_column (line_table, 10);
   richloc.add_fixit_insert_before (where, "added content");
 
@@ -2246,7 +2246,7 @@ test_print_parseable_fixits_remove ()
 
   linemap_add (line_table, LC_ENTER, false, "test.c", 0);
   linemap_line_start (line_table, 5, 100);
-  linemap_add (line_table, LC_LEAVE, false, NULL, 0);
+  linemap_add (line_table, LC_LEAVE, false, nullptr, 0);
   source_range where;
   where.m_start = linemap_position_for_column (line_table, 10);
   where.m_finish = linemap_position_for_column (line_table, 20);
@@ -2269,7 +2269,7 @@ test_print_parseable_fixits_replace ()
 
   linemap_add (line_table, LC_ENTER, false, "test.c", 0);
   linemap_line_start (line_table, 5, 100);
-  linemap_add (line_table, LC_LEAVE, false, NULL, 0);
+  linemap_add (line_table, LC_LEAVE, false, nullptr, 0);
   source_range where;
   where.m_start = linemap_position_for_column (line_table, 10);
   where.m_finish = linemap_position_for_column (line_table, 20);
@@ -2300,7 +2300,7 @@ test_print_parseable_fixits_bytes_vs_display_columns ()
 
   linemap_add (line_table, LC_ENTER, false, fname, 0);
   linemap_line_start (line_table, 1, 100);
-  linemap_add (line_table, LC_LEAVE, false, NULL, 0);
+  linemap_add (line_table, LC_LEAVE, false, nullptr, 0);
   source_range where;
   where.m_start = linemap_position_for_column (line_table, 12);
   where.m_finish = linemap_position_for_column (line_table, 17);
@@ -2358,7 +2358,7 @@ assert_location_text (const char *expected_loc_text,
   xloc.file = filename;
   xloc.line = line;
   xloc.column = column;
-  xloc.data = NULL;
+  xloc.data = nullptr;
   xloc.sysp = false;
 
   diagnostic_column_policy column_policy (dc);
@@ -2374,7 +2374,7 @@ test_get_location_text ()
 {
   const char *old_progname = progname;
   progname = "PROGNAME";
-  assert_location_text ("PROGNAME:", NULL, 0, 0, true);
+  assert_location_text ("PROGNAME:", nullptr, 0, 0, true);
   char *built_in_colon = concat (special_fname_builtin (), ":", (char *) 0);
   assert_location_text (built_in_colon, special_fname_builtin (),
                        42, 10, true);
diff --git a/gcc/lazy-diagnostic-path.cc b/gcc/lazy-diagnostic-path.cc
index 37c8e25bd7c7..34743e35617a 100644
--- a/gcc/lazy-diagnostic-path.cc
+++ b/gcc/lazy-diagnostic-path.cc
@@ -98,7 +98,7 @@ public:
   std::unique_ptr<diagnostic_path> make_inner_path () const final override
   {
     tree fntype_void_void
-      = build_function_type_array (void_type_node, 0, NULL);
+      = build_function_type_array (void_type_node, 0, nullptr);
     tree fndecl_foo = build_fn_decl ("foo", fntype_void_void);
     auto path
       = std::make_unique<simple_diagnostic_path> (m_logical_loc_mgr,
diff --git a/gcc/simple-diagnostic-path.cc b/gcc/simple-diagnostic-path.cc
index b756cd58fbe6..d64f7b6647ac 100644
--- a/gcc/simple-diagnostic-path.cc
+++ b/gcc/simple-diagnostic-path.cc
@@ -194,7 +194,7 @@ test_intraprocedural_path (pretty_printer *event_pp)
 {
   tree_logical_location_manager mgr;
   tree fntype_void_void
-    = build_function_type_array (void_type_node, 0, NULL);
+    = build_function_type_array (void_type_node, 0, nullptr);
   tree fndecl_foo = build_fn_decl ("foo", fntype_void_void);
 
   simple_diagnostic_path path (mgr, event_pp);
diff --git a/gcc/tree-diagnostic-client-data-hooks.cc 
b/gcc/tree-diagnostic-client-data-hooks.cc
index 06a089425f00..84bd4b53fe76 100644
--- a/gcc/tree-diagnostic-client-data-hooks.cc
+++ b/gcc/tree-diagnostic-client-data-hooks.cc
@@ -155,7 +155,7 @@ public:
             stderr.
             Implement this by cleaning up the global timer instance now.  */
          delete g_timer;
-         g_timer = NULL;
+         g_timer = nullptr;
        }
   }
 
-- 
2.26.3

Reply via email to