diff -urN gcc-15.1.0-orig/gcc/c/c-decl.cc gcc-15.1.0/gcc/c/c-decl.cc
--- gcc-15.1.0-orig/gcc/c/c-decl.cc	2025-04-25 17:18:00 +0900
+++ gcc-15.1.0/gcc/c/c-decl.cc	2025-04-28 11:07:36 +0900
@@ -4004,8 +4004,9 @@
 	}
       if (!already)
 	{
-          inform (loc, "each undeclared identifier is reported only"
-                  " once for each function it appears in");
+	  inform_with_flags (loc, DI_NO_CARET,
+			     "each undeclared identifier is reported only"
+			     " once for each function it appears in");
 	  already = true;
 	}
 
diff -urN gcc-15.1.0-orig/gcc/c-family/c-opts.cc gcc-15.1.0/gcc/c-family/c-opts.cc
--- gcc-15.1.0-orig/gcc/c-family/c-opts.cc	2025-04-25 17:18:00 +0900
+++ gcc-15.1.0/gcc/c-family/c-opts.cc	2025-04-28 11:07:36 +0900
@@ -177,12 +177,15 @@
   char *saved_prefix = pp_take_prefix (pp);
   pp_set_prefix (pp, text_output.build_indent_prefix (false));
   pp_newline (pp);
-  diagnostic_show_locus (&text_output.get_context (),
-			 text_output.get_source_printing_options (),
-			 diagnostic->richloc, diagnostic->kind, pp);
-  /* By default print macro expansion contexts in the diagnostic
-     finalizer -- for tokens resulting from macro expansion.  */
-  virt_loc_aware_diagnostic_finalizer (text_output, diagnostic);
+  if (!(diagnostic->flags & DI_NO_CARET))
+    {
+      diagnostic_show_locus (&text_output.get_context (),
+			     text_output.get_source_printing_options (),
+			     diagnostic->richloc, diagnostic->kind, pp);
+      /* By default print macro expansion contexts in the diagnostic
+         finalizer -- for tokens resulting from macro expansion.  */
+      virt_loc_aware_diagnostic_finalizer (text_output, diagnostic);
+    }
   pp_set_prefix (pp, saved_prefix);
   pp_flush (pp);
 }
diff -urN gcc-15.1.0-orig/gcc/cp/call.cc gcc-15.1.0/gcc/cp/call.cc
--- gcc-15.1.0-orig/gcc/cp/call.cc	2025-04-25 17:18:00 +0900
+++ gcc-15.1.0/gcc/cp/call.cc	2025-04-28 11:07:36 +0900
@@ -4022,36 +4022,43 @@
     fn = strip_inheriting_ctors (fn);
   location_t cloc = location_of (fn);
 
+  diagnostic_info_flags diagnostic_flags = 
+    (candidate->reason != NULL && candidate->reason->code != rr_none)
+    ? DI_NO_CARET : 0;
+
   if (identifier_p (fn))
     {
       cloc = loc;
       if (candidate->num_convs == 3)
-	inform (cloc, "%s%<%D(%T, %T, %T)%> (built-in)", msg, fn,
+	inform_with_flags (cloc, diagnostic_flags,
+		"%s%<%D(%T, %T, %T)%> (built-in)", msg, fn,
 		candidate->convs[0]->type,
 		candidate->convs[1]->type,
 		candidate->convs[2]->type);
       else if (candidate->num_convs == 2)
-	inform (cloc, "%s%<%D(%T, %T)%> (built-in)", msg, fn,
+	inform_with_flags (cloc, diagnostic_flags,
+		"%s%<%D(%T, %T)%> (built-in)", msg, fn,
 		candidate->convs[0]->type,
 		candidate->convs[1]->type);
       else
-	inform (cloc, "%s%<%D(%T)%> (built-in)", msg, fn,
+	inform_with_flags (cloc, diagnostic_flags,
+		"%s%<%D(%T)%> (built-in)", msg, fn,
 		candidate->convs[0]->type);
     }
   else if (TYPE_P (fn))
-    inform (cloc, "%s%qT (conversion)", msg, fn);
+    inform_with_flags (cloc, diagnostic_flags, "%s%qT (conversion)", msg, fn);
   else if (candidate->viable == -1)
-    inform (cloc, "%s%#qD (near match)", msg, fn);
+    inform_with_flags (cloc, diagnostic_flags, "%s%#qD (near match)", msg, fn);
   else if (ignored_candidate_p (candidate))
-    inform (cloc, "%s%#qD (ignored)", msg, fn);
+    inform_with_flags (cloc, diagnostic_flags, "%s%#qD (ignored)", msg, fn);
   else if (DECL_DELETED_FN (fn))
-    inform (cloc, "%s%#qD (deleted)", msg, fn);
+    inform_with_flags (cloc, diagnostic_flags, "%s%#qD (deleted)", msg, fn);
   else if (candidate->reversed ())
-    inform (cloc, "%s%#qD (reversed)", msg, fn);
+    inform_with_flags (cloc, diagnostic_flags, "%s%#qD (reversed)", msg, fn);
   else if (candidate->rewritten ())
-    inform (cloc, "%s%#qD (rewritten)", msg, fn);
+    inform_with_flags (cloc, diagnostic_flags, "%s%#qD (rewritten)", msg, fn);
   else
-    inform (cloc, "%s%#qD", msg, fn);
+    inform_with_flags (cloc, diagnostic_flags, "%s%#qD", msg, fn);
   if (fn != candidate->fn)
     {
       cloc = location_of (candidate->fn);
diff -urN gcc-15.1.0-orig/gcc/diagnostic-core.h gcc-15.1.0/gcc/diagnostic-core.h
--- gcc-15.1.0-orig/gcc/diagnostic-core.h	2025-04-25 17:18:00 +0900
+++ gcc-15.1.0/gcc/diagnostic-core.h	2025-04-28 11:07:36 +0900
@@ -91,6 +91,13 @@
 /* Various functions for emitting diagnostics follow.
    All of these implicitly use global_dc.  */
 
+typedef unsigned int diagnostic_info_flags;
+enum
+{
+  /* Hide caret information for this diagnostic.  */
+  DI_NO_CARET  = 1 << 0,
+};
+
 /* If we haven't already defined a front-end-specific diagnostics
    style, use the generic one.  */
 #ifndef GCC_DIAG_STYLE
@@ -170,6 +177,8 @@
 extern void sorry_at (location_t, const char *, ...) ATTRIBUTE_GCC_DIAG(2,3);
 extern void inform (location_t, const char *, ...) ATTRIBUTE_GCC_DIAG(2,3);
 extern void inform (rich_location *, const char *, ...) ATTRIBUTE_GCC_DIAG(2,3);
+extern void inform_with_flags (location_t, diagnostic_info_flags, const char *, ...) 
+  ATTRIBUTE_GCC_DIAG(3,4);
 extern void inform_n (location_t, unsigned HOST_WIDE_INT, const char *,
 		      const char *, ...)
     ATTRIBUTE_GCC_DIAG(3,5) ATTRIBUTE_GCC_DIAG(4,5);
diff -urN gcc-15.1.0-orig/gcc/diagnostic-format-text.cc gcc-15.1.0/gcc/diagnostic-format-text.cc
--- gcc-15.1.0-orig/gcc/diagnostic-format-text.cc	2025-04-25 17:18:00 +0900
+++ gcc-15.1.0/gcc/diagnostic-format-text.cc	2025-04-28 11:07:36 +0900
@@ -722,9 +722,10 @@
   char *saved_prefix = pp_take_prefix (pp);
   pp_set_prefix (pp, NULL);
   pp_newline (pp);
-  diagnostic_show_locus (&text_output.get_context (),
-			 text_output.get_source_printing_options (),
-			 diagnostic->richloc, diagnostic->kind, pp);
+  if (!(diagnostic->flags & DI_NO_CARET))
+    diagnostic_show_locus (&text_output.get_context (),
+			   text_output.get_source_printing_options (),
+			   diagnostic->richloc, diagnostic->kind, pp);
   pp_set_prefix (pp, saved_prefix);
   pp_flush (pp);
 }
diff -urN gcc-15.1.0-orig/gcc/diagnostic-global-context.cc gcc-15.1.0/gcc/diagnostic-global-context.cc
--- gcc-15.1.0-orig/gcc/diagnostic-global-context.cc	2025-04-25 17:18:00 +0900
+++ gcc-15.1.0/gcc/diagnostic-global-context.cc	2025-04-28 11:07:36 +0900
@@ -62,7 +62,7 @@
   va_list ap;
   va_start (ap, gmsgid);
   rich_location richloc (line_table, location);
-  bool ret = global_dc->diagnostic_impl (&richloc, nullptr, option_id,
+  bool ret = global_dc->diagnostic_impl (&richloc, nullptr, option_id, 0,
 					 gmsgid, &ap, kind);
   va_end (ap);
   return ret;
@@ -79,7 +79,7 @@
   auto_diagnostic_group d;
   va_list ap;
   va_start (ap, gmsgid);
-  bool ret = global_dc->diagnostic_impl (richloc, nullptr, option_id,
+  bool ret = global_dc->diagnostic_impl (richloc, nullptr, option_id, 0,
 					 gmsgid, &ap, kind);
   va_end (ap);
   return ret;
@@ -94,7 +94,7 @@
 			const char *gmsgid, va_list *ap)
 {
   rich_location richloc (line_table, location);
-  return global_dc->diagnostic_impl (&richloc, nullptr, option_id,
+  return global_dc->diagnostic_impl (&richloc, nullptr, option_id, 0,
 				     gmsgid, ap, kind);
 }
 
@@ -107,7 +107,7 @@
 			     diagnostic_option_id option_id,
 			     const char *gmsgid, va_list *ap)
 {
-  return global_dc->diagnostic_impl (richloc, metadata, option_id,
+  return global_dc->diagnostic_impl (richloc, metadata, option_id, 0,
 				     gmsgid, ap, kind);
 }
 
@@ -120,7 +120,7 @@
   va_list ap;
   va_start (ap, gmsgid);
   rich_location richloc (line_table, location);
-  global_dc->diagnostic_impl (&richloc, nullptr, -1, gmsgid, &ap, DK_NOTE);
+  global_dc->diagnostic_impl (&richloc, nullptr, -1, 0, gmsgid, &ap, DK_NOTE);
   va_end (ap);
 }
 
@@ -133,7 +133,22 @@
   auto_diagnostic_group d;
   va_list ap;
   va_start (ap, gmsgid);
-  global_dc->diagnostic_impl (richloc, nullptr, -1, gmsgid, &ap, DK_NOTE);
+  global_dc->diagnostic_impl (richloc, nullptr, -1, 0, gmsgid, &ap, DK_NOTE);
+  va_end (ap);
+}
+
+/* An informative note at LOCATION.  Use this for additional details on an error
+   message.  This variant accepts diagnostic_info_flags.  */
+void
+inform_with_flags (location_t location, diagnostic_info_flags flags,
+		   const char *gmsgid, ...)
+{
+  auto_diagnostic_group d;
+  va_list ap;
+  va_start (ap, gmsgid);
+  rich_location richloc (line_table, location);
+  global_dc->diagnostic_impl (&richloc, nullptr, -1, flags, gmsgid, &ap,
+			      DK_NOTE);
   va_end (ap);
 }
 
@@ -147,7 +162,7 @@
   va_start (ap, plural_gmsgid);
   auto_diagnostic_group d;
   rich_location richloc (line_table, location);
-  global_dc->diagnostic_n_impl (&richloc, nullptr, -1, n,
+  global_dc->diagnostic_n_impl (&richloc, nullptr, -1, 0, n,
 				singular_gmsgid, plural_gmsgid,
 				&ap, DK_NOTE);
   va_end (ap);
@@ -163,7 +178,7 @@
   va_list ap;
   va_start (ap, gmsgid);
   rich_location richloc (line_table, input_location);
-  bool ret = global_dc->diagnostic_impl (&richloc, nullptr, option_id,
+  bool ret = global_dc->diagnostic_impl (&richloc, nullptr, option_id, 0,
 					 gmsgid, &ap, DK_WARNING);
   va_end (ap);
   return ret;
@@ -182,7 +197,7 @@
   va_list ap;
   va_start (ap, gmsgid);
   rich_location richloc (line_table, location);
-  bool ret = global_dc->diagnostic_impl (&richloc, nullptr, option_id,
+  bool ret = global_dc->diagnostic_impl (&richloc, nullptr, option_id, 0,
 					 gmsgid, &ap, DK_WARNING);
   va_end (ap);
   return ret;
@@ -200,7 +215,7 @@
   auto_diagnostic_group d;
   va_list ap;
   va_start (ap, gmsgid);
-  bool ret = global_dc->diagnostic_impl (richloc, nullptr, option_id,
+  bool ret = global_dc->diagnostic_impl (richloc, nullptr, option_id, 0,
 					 gmsgid, &ap, DK_WARNING);
   va_end (ap);
   return ret;
@@ -219,7 +234,7 @@
   auto_diagnostic_group d;
   va_list ap;
   va_start (ap, gmsgid);
-  bool ret = global_dc->diagnostic_impl (richloc, &metadata, option_id,
+  bool ret = global_dc->diagnostic_impl (richloc, &metadata, option_id, 0,
 					 gmsgid, &ap, DK_WARNING);
   va_end (ap);
   return ret;
@@ -238,7 +253,7 @@
   auto_diagnostic_group d;
   va_list ap;
   va_start (ap, plural_gmsgid);
-  bool ret = global_dc->diagnostic_n_impl (richloc, nullptr, option_id, n,
+  bool ret = global_dc->diagnostic_n_impl (richloc, nullptr, option_id, 0, n,
 					   singular_gmsgid, plural_gmsgid,
 					   &ap, DK_WARNING);
   va_end (ap);
@@ -259,7 +274,7 @@
   va_list ap;
   va_start (ap, plural_gmsgid);
   rich_location richloc (line_table, location);
-  bool ret = global_dc->diagnostic_n_impl (&richloc, nullptr, option_id, n,
+  bool ret = global_dc->diagnostic_n_impl (&richloc, nullptr, option_id, 0, n,
 					   singular_gmsgid, plural_gmsgid,
 					   &ap, DK_WARNING);
   va_end (ap);
@@ -288,7 +303,7 @@
   va_list ap;
   va_start (ap, gmsgid);
   rich_location richloc (line_table, location);
-  bool ret = global_dc->diagnostic_impl (&richloc, nullptr, option_id,
+  bool ret = global_dc->diagnostic_impl (&richloc, nullptr, option_id, 0,
 					 gmsgid, &ap, DK_PEDWARN);
   va_end (ap);
   return ret;
@@ -306,7 +321,7 @@
   auto_diagnostic_group d;
   va_list ap;
   va_start (ap, gmsgid);
-  bool ret = global_dc->diagnostic_impl (richloc, nullptr, option_id,
+  bool ret = global_dc->diagnostic_impl (richloc, nullptr, option_id, 0,
 					 gmsgid, &ap, DK_PEDWARN);
   va_end (ap);
   return ret;
@@ -326,7 +341,7 @@
   va_list ap;
   va_start (ap, gmsgid);
   rich_location richloc (line_table, location);
-  bool ret = global_dc->diagnostic_impl (&richloc, nullptr, -1, gmsgid, &ap,
+  bool ret = global_dc->diagnostic_impl (&richloc, nullptr, -1, 0, gmsgid, &ap,
 					 DK_PERMERROR);
   va_end (ap);
   return ret;
@@ -342,7 +357,7 @@
   auto_diagnostic_group d;
   va_list ap;
   va_start (ap, gmsgid);
-  bool ret = global_dc->diagnostic_impl (richloc, nullptr, -1, gmsgid, &ap,
+  bool ret = global_dc->diagnostic_impl (richloc, nullptr, -1, 0, gmsgid, &ap,
 					 DK_PERMERROR);
   va_end (ap);
   return ret;
@@ -361,7 +376,7 @@
   va_list ap;
   va_start (ap, gmsgid);
   rich_location richloc (line_table, location);
-  bool ret = global_dc->diagnostic_impl (&richloc, nullptr, option_id,
+  bool ret = global_dc->diagnostic_impl (&richloc, nullptr, option_id, 0,
 					 gmsgid, &ap, DK_PERMERROR);
   va_end (ap);
   return ret;
@@ -379,7 +394,7 @@
   auto_diagnostic_group d;
   va_list ap;
   va_start (ap, gmsgid);
-  bool ret = global_dc->diagnostic_impl (richloc, nullptr, option_id,
+  bool ret = global_dc->diagnostic_impl (richloc, nullptr, option_id, 0,
 					 gmsgid, &ap, DK_PERMERROR);
   va_end (ap);
   return ret;
@@ -394,7 +409,7 @@
   va_list ap;
   va_start (ap, gmsgid);
   rich_location richloc (line_table, input_location);
-  global_dc->diagnostic_impl (&richloc, nullptr, -1, gmsgid, &ap, DK_ERROR);
+  global_dc->diagnostic_impl (&richloc, nullptr, -1, 0, gmsgid, &ap, DK_ERROR);
   va_end (ap);
 }
 
@@ -408,7 +423,7 @@
   va_list ap;
   va_start (ap, plural_gmsgid);
   rich_location richloc (line_table, location);
-  global_dc->diagnostic_n_impl (&richloc, nullptr, -1, n,
+  global_dc->diagnostic_n_impl (&richloc, nullptr, -1, 0, n,
 				singular_gmsgid, plural_gmsgid,
 				&ap, DK_ERROR);
   va_end (ap);
@@ -422,7 +437,7 @@
   va_list ap;
   va_start (ap, gmsgid);
   rich_location richloc (line_table, loc);
-  global_dc->diagnostic_impl (&richloc, nullptr, -1, gmsgid, &ap, DK_ERROR);
+  global_dc->diagnostic_impl (&richloc, nullptr, -1, 0, gmsgid, &ap, DK_ERROR);
   va_end (ap);
 }
 
@@ -436,7 +451,7 @@
   auto_diagnostic_group d;
   va_list ap;
   va_start (ap, gmsgid);
-  global_dc->diagnostic_impl (richloc, nullptr, -1, gmsgid, &ap, DK_ERROR);
+  global_dc->diagnostic_impl (richloc, nullptr, -1, 0, gmsgid, &ap, DK_ERROR);
   va_end (ap);
 }
 
@@ -451,7 +466,7 @@
   auto_diagnostic_group d;
   va_list ap;
   va_start (ap, gmsgid);
-  global_dc->diagnostic_impl (richloc, &metadata, -1, gmsgid, &ap, DK_ERROR);
+  global_dc->diagnostic_impl (richloc, &metadata, -1, 0, gmsgid, &ap, DK_ERROR);
   va_end (ap);
 }
 
@@ -465,7 +480,7 @@
   va_list ap;
   va_start (ap, gmsgid);
   rich_location richloc (line_table, input_location);
-  global_dc->diagnostic_impl (&richloc, nullptr, -1, gmsgid, &ap, DK_SORRY);
+  global_dc->diagnostic_impl (&richloc, nullptr, -1, 0, gmsgid, &ap, DK_SORRY);
   va_end (ap);
 }
 
@@ -477,7 +492,7 @@
   va_list ap;
   va_start (ap, gmsgid);
   rich_location richloc (line_table, loc);
-  global_dc->diagnostic_impl (&richloc, nullptr, -1, gmsgid, &ap, DK_SORRY);
+  global_dc->diagnostic_impl (&richloc, nullptr, -1, 0, gmsgid, &ap, DK_SORRY);
   va_end (ap);
 }
 
@@ -499,7 +514,7 @@
   va_list ap;
   va_start (ap, gmsgid);
   rich_location richloc (line_table, loc);
-  global_dc->diagnostic_impl (&richloc, nullptr, -1, gmsgid, &ap, DK_FATAL);
+  global_dc->diagnostic_impl (&richloc, nullptr, -1, 0, gmsgid, &ap, DK_FATAL);
   va_end (ap);
 
   gcc_unreachable ();
@@ -514,7 +529,7 @@
   va_list ap;
   va_start (ap, gmsgid);
   rich_location richloc (line_table, input_location);
-  global_dc->diagnostic_impl (&richloc, nullptr, -1, gmsgid, &ap, DK_ICE);
+  global_dc->diagnostic_impl (&richloc, nullptr, -1, 0, gmsgid, &ap, DK_ICE);
   va_end (ap);
 
   gcc_unreachable ();
@@ -530,7 +545,8 @@
   va_list ap;
   va_start (ap, gmsgid);
   rich_location richloc (line_table, input_location);
-  global_dc->diagnostic_impl (&richloc, nullptr, -1, gmsgid, &ap, DK_ICE_NOBT);
+  global_dc->diagnostic_impl (&richloc, nullptr, -1, 0, gmsgid, &ap,
+			      DK_ICE_NOBT);
   va_end (ap);
 
   gcc_unreachable ();
diff -urN gcc-15.1.0-orig/gcc/diagnostic.cc gcc-15.1.0/gcc/diagnostic.cc
--- gcc-15.1.0-orig/gcc/diagnostic.cc	2025-04-25 17:18:00 +0900
+++ gcc-15.1.0/gcc/diagnostic.cc	2025-04-28 11:07:36 +0900
@@ -664,6 +664,7 @@
   diagnostic->metadata = NULL;
   diagnostic->kind = kind;
   diagnostic->option_id = 0;
+  diagnostic->flags = 0;
 }
 
 /* Initialize DIAGNOSTIC, where the message GMSGID has not yet been
@@ -1353,7 +1354,7 @@
 {
   begin_group ();
 
-  bool ret = diagnostic_impl (&richloc, metadata, option_id,
+  bool ret = diagnostic_impl (&richloc, metadata, option_id, 0,
 			      gmsgid, ap, kind);
 
   end_group ();
@@ -1621,6 +1622,7 @@
 diagnostic_context::diagnostic_impl (rich_location *richloc,
 				     const diagnostic_metadata *metadata,
 				     diagnostic_option_id option_id,
+				     diagnostic_info_flags flags,
 				     const char *gmsgid,
 				     va_list *ap, diagnostic_t kind)
 {
@@ -1638,6 +1640,7 @@
 	diagnostic.option_id = option_id;
     }
   diagnostic.metadata = metadata;
+  diagnostic.flags = flags;
   return report_diagnostic (&diagnostic);
 }
 
@@ -1647,6 +1650,7 @@
 diagnostic_context::diagnostic_n_impl (rich_location *richloc,
 				       const diagnostic_metadata *metadata,
 				       diagnostic_option_id option_id,
+				       diagnostic_info_flags flags,
 				       unsigned HOST_WIDE_INT n,
 				       const char *singular_gmsgid,
 				       const char *plural_gmsgid,
@@ -1668,6 +1672,7 @@
   if (kind == DK_WARNING)
     diagnostic.option_id = option_id;
   diagnostic.metadata = metadata;
+  diagnostic.flags = flags;
   return report_diagnostic (&diagnostic);
 }
 
diff -urN gcc-15.1.0-orig/gcc/diagnostic.h gcc-15.1.0/gcc/diagnostic.h
--- gcc-15.1.0-orig/gcc/diagnostic.h	2025-04-25 17:18:00 +0900
+++ gcc-15.1.0/gcc/diagnostic.h	2025-04-28 11:16:32 +0900
@@ -156,6 +156,8 @@
   diagnostic_t kind;
   /* Which OPT_* directly controls this diagnostic.  */
   diagnostic_option_id option_id;
+  /* Flags that allow more fine-tuning of diagnostics.  */
+  diagnostic_info_flags flags;
 
   /* Inlining context containing locations for each call site along
      the inlining stack.  */
@@ -720,12 +722,12 @@
   }
 
   bool diagnostic_impl (rich_location *, const diagnostic_metadata *,
-			diagnostic_option_id, const char *,
-			va_list *, diagnostic_t) ATTRIBUTE_GCC_DIAG(5,0);
+			diagnostic_option_id, diagnostic_info_flags, const char *,
+			va_list *, diagnostic_t) ATTRIBUTE_GCC_DIAG(6,0);
   bool diagnostic_n_impl (rich_location *, const diagnostic_metadata *,
-			  diagnostic_option_id, unsigned HOST_WIDE_INT,
+			  diagnostic_option_id, diagnostic_info_flags, unsigned HOST_WIDE_INT,
 			  const char *, const char *, va_list *,
-			  diagnostic_t) ATTRIBUTE_GCC_DIAG(7,0);
+			  diagnostic_t) ATTRIBUTE_GCC_DIAG(8,0);
 
   int get_diagnostic_nesting_level () const
   {
diff -urN gcc-15.1.0-orig/gcc/fortran/error.cc gcc-15.1.0/gcc/fortran/error.cc
--- gcc-15.1.0-orig/gcc/fortran/error.cc	2025-04-25 17:18:00 +0900
+++ gcc-15.1.0/gcc/fortran/error.cc	2025-04-28 11:07:36 +0900
@@ -573,6 +573,7 @@
     : gfc_diagnostic_build_locus_prefix (loc_policy, s1, s2, colorize);
 
   if (!context->m_source_printing.enabled
+      || (diagnostic->flags & DI_NO_CARET)
       || diagnostic_location (diagnostic, 0) <= BUILTINS_LOCATION
       || diagnostic_location (diagnostic, 0) == context->m_last_location)
     {
diff -urN gcc-15.1.0-orig/gcc/opts-diagnostic.cc gcc-15.1.0/gcc/opts-diagnostic.cc
--- gcc-15.1.0-orig/gcc/opts-diagnostic.cc	2025-04-25 17:18:01 +0900
+++ gcc-15.1.0/gcc/opts-diagnostic.cc	2025-04-28 11:16:26 +0900
@@ -227,7 +227,7 @@
   va_list ap;
   va_start (ap, gmsgid);
   rich_location richloc (m_location_mgr, m_loc);
-  m_dc.diagnostic_impl (&richloc, nullptr, -1, gmsgid, &ap, DK_ERROR);
+  m_dc.diagnostic_impl (&richloc, nullptr, -1, 0, gmsgid, &ap, DK_ERROR);
   va_end (ap);
   m_dc.end_group ();
 }
diff -urN gcc-15.1.0-orig/gcc/testsuite/lib/prune.exp gcc-15.1.0/gcc/testsuite/lib/prune.exp
--- gcc-15.1.0-orig/gcc/testsuite/lib/prune.exp	2025-04-25 17:18:04 +0900
+++ gcc-15.1.0/gcc/testsuite/lib/prune.exp	2025-04-28 11:07:36 +0900
@@ -109,6 +109,9 @@
     # Many tests that use visibility will still pass on platforms that don't support it.
     regsub -all "(^|\n)\[^\n\]*lto1: warning: visibility attribute not supported in this configuration; ignored\[^\n\]*" $text "" text
 
+    # C++ notes
+    regsub -all "(^|\n)\[^\n\]*note: candidate(s)? (are|is):\[^\n\]*" $text "" text
+
     #send_user "After:$text\n"
 
     return $text
