diff options
author | manu <manu@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-03-15 22:24:42 +0000 |
---|---|---|
committer | manu <manu@138bc75d-0d04-0410-961f-82ee72b054a4> | 2007-03-15 22:24:42 +0000 |
commit | aa5093160ec85f949b1c175b7f4b43b4fc2ec3e1 (patch) | |
tree | ddc17625766b95f07512a991f379768feb496ed3 /gcc/c-opts.c | |
parent | 72b7df71b0be5b11af3e35c5af97e877163716bd (diff) | |
download | gcc-aa5093160ec85f949b1c175b7f4b43b4fc2ec3e1.tar.gz |
2007-03-15 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
PR c++/24924
* c-opts.c (c_common_post_options): Handle C++ post-processing here.
Set also -pedantic-errors by default for the preprocessor unless
-fpermissive is given.
cp/
* decl.c (cxx_init_decl_processing): Move command-line options
processing to c-opts.c.
testsuite/
* g++.dg/cpp/pedantic-errors.C: New.
* g++.dg/cpp/permissive.C: New.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@122961 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/c-opts.c')
-rw-r--r-- | gcc/c-opts.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/gcc/c-opts.c b/gcc/c-opts.c index bddbaad9d7f..b3878ea1b55 100644 --- a/gcc/c-opts.c +++ b/gcc/c-opts.c @@ -1077,6 +1077,23 @@ c_common_post_options (const char **pfilename) if (warn_overlength_strings == -1 || c_dialect_cxx ()) warn_overlength_strings = 0; + /* Adjust various flags for C++ based on command-line settings. */ + if (c_dialect_cxx ()) + { + if (!flag_permissive) + { + flag_pedantic_errors = 1; + cpp_opts->pedantic_errors = 1; + } + if (!flag_no_inline) + { + flag_inline_trees = 1; + flag_no_inline = 1; + } + if (flag_inline_functions) + flag_inline_trees = 2; + } + /* Special format checking options don't work without -Wformat; warn if they are used. */ if (!warn_format) |