raven-rhel6/gcc44/gcc44-pr38987.patch
2024-02-21 20:14:44 +06:00

42 lines
1.5 KiB
Diff

2012-03-07 Richard Guenther <rguenther@suse.de>
PR pch/52518
PR pch/38987
* doc/invoke.texi (Precompiled Headers): Remove sentence that
suggests you can include PCHs from inside another header.
2009-09-22 Richard Guenther <rguenther@suse.de>
PR pch/38987
* files.c (pch_open_file): Disallow non-toplevel PCH inclusion.
--- libcpp/files.c (revision 151969)
+++ libcpp/files.c (revision 151970)
@@ -288,6 +288,12 @@ pch_open_file (cpp_reader *pfile, _cpp_f
if (file->name[0] == '\0' || !pfile->cb.valid_pch)
return false;
+ /* If the file is not included as first include from either the toplevel
+ file or the command-line it is not a valid use of PCH. */
+ if (pfile->all_files
+ && pfile->all_files->next_file)
+ return false;
+
flen = strlen (path);
len = flen + sizeof (extension);
pchname = XNEWVEC (char, len);
--- gcc/doc/invoke.texi (revision 185028)
+++ gcc/doc/invoke.texi (revision 185029)
@@ -19891,9 +19891,8 @@ Only one precompiled header can be used
@item
A precompiled header can't be used once the first C token is seen. You
-can have preprocessor directives before a precompiled header; you can
-even include a precompiled header from inside another header, so long as
-there are no C tokens before the @code{#include}.
+can have preprocessor directives before a precompiled header; you cannot
+include a precompiled header from inside another header.
@item
The precompiled header file must be produced for the same language as