Message ID | 20240130231841.418861-1-polacek@redhat.com |
---|---|
State | New |
Headers | show |
Series | c++: add deprecation notice for -fconcepts-ts | expand |
On Wed, Jan 31, 2024 at 12:19 AM Marek Polacek <polacek@redhat.com> wrote: > > Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? > > -- >8 -- > We plan to deprecate -fconcepts-ts in GCC 15 and remove the flag_concepts_ts > code. This note is an admonishing reminder to convert the Concepts TS > code to C++20 Concepts. What does "deprecated in GCC 15" mean? Given you output the notice with GCC 14 it would be better to state when it's going to be removed - it's effectively "deprecated" right now then? Or will it continue to "work" forever until it bitrots? > gcc/c-family/ChangeLog: > > * c-opts.cc (c_common_post_options): Add an inform saying that > -fconcepts-ts will be deprecated in GCC 15. > --- > gcc/c-family/c-opts.cc | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/gcc/c-family/c-opts.cc b/gcc/c-family/c-opts.cc > index b38a1225ac4..4cb69c6aefc 100644 > --- a/gcc/c-family/c-opts.cc > +++ b/gcc/c-family/c-opts.cc > @@ -1139,6 +1139,11 @@ c_common_post_options (const char **pfilename) > if (cxx_dialect >= cxx20 || flag_concepts_ts) > flag_concepts = 1; > > + /* -fconcepts-ts will be deprecated in GCC 15. */ > + if (flag_concepts_ts) > + inform (input_location, "%<-fconcepts-ts%> will be deprecated in GCC 15; " > + "please convert your code to C++20 concepts"); > + > /* -fimmediate-escalation has no effect when immediate functions are not > supported. */ > if (flag_immediate_escalation && cxx_dialect < cxx20) > > base-commit: f2061b2a9641c2228d4e2d86f19532ad7e93d627 > -- > 2.43.0 >
On 1/31/24 03:40, Richard Biener wrote: > On Wed, Jan 31, 2024 at 12:19 AM Marek Polacek <polacek@redhat.com> wrote: >> >> Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? >> >> -- >8 -- >> We plan to deprecate -fconcepts-ts in GCC 15 and remove the flag_concepts_ts >> code. This note is an admonishing reminder to convert the Concepts TS >> code to C++20 Concepts. > > What does "deprecated in GCC 15" mean? Given you output the notice with > GCC 14 it would be better to state when it's going to be removed - > it's effectively > "deprecated" right now then? Or will it continue to "work" forever > until it bitrots? Agreed, it's deprecated now. We talked about it having no effect in GCC 15; the message could say that. Or we could leave it vague and just say it's deprecated. Please also update invoke.texi. Jason
On Wed, Jan 31, 2024 at 2:53 PM Jason Merrill <jason@redhat.com> wrote: > > On 1/31/24 03:40, Richard Biener wrote: > > On Wed, Jan 31, 2024 at 12:19 AM Marek Polacek <polacek@redhat.com> wrote: > >> > >> Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? > >> > >> -- >8 -- > >> We plan to deprecate -fconcepts-ts in GCC 15 and remove the flag_concepts_ts > >> code. This note is an admonishing reminder to convert the Concepts TS > >> code to C++20 Concepts. > > > > What does "deprecated in GCC 15" mean? Given you output the notice with > > GCC 14 it would be better to state when it's going to be removed - > > it's effectively > > "deprecated" right now then? Or will it continue to "work" forever > > until it bitrots? > > Agreed, it's deprecated now. We talked about it having no effect in GCC > 15; the message could say that. Or we could leave it vague and just say > it's deprecated. > > Please also update invoke.texi. Btw, should -std=c++20 -fconcepts-ts be rejected? I suppose -std=c++20 enables -fconcepts by default, it also seems to accept -std=c++20 -fno-concepts ... Richard. > > Jason >
On 1/31/24 08:55, Richard Biener wrote: > On Wed, Jan 31, 2024 at 2:53 PM Jason Merrill <jason@redhat.com> wrote: >> >> On 1/31/24 03:40, Richard Biener wrote: >>> On Wed, Jan 31, 2024 at 12:19 AM Marek Polacek <polacek@redhat.com> wrote: >>>> >>>> Bootstrapped/regtested on x86_64-pc-linux-gnu, ok for trunk? >>>> >>>> -- >8 -- >>>> We plan to deprecate -fconcepts-ts in GCC 15 and remove the flag_concepts_ts >>>> code. This note is an admonishing reminder to convert the Concepts TS >>>> code to C++20 Concepts. >>> >>> What does "deprecated in GCC 15" mean? Given you output the notice with >>> GCC 14 it would be better to state when it's going to be removed - >>> it's effectively >>> "deprecated" right now then? Or will it continue to "work" forever >>> until it bitrots? >> >> Agreed, it's deprecated now. We talked about it having no effect in GCC >> 15; the message could say that. Or we could leave it vague and just say >> it's deprecated. >> >> Please also update invoke.texi. > > Btw, should -std=c++20 -fconcepts-ts be rejected? No, that makes sense, it means C++20 plus the TS extensions that didn't make it into the standard. > I suppose -std=c++20 enables -fconcepts by default, it also seems to accept -std=c++20 > -fno-concepts ... I don't know why anyone would do that, but I don't see a reason to prohibit it either. Jason
diff --git a/gcc/c-family/c-opts.cc b/gcc/c-family/c-opts.cc index b38a1225ac4..4cb69c6aefc 100644 --- a/gcc/c-family/c-opts.cc +++ b/gcc/c-family/c-opts.cc @@ -1139,6 +1139,11 @@ c_common_post_options (const char **pfilename) if (cxx_dialect >= cxx20 || flag_concepts_ts) flag_concepts = 1; + /* -fconcepts-ts will be deprecated in GCC 15. */ + if (flag_concepts_ts) + inform (input_location, "%<-fconcepts-ts%> will be deprecated in GCC 15; " + "please convert your code to C++20 concepts"); + /* -fimmediate-escalation has no effect when immediate functions are not supported. */ if (flag_immediate_escalation && cxx_dialect < cxx20)