aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-family/c-opts.c
diff options
context:
space:
mode:
authorJason Merrill <jason@redhat.com>2015-05-09 20:47:12 -0400
committerJason Merrill <jason@gcc.gnu.org>2015-05-09 20:47:12 -0400
commit129211bc889a6ea7109b4391a3640f42b7c050c6 (patch)
treeabc6b9a35cdb67ca394fce8184e12cc975701e3b /gcc/c-family/c-opts.c
parent381bf11ee990736088f97d64e10ed1a406b4e28a (diff)
downloadgcc-129211bc889a6ea7109b4391a3640f42b7c050c6.zip
gcc-129211bc889a6ea7109b4391a3640f42b7c050c6.tar.gz
gcc-129211bc889a6ea7109b4391a3640f42b7c050c6.tar.bz2
c-common.h (enum cxx_dialect): Add cxx_unset.
gcc/c-family/ * c-common.h (enum cxx_dialect): Add cxx_unset. * c-common.c (cxx_dialect): Initialize to cxx_unset. * c-opts.c (c_common_post_options): Set C++ dialect to C++98 if unset. gcc/testsuite/ * lib/target-supports.exp (cxx_default): New global. (check_effective_target_c++11_only) (check_effective_target_c++14_only) (check_effective_target_c++98_only) (check_effective_target_c++1z_only): Check it. From-SVN: r222977
Diffstat (limited to 'gcc/c-family/c-opts.c')
-rw-r--r--gcc/c-family/c-opts.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/gcc/c-family/c-opts.c b/gcc/c-family/c-opts.c
index 8b17674..bd99871 100644
--- a/gcc/c-family/c-opts.c
+++ b/gcc/c-family/c-opts.c
@@ -896,6 +896,10 @@ c_common_post_options (const char **pfilename)
if (flag_abi_version == 0)
flag_abi_version = 8;
+ /* Set C++ standard to C++98 if not specified on the command line. */
+ if (c_dialect_cxx () && cxx_dialect == cxx_unset)
+ set_std_cxx98 (/*ISO*/false);
+
if (cxx_dialect >= cxx11)
{
/* If we're allowing C++0x constructs, don't warn about C++98