===================================================================
@@ -246,6 +246,10 @@ c_common_init_options (unsigned int decoded_option
}
}
+ /* Set C++ standard to C++14 if not specified on the command line. */
+ if (c_dialect_cxx ())
+ set_std_cxx14 (/*ISO*/false);
+
global_dc->colorize_source_p = true;
}
@@ -786,7 +790,7 @@ c_common_post_options (const char **pfilename)
/* By default we use C99 inline semantics in GNU99 or C99 mode. C99
inline semantics are not supported in GNU89 or C89 mode. */
if (flag_gnu89_inline == -1)
- flag_gnu89_inline = !flag_isoc99;
+ flag_gnu89_inline = c_dialect_cxx () || !flag_isoc99;
else if (!flag_gnu89_inline && !flag_isoc99)
error ("-fno-gnu89-inline is only supported in GNU99 or C99 mode");
@@ -802,10 +806,6 @@ c_common_post_options (const char **pfilename)
&& flag_no_builtin)
flag_tree_loop_distribute_patterns = 0;
- /* Set C++ standard to C++14 if not specified on the command line. */
- if (c_dialect_cxx () && cxx_dialect == cxx_unset)
- set_std_cxx14 (/*ISO*/false);
-
/* -Woverlength-strings is off by default, but is enabled by -Wpedantic.
It is never enabled in C++, as the minimum limit is not normative
in that standard. */
@@ -1519,6 +1519,8 @@ set_std_cxx98 (int iso)
flag_no_gnu_keywords = iso;
flag_no_nonansi_builtin = iso;
flag_iso = iso;
+ flag_isoc94 = 0;
+ flag_isoc99 = 0;
cxx_dialect = cxx98;
lang_hooks.name = "GNU C++98";
}