[Bug c++/107173] ICE: unspellable token PRAGMA_EOL on type_traits:1446:26

2022-10-07 Thread esa.pulkkinen at iki dot fi via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107173

--- Comment #3 from Esa Pulkkinen  ---
I realize also -E option is necessary for the problem. I tried various flags to
enable/disable modules support (e.g. -fmodules-ts), but those seem not to
impact the problem, though they impact what happens if I do more than just the
preprocessing step.

[Bug c++/107173] ICE: unspellable token PRAGMA_EOL on type_traits:1446:26

2022-10-07 Thread esa.pulkkinen at iki dot fi via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107173

--- Comment #2 from Esa Pulkkinen  ---
Not sure if this info helps reproducing it, but trying to collect info about
the environment. I built gcc-13 from version
basepoints/gcc-13-2397-g20d30e737ad.

% LC_MESSAGES=C /usr/local/bin/g++ -v
Using built-in specs.
COLLECT_GCC=/usr/local/bin/g++
COLLECT_LTO_WRAPPER=/usr/local/libexec/gcc/x86_64-pc-linux-gnu/13.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ./configure --disable-multilib
Thread model: posix
Supported LTO compression algorithms: zlib
gcc version 13.0.0 20220904 (experimental) (GCC)

[Bug c++/107173] New: ICE: unspellable token PRAGMA_EOL on type_traits:1446:26

2022-10-06 Thread esa.pulkkinen at iki dot fi via Gcc-bugs
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=107173

Bug ID: 107173
   Summary: ICE: unspellable token PRAGMA_EOL on
type_traits:1446:26
   Product: gcc
   Version: 13.0
Status: UNCONFIRMED
  Severity: normal
  Priority: P3
 Component: c++
  Assignee: unassigned at gcc dot gnu.org
  Reporter: esa.pulkkinen at iki dot fi
  Target Milestone: ---

Created attachment 53674
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=53674=edit
output from preprocessor

LC_MESSAGES=C /usr/local/bin/g++ -freport-bug
-I/home/esap/c++/change/libchange-gcc/libchange
-I/home/esap/c++/change/libchange -DLIBCHANGE_SHARED_BUILD -std=c++23
-finput-charset=UTF-8 -fPIC -x c++ -MQ ^ -MD -E -fdirectives-only
/home/esap/c++/change/libchange/libchange/koe.cxx > bug.out
In file included from /usr/local/include/c++/13.0.0/bits/stl_pair.h:60,
 from /usr/local/include/c++/13.0.0/tuple:38,
 from /home/esap/c++/change/libchange/libchange/koe.cxx:2:
/usr/local/include/c++/13.0.0/type_traits:1446:26: internal compiler error:
unspellable token PRAGMA_EOL
 1446 | : public __is_nt_convertible_helper<_From, _To>::type
  |  ^
0xc731b2 c_cpp_diagnostic(cpp_reader*, cpp_diagnostic_level,
cpp_warning_reason, rich_location*, char const*, __va_list_tag (*) [1])
../.././gcc/c-family/c-common.cc:6711
0x21df1eb cpp_diagnostic_at
../.././libcpp/errors.cc:67
0x21df1eb cpp_diagnostic
../.././libcpp/errors.cc:82
0x21df316 cpp_error(cpp_reader*, cpp_diagnostic_level, char const*, ...)
../.././libcpp/errors.cc:96
0x21e9911 cpp_spell_token(cpp_reader*, cpp_token const*, unsigned char*, bool)
../.././libcpp/lex.cc:4395
0x21ea5c6 cpp_token_as_text(cpp_reader*, cpp_token const*)
../.././libcpp/lex.cc:4411
0x21e286a _cpp_parse_expr
../.././libcpp/expr.cc:1375
0x21db7b1 do_if
../.././libcpp/directives.cc:2076
0x21dd768 _cpp_handle_directive
../.././libcpp/directives.cc:572
0x21eadc2 cpp_directive_only_process(cpp_reader*, void*, void (*)(cpp_reader*,
CPP_DO_task, void*, ...))
../.././libcpp/lex.cc:5241
0xc9de61 scan_translation_unit_directives_only
../.././gcc/c-family/c-ppoutput.cc:428
0xc9de61 preprocess_file(cpp_reader*)
../.././gcc/c-family/c-ppoutput.cc:104
0xc9c110 c_common_init()
../.././gcc/c-family/c-opts.cc:1234
0xaa35ee cxx_init()
../.././gcc/cp/lex.cc:338
0x99f944 lang_dependent_init
../.././gcc/toplev.cc:1815
0x99f944 do_compile
../.././gcc/toplev.cc:2110
Please submit a full bug report, with preprocessed source.
Please include the complete backtrace with any bug report.
See  for instructions.

input file "koe.cxx" contains only following (I've reduced it to minimal
example):
  koe.cxx ===
module;
#include 
module change:koe;
=== END koe.cxx ===

compiler command line above was mostly generated by build2-0.15.0.

I think what the above means is that type_traits header is not working with
modules, even if included and not imported.
I don't really understand what the compiler is trying to say, I can't see
anything wrong in my code nor in the  system header.

I suspect -fdirectives-only causes the problem, as removing it changes the
output, and this seems to be confirmed by the stack trace produced.