re PR preprocessor/43195 (#pragma once and -H)

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
This commit is contained in:
Manuel López-Ibáñez 2010-04-09 16:08:42 +00:00
parent d0b8780d9f
commit d8a12e8478
5 changed files with 20 additions and 1 deletions

View 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

View File

@ -0,0 +1,6 @@
/* PR preprocessor/43195 */
/* { dg-do preprocess } */
/* { dg-options "-H" } */
/* { dg-message "pr43195\.h\n" "" { target *-*-* } 0 } */
#include "pr43195.h"

View File

@ -0,0 +1 @@
#pragma once

View 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,

View 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)
{