aboutsummaryrefslogtreecommitdiff
path: root/gcc/c-opts.c
diff options
context:
space:
mode:
authorManuel López-Ibáñez <manu@gcc.gnu.org>2007-03-15 22:24:42 +0000
committerManuel López-Ibáñez <manu@gcc.gnu.org>2007-03-15 22:24:42 +0000
commit9b439fe168ff6dacb3aa606f43a2103b68b89ded (patch)
treeddc17625766b95f07512a991f379768feb496ed3 /gcc/c-opts.c
parent71afac1da36c39729b20b4a1051fb58fd3d64419 (diff)
downloadgcc-9b439fe168ff6dacb3aa606f43a2103b68b89ded.zip
gcc-9b439fe168ff6dacb3aa606f43a2103b68b89ded.tar.gz
gcc-9b439fe168ff6dacb3aa606f43a2103b68b89ded.tar.bz2
re PR c++/24924 (front end and preprocessor pedantic_errors settings should agree)
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. From-SVN: r122961
Diffstat (limited to 'gcc/c-opts.c')
-rw-r--r--gcc/c-opts.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/gcc/c-opts.c b/gcc/c-opts.c
index bddbaad..b3878ea 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)