This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: #pragma interface/implementation broken if --enable-mapped-location


Zack Weinberg wrote:

We can't take out the cb.line_change call, that will mess up the C
front end.

Right - I don't suggest it as a real fix.


One option is for cpp_handle_deferred_pragma to temporarily clear
(and later restore) the cb.line_change.

Alternatively, cp_lexer_handle_pragma can do the same thing, though
that seems (even) less clean.

A third option to pass in an extra parameter or to set a flag so that
do_pragma knows that it is processing a pragma that was deferred.

My question is why is the pragma_token's location wrong?  That would
seem to be the real bug.

The pragma line is saved as a string, not as tokens. Then cp_lexer_handle_pragma calls cpp_handle_deferred_pragms which calls run_directive. The pragma_token seen by do_pragma (the second time) is from lexing the run_directive string. -- --Per Bothner per@bothner.com http://per.bothner.com/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]