OSDN Git Service

gcc/testsuite
authortromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 18 Aug 2007 17:54:11 +0000 (17:54 +0000)
committertromey <tromey@138bc75d-0d04-0410-961f-82ee72b054a4>
Sat, 18 Aug 2007 17:54:11 +0000 (17:54 +0000)
PR preprocessor/32974:
* gcc.dg/cpp/pr32974.c: New file.
libcpp
PR preprocessor/32974:
* directives.c (parse_include): Don't check for EOL when
processing #pragma dependency.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@127614 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/cpp/pr32974.c [new file with mode: 0644]
libcpp/ChangeLog
libcpp/directives.c

index 4f1b733..3e5ff06 100644 (file)
@@ -1,3 +1,8 @@
+2007-08-18  Tom Tromey  <tromey@redhat.com>
+
+       PR preprocessor/32974:
+       * gcc.dg/cpp/pr32974.c: New file.
+
 2007-08-17  Tobias Burnus  <burnus@net-b.de>
 
        * gfortran.dg/interface_abstract_1.f90: New.
diff --git a/gcc/testsuite/gcc.dg/cpp/pr32974.c b/gcc/testsuite/gcc.dg/cpp/pr32974.c
new file mode 100644 (file)
index 0000000..cec6a9e
--- /dev/null
@@ -0,0 +1,6 @@
+/* PR preprocessor/32974 - don't warn for extra tokens in pragma dependency */
+/* { dg-do compile } */
+
+#pragma GCC dependency "pr32974.c" extra tokens are ok
+
+int x;
index 0157cf3..7e8dfd5 100644 (file)
@@ -1,3 +1,9 @@
+2007-08-18  Tom Tromey  <tromey@redhat.com>
+
+       PR preprocessor/32974:
+       * directives.c (parse_include): Don't check for EOL when
+       processing #pragma dependency.
+
 2007-07-30  Ollie Wild  <aaw@google.com>
 
        * directives-only.c: New file.
index 38ca949..7f72162 100644 (file)
@@ -698,7 +698,11 @@ parse_include (cpp_reader *pfile, int *pangle_brackets,
       return NULL;
     }
 
-  if (buf == NULL || CPP_OPTION (pfile, discard_comments))
+  if (pfile->directive == &dtable[T_PRAGMA])
+    {
+      /* This pragma allows extra tokens after the file name.  */
+    }
+  else if (buf == NULL || CPP_OPTION (pfile, discard_comments))
     check_eol (pfile);
   else
     {