On Mon, 2025-07-28 at 13:44 +0200, Mikael Pettersson wrote:
> Current trunk doesn't bootstrap with --enable-checking=release
> due to improper nesting of namespaces and #if CHECKING_P blocks.

Sorry about this.

> This corrects that.

Thanks for the fix; I've pushed it as r16-2586-g1f36aabfe81aa1.

FWIW I've now created a new "diagnostics" component in bugzilla for the
new subdirectory.  My intent is that
* bugs relating to the "gcc/diagnostics" code get the "diagnostics"
component (e.g. SARIF output, source quoting etc), whereas
* bugs relating to specific diagnostics get the component of whatever's
emitting them (e.g. the C frontend), and get the existing "diagnostic"
keyword.

Thanks again
Dave


> 
> gcc/
>       PR libgdiagnostics/121260
>       * diagnostics/changes.cc: Correct nesting of namespaces
>       and #if CHECKING_P blocks.
>       * diagnostics/context.cc: Likewise.
>       * diagnostics/html-sink.cc: Likewise.
>       * diagnostics/output-spec.cc: Likewise.
>       * diagnostics/sarif-sink.cc: Likewise.
> 
> Signed-off-by: Mikael Pettersson <mikpeli...@gmail.com>
> ---
> Note: I don't have commit rights, so if the patch is approved I'd
> neeed for someone else to commit it.
> 
>  gcc/diagnostics/changes.cc     | 8 +++++++-
>  gcc/diagnostics/context.cc     | 3 ++-
>  gcc/diagnostics/html-sink.cc   | 3 ++-
>  gcc/diagnostics/output-spec.cc | 3 ++-
>  gcc/diagnostics/sarif-sink.cc  | 3 ++-
>  5 files changed, 15 insertions(+), 5 deletions(-)
> 
> diff --git a/gcc/diagnostics/changes.cc b/gcc/diagnostics/changes.cc
> index 290d6022b5a..e1caab0e59f 100644
> --- a/gcc/diagnostics/changes.cc
> +++ b/gcc/diagnostics/changes.cc
> @@ -1850,8 +1850,13 @@ run_all_tests ()
>  }
>  
>  } // namespace diagnostics::changes::selftest
> +
> +#endif /* CHECKING_P */
> +
>  } // namespace diagnostics::changes
>  
> +#if CHECKING_P
> +
>  namespace selftest { // diagnostics::selftest
>  
>  /* Run all of the selftests within this file.  */
> @@ -1863,6 +1868,7 @@ changes_cc_tests ()
>  }
>  
>  } // namespace selftest
> -} // namespace diagnostics
>  
>  #endif /* CHECKING_P */
> +
> +} // namespace diagnostics
> diff --git a/gcc/diagnostics/context.cc b/gcc/diagnostics/context.cc
> index 0dbc1481039..85f7d2a357a 100644
> --- a/gcc/diagnostics/context.cc
> +++ b/gcc/diagnostics/context.cc
> @@ -2130,10 +2130,11 @@ context_cc_tests ()
>  }
>  
>  } // namespace diagnostics::selftest
> -} // namespace diagnostics
>  
>  #endif /* #if CHECKING_P */
>  
> +} // namespace diagnostics
> +
>  #if __GNUC__ >= 10
>  #  pragma GCC diagnostic pop
>  #endif
> diff --git a/gcc/diagnostics/html-sink.cc b/gcc/diagnostics/html-
> sink.cc
> index 07e71871d18..13d6309b7a4 100644
> --- a/gcc/diagnostics/html-sink.cc
> +++ b/gcc/diagnostics/html-sink.cc
> @@ -1702,6 +1702,7 @@ html_sink_cc_tests ()
>  }
>  
>  } // namespace selftest
> -} // namespace diagnostics
>  
>  #endif /* CHECKING_P */
> +
> +} // namespace diagnostics
> diff --git a/gcc/diagnostics/output-spec.cc b/gcc/diagnostics/output-
> spec.cc
> index 08128a92add..83f128cc536 100644
> --- a/gcc/diagnostics/output-spec.cc
> +++ b/gcc/diagnostics/output-spec.cc
> @@ -846,6 +846,7 @@ output_spec_cc_tests ()
>  }
>  
>  } // namespace diagnostics::selftest
> -} // namespace diagnostics
>  
>  #endif /* #if CHECKING_P */
> +
> +} // namespace diagnostics
> diff --git a/gcc/diagnostics/sarif-sink.cc b/gcc/diagnostics/sarif-
> sink.cc
> index 05c0a8eb3a9..4738ae9c300 100644
> --- a/gcc/diagnostics/sarif-sink.cc
> +++ b/gcc/diagnostics/sarif-sink.cc
> @@ -5072,6 +5072,7 @@ sarif_sink_cc_tests ()
>  }
>  
>  } // namespace diagnostics::selftest
> -} // namespace diagnostics
>  
>  #endif /* CHECKING_P */
> +
> +} // namespace diagnostics

Reply via email to