]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
2007-03-15 Manuel Lopez-Ibanez <manu@gcc.gnu.org>
authormanu <manu@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 15 Mar 2007 22:24:42 +0000 (22:24 +0000)
committermanu <manu@138bc75d-0d04-0410-961f-82ee72b054a4>
Thu, 15 Mar 2007 22:24:42 +0000 (22:24 +0000)
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

gcc/ChangeLog
gcc/c-opts.c
gcc/cp/ChangeLog
gcc/cp/decl.c
gcc/testsuite/ChangeLog
gcc/testsuite/g++.dg/cpp/pedantic-errors.C [new file with mode: 0644]
gcc/testsuite/g++.dg/cpp/permissive.C [new file with mode: 0644]

index 760143ef04fc249d326d3d90090909da444974eb..9dfece9fa612dcc52fe76ac846d3330d5964f790 100644 (file)
@@ -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
index bddbaad9d7f69d48e25ff4210c86c403024ca799..b3878ea1b55f7f0905da26167d1747a815524bec 100644 (file)
@@ -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)
index dcb9655a37a6435e968f124d7dad85ede4f05547..f48aa6bd091f2f9dfa501ef8b7cd70faaf38a07d 100644 (file)
@@ -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
index 14d20cec2271597587352425e667db32ac5061e7..eefbba30c5d23d7e083b4144a6ff518ce945dba2 100644 (file)
@@ -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
index 94b5cf2d39077e835557fc19349a4e6ab187484a..3a043c1c21aa2e07feaee8fee4b7e9bf08d6268d 100644 (file)
@@ -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 (file)
index 0000000..45382b4
--- /dev/null
@@ -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 (file)
index 0000000..cca1a5d
--- /dev/null
@@ -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" } */