https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69145

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
(In reply to David Malcolm from comment #3)
> (In reply to Tobias Burnus from comment #1)
> > Test case (seems as if the file name of the included file matters):
> 
> It may be that the threshold for triggering the bug is length of token >=
> 32: libcpp uses location_t to store range information for tokens and
> expressions, and uses 5 bits of location_t to store short ranges.  i.e. for
> tokens of up to 31 chars length, it can store them directly in location_t;
> for 32 and above it needs to use an ad-hoc location.

Yes, one char shorter filename works fine.

> > $ g++ TDICmds.cc
> > 
> > TDICmds.cc:1:24: warning: #pragma implementation for
> > ‘create_defect_script_SCDBase.cc’ appears after file is included
> >  #pragma implementation "create_defect_script_SCDBase.cc"
> >                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> 
> FWIW, this token is 32 chars long (including the quotes), and so would have
> its location stored as an ad-hoc location.

Indeed, see the patch I've attached.

Reply via email to