Bug 39647 - Syntax checks in #line not quite right
Summary: Syntax checks in #line not quite right
Status: RESOLVED FIXED
Alias: None
Product: gcc
Classification: Unclassified
Component: preprocessor (show other bugs)
Version: 4.1.3
: P3 normal
Target Milestone: 4.5.0
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks: 16989 16620
  Show dependency treegraph
 
Reported: 2009-04-05 13:08 UTC by Neil Booth
Modified: 2009-04-18 15:30 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Known to work: 4.5.0
Known to fail:
Last reconfirmed: 2009-04-08 16:08:08


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Neil Booth 2009-04-05 13:08:31 UTC
The following is strictly conforming but GCC rejects it.

extern int x;
#define EMPTY()
#line 2 "foo.c" EMPTY( )
Comment 1 Joseph S. Myers 2009-04-18 15:28:55 UTC
Subject: Bug 39647

Author: jsm28
Date: Sat Apr 18 15:28:40 2009
New Revision: 146316

URL: http://gcc.gnu.org/viewcvs?root=gcc&view=rev&rev=146316
Log:
libcpp:
	PR preprocessor/39647
	* directives.c (check_eol): Add parameter expand.
	(do_undef, parse_include, do_line, do_linemarker, do_ident,
	do_pragma_once, do_pragma_system_header, do_ifdef, do_ifndef,
	do_else, do_endif, do_assert, do_unassert): All callers changed.
	Pass true from do_line, false elsewhere.

gcc/testsuite:
	* gcc.dg/cpp/line7.c: New test.

Added:
    trunk/gcc/testsuite/gcc.dg/cpp/line7.c
Modified:
    trunk/gcc/testsuite/ChangeLog
    trunk/libcpp/ChangeLog
    trunk/libcpp/directives.c

Comment 2 Joseph S. Myers 2009-04-18 15:30:42 UTC
Fixed for 4.5.