diff options
Diffstat (limited to 'gcc/c-family/c-opts.cc')
-rw-r--r-- | gcc/c-family/c-opts.cc | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/gcc/c-family/c-opts.cc b/gcc/c-family/c-opts.cc index c68a2a2..af19140 100644 --- a/gcc/c-family/c-opts.cc +++ b/gcc/c-family/c-opts.cc @@ -111,6 +111,7 @@ static void set_std_cxx14 (int); static void set_std_cxx17 (int); static void set_std_cxx20 (int); static void set_std_cxx23 (int); +static void set_std_cxx26 (int); static void set_std_c89 (int, int); static void set_std_c99 (int); static void set_std_c11 (int); @@ -663,6 +664,12 @@ c_common_handle_option (size_t scode, const char *arg, HOST_WIDE_INT value, set_std_cxx23 (code == OPT_std_c__23 /* ISO */); break; + case OPT_std_c__26: + case OPT_std_gnu__26: + if (!preprocessing_asm_p) + set_std_cxx26 (code == OPT_std_c__26 /* ISO */); + break; + case OPT_std_c90: case OPT_std_iso9899_199409: if (!preprocessing_asm_p) @@ -1032,7 +1039,8 @@ c_common_post_options (const char **pfilename) warn_narrowing = 1; /* Unless -f{,no-}ext-numeric-literals has been used explicitly, - for -std=c++{11,14,17,20,23} default to -fno-ext-numeric-literals. */ + for -std=c++{11,14,17,20,23,26} default to + -fno-ext-numeric-literals. */ if (flag_iso && !OPTION_SET_P (flag_ext_numeric_literals)) cpp_opts->ext_numeric_literals = 0; } @@ -1820,6 +1828,24 @@ set_std_cxx23 (int iso) lang_hooks.name = "GNU C++23"; } +/* Set the C++ 2026 standard (without GNU extensions if ISO). */ +static void +set_std_cxx26 (int iso) +{ + cpp_set_lang (parse_in, iso ? CLK_CXX26: CLK_GNUCXX26); + flag_no_gnu_keywords = iso; + flag_no_nonansi_builtin = iso; + flag_iso = iso; + /* C++26 includes the C11 standard library. */ + flag_isoc94 = 1; + flag_isoc99 = 1; + flag_isoc11 = 1; + /* C++26 includes coroutines. */ + flag_coroutines = true; + cxx_dialect = cxx26; + lang_hooks.name = "GNU C++26"; +} + /* Args to -d specify what to dump. Silently ignore unrecognized options; they may be aimed at toplev.cc. */ static void |