aboutsummaryrefslogtreecommitdiff
path: root/gcc
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
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')
-rw-r--r--gcc/ChangeLog7
-rw-r--r--gcc/c-opts.c17
-rw-r--r--gcc/cp/ChangeLog6
-rw-r--r--gcc/cp/decl.c11
-rw-r--r--gcc/testsuite/ChangeLog6
-rw-r--r--gcc/testsuite/g++.dg/cpp/pedantic-errors.C5
-rw-r--r--gcc/testsuite/g++.dg/cpp/permissive.C5
7 files changed, 46 insertions, 11 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 760143e..9dfece9 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,10 @@
+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.
+
2007-03-15 Richard Guenther <rguenther@suse.de>
PR middle-end/29719
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)
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index dcb9655..f48aa6b 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -1,3 +1,9 @@
+2007-03-15 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
+
+ PR c++/24924
+ * decl.c (cxx_init_decl_processing): Move command-line options
+ processing to c-opts.c.
+
2007-03-15 Douglas Gregor <doug.gregor@gmail.com>
* ptree.c (cxx_print_type): Use formatting markup for integers
diff --git a/gcc/cp/decl.c b/gcc/cp/decl.c
index 14d20ce..eefbba3 100644
--- a/gcc/cp/decl.c
+++ b/gcc/cp/decl.c
@@ -3143,17 +3143,6 @@ cxx_init_decl_processing (void)
current_lang_name = NULL_TREE;
- /* Adjust various flags based on command-line settings. */
- if (!flag_permissive)
- flag_pedantic_errors = 1;
- if (!flag_no_inline)
- {
- flag_inline_trees = 1;
- flag_no_inline = 1;
- }
- if (flag_inline_functions)
- flag_inline_trees = 2;
-
/* Force minimum function alignment if using the least significant
bit of function pointers to store the virtual bit. */
if (TARGET_PTRMEMFUNC_VBIT_LOCATION == ptrmemfunc_vbit_in_pfn
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 94b5cf2..3a043c1 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,9 @@
+2007-03-15 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
+
+ PR c++/24924
+ * g++.dg/cpp/pedantic-errors.C: New.
+ * g++.dg/cpp/permissive.C: New.
+
2007-03-15 Richard Sandiford <richard@codesourcery.com>
* g++.dg/opt/mmx1.C: Only use the PIC options for fpic targets.
diff --git a/gcc/testsuite/g++.dg/cpp/pedantic-errors.C b/gcc/testsuite/g++.dg/cpp/pedantic-errors.C
new file mode 100644
index 0000000..45382b4
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp/pedantic-errors.C
@@ -0,0 +1,5 @@
+/* { dg-do preprocess } */
+/* { dg-options "-std=c++98" } */
+
+#if 1
+#endif 1 /* { dg-error "error: extra tokens at end of #endif directive" } */
diff --git a/gcc/testsuite/g++.dg/cpp/permissive.C b/gcc/testsuite/g++.dg/cpp/permissive.C
new file mode 100644
index 0000000..cca1a5d
--- /dev/null
+++ b/gcc/testsuite/g++.dg/cpp/permissive.C
@@ -0,0 +1,5 @@
+/* { dg-do preprocess } */
+/* { dg-options "-std=c++98 -fpermissive" } */
+
+#if 1
+#endif 1 /* { dg-warning "warning: extra tokens at end of #endif directive" } */