+2005-01-31 Mike Stump <mrs@apple.com>
+
+ * parser.c (cp_lexer_new_main): Get the first token, first, before
+ doing anything.
+
2005-01-31 Mark Mitchell <mark@codesourcery.com>
* decl.c (start_decl): Add missing parentheses.
2005-01-31 Mark Mitchell <mark@codesourcery.com>
* decl.c (start_decl): Add missing parentheses.
size_t space;
cp_token *buffer;
size_t space;
cp_token *buffer;
+ /* It's possible that lexing the first token will load a PCH file,
+ which is a GC collection point. So we have to grab the first
+ token before allocating any memory. Pragmas must not be deferred
+ as -fpch-preprocess can generate a pragma to load the PCH file in
+ the preprocessed output used by -save-temps. */
+ cp_lexer_get_preprocessor_token (NULL, &first_token);
+
/* Tell cpplib we want CPP_PRAGMA tokens. */
cpp_get_options (parse_in)->defer_pragmas = true;
/* Tell c_lex not to merge string constants. */
c_lex_return_raw_strings = true;
/* Tell cpplib we want CPP_PRAGMA tokens. */
cpp_get_options (parse_in)->defer_pragmas = true;
/* Tell c_lex not to merge string constants. */
c_lex_return_raw_strings = true;
- /* It's possible that lexing the first token will load a PCH file,
- which is a GC collection point. So we have to grab the first
- token before allocating any memory. */
- cp_lexer_get_preprocessor_token (NULL, &first_token);
c_common_no_more_pch ();
/* Allocate the memory. */
c_common_no_more_pch ();
/* Allocate the memory. */
--- /dev/null
+// { dg-options "-save-temps -fpch-preprocess -I." }
+
+#include "pch.H"
+int main()
+{
+ return 0;
+}