[Bug c++/69145] [6 Regression] Bogus 'warning:=?UTF-8?Q?=20=23pragma=20implementation=20for=20=E2=80=98?=...=?UTF-8?Q?=E2=80=99=20appears=20after=20file=20is=20included?='
dmalcolm at gcc dot gnu.org
gcc-bugzilla@gcc.gnu.org
Tue Jan 5 14:56:00 GMT 2016
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=69145
--- Comment #3 from David Malcolm <dmalcolm at gcc dot gnu.org> ---
(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.
> $ 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.
More information about the Gcc-bugs
mailing list