From: Manuel López-Ibáñez Date: Fri, 9 Apr 2010 16:08:42 +0000 (+0000) Subject: re PR preprocessor/43195 (#pragma once and -H) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=d8a12e847827c1c7a175bf33f3a60b0d0066ef85;p=gcc.git re PR preprocessor/43195 (#pragma once and -H) 2010-04-09 Manuel López-Ibáñez 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 --- 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 + + PR cpp/43195 + * gcc.dg/cpp/pr43195.c: New. + * gcc.dg/cpp/pr43195.h: New. + 2010-04-09 Manuel López-Ibáñez 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 + + PR cpp/43195 + * files.c (report_missing_guard): Test for #pragma once. + 2010-04-07 Simon Baldwin * 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) {