aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDanny Smith <dannysmith@users.sourceforge.net>2006-08-25 00:24:10 +0000
committerDanny Smith <dannysmith@users.sourceforge.net>2006-08-25 00:24:10 +0000
commita5105d419fcc9a47fb8226ba3a610a14438dc7cb (patch)
treeb944faa7ffa62104907fd4354141ca7f2270088c
parent6d448683e3c3dcde5891b44a51d3fe7f84005d7f (diff)
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. git-svn-id: https://gcc.gnu.org/svn/gcc/trunk@116392 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r--gcc/cp/ChangeLog8
-rw-r--r--gcc/cp/g++spec.c26
-rw-r--r--gcc/cp/lang-specs.h2
3 files changed, 22 insertions, 14 deletions
diff --git a/gcc/cp/ChangeLog b/gcc/cp/ChangeLog
index e1ad1bff31e..c3bb4f32614 100644
--- a/gcc/cp/ChangeLog
+++ b/gcc/cp/ChangeLog
@@ -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
diff --git a/gcc/cp/g++spec.c b/gcc/cp/g++spec.c
index 7e10bc9996f..b58fdcd7fed 100644
--- a/gcc/cp/g++spec.c
+++ b/gcc/cp/g++spec.c
@@ -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,
diff --git a/gcc/cp/lang-specs.h b/gcc/cp/lang-specs.h
index 4718ece3873..e16d2f4185c 100644
--- a/gcc/cp/lang-specs.h
+++ b/gcc/cp/lang-specs.h
@@ -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)}\