aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-family/c-opts.cc
diff options
context:
space:
mode:
Diffstat (limited to 'gcc/c-family/c-opts.cc')
-rw-r--r--gcc/c-family/c-opts.cc11
1 files changed, 10 insertions, 1 deletions
diff --git a/gcc/c-family/c-opts.cc b/gcc/c-family/c-opts.cc
index c652e82..0ec30e8 100644
--- a/gcc/c-family/c-opts.cc
+++ b/gcc/c-family/c-opts.cc
@@ -959,6 +959,15 @@ c_common_post_options (const char **pfilename)
if (warn_enum_compare == -1)
warn_enum_compare = c_dialect_cxx () ? 1 : 0;
+ /* For C++26 default to -Wkeyword-macro if -Wpedantic. */
+ if (cxx_dialect >= cxx26 && pedantic)
+ {
+ SET_OPTION_IF_UNSET (&global_options, &global_options_set,
+ warn_keyword_macro, 1);
+ if (warn_keyword_macro)
+ cpp_opts->cpp_warn_keyword_macro = warn_keyword_macro;
+ }
+
/* -Wpacked-bitfield-compat is on by default for the C languages. The
warning is issued in stor-layout.cc which is not part of the front-end so
we need to selectively turn it on here. */
@@ -1191,7 +1200,7 @@ c_common_post_options (const char **pfilename)
flag_char8_t = (cxx_dialect >= cxx20) || flag_isoc23;
cpp_opts->unsigned_utf8char = flag_char8_t ? 1 : cpp_opts->unsigned_char;
- cpp_opts->cpp_tabstop = global_dc->m_tabstop;
+ cpp_opts->cpp_tabstop = global_dc->get_column_options ().m_tabstop;
if (flag_extern_tls_init)
{