re PR preprocessor/43195 (#pragma once and -H)
authorManuel López-Ibáñez <manu@gcc.gnu.org>
Fri, 9 Apr 2010 16:08:42 +0000 (16:08 +0000)
committerManuel López-Ibáñez <manu@gcc.gnu.org>
Fri, 9 Apr 2010 16:08:42 +0000 (16:08 +0000)
2010-04-09  Manuel López-Ibáñez <manu@gcc.gnu.org>

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.

From-SVN: r158169

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 b41206a5eec1f383bd6bb16c96c0b73d0856c94f..3d07046b9d15e13292f35517c318cb7fb2f1abf4 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 7762099dd12424e18f93e64aed8e114b82e2b5ce..24838d3cd10bcb23ef676a10c1e1c517c6a2532b 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 ecf9d6c4651a598aa8b385800e12ace34301a114..be39db9a94cee0ebe6bc10c29935e728f8b3d0de 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)
            {