r260268 - in /branches/c++-modules: ChangeLog.m...
nathan@gcc.gnu.org
nathan@gcc.gnu.org
Tue May 15 19:54:00 GMT 2018
Author: nathan
Date: Tue May 15 19:54:23 2018
New Revision: 260268
URL: https://gcc.gnu.org/viewcvs?rev=260268&root=gcc&view=rev
Log:
Detect cpp directives at end of preamble
libcpp/
* include/cpplib.h (cpp_peek_token_with_location): Declare.
(cpp_pop_directives): Declare.
* internal.h (struct cpp_reader): Add peeked_directive field.
* directives.c (PEEKED): New.
(DIRECTIVE_TABLE): Add it.
(_cpp_handle_directive): Set peeked_directive.
(cpp_pop_directives): New.
* lex.c (cpp_peek_token): Wrapper around ...
(cpp_peek_token_with_location): ... this.
gcc/cp/
* cp-lang.c (atom_preamble_fsm): Update for new state transitions.
* lex.c (atom_preamble_prefix_peek): Check peeked directives.
* parser.c (cp_parser_module_preamble): Update.
gcc/testsuite/
* g++.dg/modules/cpp-preamble-1.C: Add diag
* g++.dg/modules/cpp-preamble-[678].C: New.
Added:
branches/c++-modules/gcc/testsuite/g++.dg/modules/cpp-preamble-6.C
branches/c++-modules/gcc/testsuite/g++.dg/modules/cpp-preamble-7.C
branches/c++-modules/gcc/testsuite/g++.dg/modules/cpp-preamble-8.C
branches/c++-modules/gcc/testsuite/g++.dg/modules/cpp-preamble-8.h
Modified:
branches/c++-modules/ChangeLog.modules
branches/c++-modules/gcc/cp/cp-lang.c
branches/c++-modules/gcc/cp/lex.c
branches/c++-modules/gcc/cp/parser.c
branches/c++-modules/gcc/testsuite/g++.dg/modules/cpp-preamble-1.C
branches/c++-modules/libcpp/directives.c
branches/c++-modules/libcpp/include/cpplib.h
branches/c++-modules/libcpp/internal.h
branches/c++-modules/libcpp/lex.c
More information about the Gcc-cvs
mailing list