OSDN Git Service

2010-04-09 Manuel López-Ibáñez <manu@gcc.gnu.org>
authormanu <manu@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 9 Apr 2010 16:08:42 +0000 (16:08 +0000)
committermanu <manu@138bc75d-0d04-0410-961f-82ee72b054a4>
Fri, 9 Apr 2010 16:08:42 +0000 (16:08 +0000)
PR cpp/43195
libcpp/
* files.c (report_missing_guard): Test for #pragma once.
testsuite/
* gcc.dg/cpp/pr43195.c: New.
* gcc.dg/cpp/pr43195.h: New.

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

gcc/testsuite/ChangeLog
gcc/testsuite/gcc.dg/cpp/pr43195.c [new file with mode: 0644]
gcc/testsuite/gcc.dg/cpp/pr43195.h [new file with mode: 0644]
libcpp/ChangeLog
libcpp/files.c

index b41206a..3d07046 100644 (file)
@@ -1,3 +1,9 @@
+2010-04-09  Manuel López-Ibáñez <manu@gcc.gnu.org>
+
+       PR cpp/43195
+       * gcc.dg/cpp/pr43195.c: New.
+       * gcc.dg/cpp/pr43195.h: New.
+
 2010-04-09  Manuel López-Ibáñez  <manu@gcc.gnu.org>
 
        PR 42965
diff --git a/gcc/testsuite/gcc.dg/cpp/pr43195.c b/gcc/testsuite/gcc.dg/cpp/pr43195.c
new file mode 100644 (file)
index 0000000..a239fc1
--- /dev/null
@@ -0,0 +1,6 @@
+/* PR preprocessor/43195 */
+/* { dg-do preprocess } */
+/* { dg-options "-H" } */
+/* { dg-message "pr43195\.h\n" "" { target *-*-* } 0 } */
+#include "pr43195.h"
+
diff --git a/gcc/testsuite/gcc.dg/cpp/pr43195.h b/gcc/testsuite/gcc.dg/cpp/pr43195.h
new file mode 100644 (file)
index 0000000..6f70f09
--- /dev/null
@@ -0,0 +1 @@
+#pragma once
index 7762099..24838d3 100644 (file)
@@ -1,3 +1,8 @@
+2010-04-09  Manuel López-Ibáñez <manu@gcc.gnu.org>
+
+       PR cpp/43195
+       * files.c (report_missing_guard): Test for #pragma once.
+
 2010-04-07  Simon Baldwin  <simonb@google.com>
 
        * directives.c (do_diagnostic): Add warning reason argument,
index ecf9d6c..be39db9 100644 (file)
@@ -1261,7 +1261,8 @@ report_missing_guard (void **slot, void *d)
       _cpp_file *file = entry->u.file;
 
       /* We don't want MI guard advice for the main file.  */
-      if (file->cmacro == NULL && file->stack_count == 1 && !file->main_file)
+      if (!file->once_only && file->cmacro == NULL
+         && file->stack_count == 1 && !file->main_file)
        {
          if (data->paths == NULL)
            {