From: Marek Polacek Date: Wed, 11 Mar 2026 20:10:12 +0000 (-0400) Subject: c++: require C++26 for -freflection [PR124447] X-Git-Tag: basepoints/gcc-17~757 X-Git-Url: http://git.ipfire.org/gitweb/?a=commitdiff_plain;h=9bb200e71ccf9c923bd9c7bd546130446fd76e95;p=thirdparty%2Fgcc.git c++: require C++26 for -freflection [PR124447] -freflection is unusable without C++26 so let's not allow it. PR c++/124447 gcc/c-family/ChangeLog: * c-opts.cc (c_common_post_options): Error if -freflection is used without -std=c++26 or -std=gnu++26. Reviewed-by: Jason Merrill --- diff --git a/gcc/c-family/c-opts.cc b/gcc/c-family/c-opts.cc index 1d14eeeb995..9fad71a1eb1 100644 --- a/gcc/c-family/c-opts.cc +++ b/gcc/c-family/c-opts.cc @@ -1265,6 +1265,10 @@ c_common_post_options (const char **pfilename) if (flag_immediate_escalation && cxx_dialect < cxx20) flag_immediate_escalation = 0; + if (flag_reflection && cxx_dialect < cxx26) + error ("%<-freflection%> only supported with %<-std=c++26%> or " + "%<-std=gnu++26%>"); + if (num_in_fnames > 1) error ("too many filenames given; type %<%s %s%> for usage", progname, "--help");