re PR driver/28528 (C language extensions override -x in C++ driver)
authorDanny Smith <dannysmith@users.sourceforge.net>
Fri, 25 Aug 2006 00:24:10 +0000 (00:24 +0000)
committerDanny Smith <dannysmith@gcc.gnu.org>
Fri, 25 Aug 2006 00:24:10 +0000 (00:24 +0000)
PR driver/28528
* g++spec.c (lang_specific_driver): Always check if we need to
swallow a space-separated  arg to '-x'.
* lang-specs.h: Don't create ouput files for '-xc++-header'
if -fsyntax-only.

From-SVN: r116392

gcc/cp/ChangeLog
gcc/cp/g++spec.c
gcc/cp/lang-specs.h

index e1ad1bff31e202a8e400b1ee00c8a5ea9a1c9cb8..c3bb4f32614d2773b6ea422ca474dd49325f472f 100644 (file)
@@ -1,3 +1,11 @@
+2006-08-24  Danny Smith   <dannysmith@users.sourceforge.net>
+
+       PR driver/28528
+       * g++spec.c (lang_specific_driver): Always check if we need to
+       swallow a space-separated  arg to '-x'.
+       * lang-specs.h: Don't create ouput files for '-xc++-header'
+       if -fsyntax-only.
+
 2006-08-23  Jason Merrill  <jason@redhat.com>
 
        PR c++/27714
index 7e10bc9996f99dcb7d81926bac5daaa8a719b983..b58fdcd7fed096843b1a6aa30e2370fe7bf0c9da 100644 (file)
@@ -149,19 +149,19 @@ lang_specific_driver (int *in_argc, const char *const **in_argv,
            saw_verbose_flag = 1;
          else if (strncmp (argv[i], "-x", 2) == 0)
            {
-             if (library == 0)
-               {
-                 const char * arg;
-                 if (argv[i][2] != '\0')
-                   arg = argv[i]+2;
-                 else if (argv[i+1] != NULL)
-                   arg = argv[i+1];
-                 else  /* Error condition, message will be printed later.  */
-                   arg = "";
-                 if (strcmp (arg, "c++") == 0
-                     || strcmp (arg, "c++-cpp-output") == 0)
-                   library = 1;
-               }
+             const char * arg;
+             if (argv[i][2] != '\0')
+               arg = argv[i]+2;
+             else if ((argv[i+1]) != NULL)
+               /* We need to swallow arg on next loop.  */
+               quote = arg = argv[i+1];
+             else  /* Error condition, message will be printed later.  */
+               arg = "";
+             if (library == 0
+                 && (strcmp (arg, "c++") == 0
+                     || strcmp (arg, "c++-cpp-output") == 0))
+               library = 1;
+               
              saw_speclang = 1;
            }
          /* Arguments that go directly to the linker might be .o files,
index 4718ece38735d2eefd9540fd98a6d22e74eb860a..e16d2f4185c8e421a5b4a51cde0a8f2d698df523 100644 (file)
@@ -43,7 +43,7 @@ Boston, MA 02110-1301, USA.  */
       cc1plus %{save-temps|no-integrated-cpp:-fpreprocessed %{save-temps:%b.ii} %{!save-temps:%g.ii}}\
              %{!save-temps:%{!no-integrated-cpp:%(cpp_unique_options)}}\
        %(cc1_options) %2 %{+e1*}\
-       -o %g.s %{!o*:--output-pch=%i.gch} %W{o*:--output-pch=%*}%V}}}",
+       %{!fsyntax-only:-o %g.s %{!o*:--output-pch=%i.gch} %W{o*:--output-pch=%*}%V}}}}",
      CPLUSPLUS_CPP_SPEC, 0, 0},
   {"@c++",
     "%{E|M|MM:cc1plus -E %(cpp_options) %2 %(cpp_debug_options)}\