summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--gcc/testsuite/ChangeLog6
-rw-r--r--gcc/testsuite/gcc.dg/cpp/pr43195.c6
-rw-r--r--gcc/testsuite/gcc.dg/cpp/pr43195.h1
-rw-r--r--libcpp/ChangeLog5
-rw-r--r--libcpp/files.c3
5 files changed, 20 insertions, 1 deletions
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index b41206a5eec..3d07046b9d1 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -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
index 00000000000..a239fc17ba7
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/cpp/pr43195.c
@@ -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
index 00000000000..6f70f09beec
--- /dev/null
+++ b/gcc/testsuite/gcc.dg/cpp/pr43195.h
@@ -0,0 +1 @@
+#pragma once
diff --git a/libcpp/ChangeLog b/libcpp/ChangeLog
index 7762099dd12..24838d3cd10 100644
--- a/libcpp/ChangeLog
+++ b/libcpp/ChangeLog
@@ -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,
diff --git a/libcpp/files.c b/libcpp/files.c
index ecf9d6c4651..be39db9a94c 100644
--- a/libcpp/files.c
+++ b/libcpp/files.c
@@ -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)
{
OpenPOWER on IntegriCloud