https://gcc.gnu.org/bugzilla/show_bug.cgi?id=84139
Bug ID: 84139 Summary: C++17 Filesystem/Filesystem TS + cmcstl2 = GCC ICE Product: gcc Version: 7.2.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: cjdb.ns at gmail dot com Target Milestone: --- ## Summary It is possible to cause an ICE on GCC 7 and GCC trunk with this simple example. https://godbolt.org/g/RYBwaV. Please let me know if the issue should be resubmitted for each version of GCC that it affects. ## GCC version Version for bug report: GCC 7.2 Present on: GCC 7.1, GCC 7.2, GCC 7.3, GCC trunk ## System type This has been observed on: * g++-7 (Ubuntu 7.2.0-1ubuntu1~16.04) 7.2.0 * gcc.exe (x86_64-posix-seh-rev0, Built by MinGW-W64 project) 7.2.0 ## Command g++-7 -fconcepts -std=c++17 -save-temps example.cpp -lstdc++fs ## Diagnostic (Ubuntu) In file included from /usr/include/c++/7/bits/stl_algobase.h:65:0, from /usr/include/c++/7/bits/char_traits.h:39, from /usr/include/c++/7/string:40, from /usr/include/c++/7/stdexcept:39, from /usr/include/c++/7/array:39, from /usr/include/c++/7/tuple:39, from /usr/include/c++/7/functional:54, from /usr/local/include/stl2/functional.hpp:16, from /usr/local/include/stl2/detail/concepts/algorithm.hpp:15, from /usr/local/include/stl2/concepts.hpp:16, from /usr/local/include/experimental/ranges/concepts:12, from example.cpp:1: /usr/include/c++/7/bits/stl_iterator_base_types.h: In instantiation of ‘struct std::iterator_traits<const std::experimental::filesystem::v1::__cxx11::path::_Cmpt*>’: /usr/include/c++/7/bits/stl_iterator.h:769:57: required from ‘class __gnu_cxx::__normal_iterator<const std::experimental::filesystem::v1::__cxx11::path::_Cmpt*, std::vector<std::experimental::filesystem::v1::__cxx11::path::_Cmpt> >’ /usr/include/c++/7/experimental/bits/fs_path.h:752:33: required from here /usr/include/c++/7/bits/stl_iterator_base_types.h:190:5: internal compiler error: in finish_member_declaration, at cp/semantics.c:2976 { ^ 0x68ffab finish_member_declaration(tree_node*) ../../src/gcc/cp/semantics.c:2976 0x5fefca instantiate_class_template_1 ../../src/gcc/cp/pt.c:10663 0x5fefca instantiate_class_template(tree_node*) ../../src/gcc/cp/pt.c:10880 0x662305 complete_type(tree_node*) ../../src/gcc/cp/typeck.c:133 0x5e4961 tsubst(tree_node*, tree_node*, int, tree_node*) ../../src/gcc/cp/pt.c:14057 0x5f6d41 tsubst_decl ../../src/gcc/cp/pt.c:12899 0x5e3e6f tsubst(tree_node*, tree_node*, int, tree_node*) ../../src/gcc/cp/pt.c:13404 0x5fef75 instantiate_class_template_1 ../../src/gcc/cp/pt.c:10596 0x5fef75 instantiate_class_template(tree_node*) ../../src/gcc/cp/pt.c:10880 0x662305 complete_type(tree_node*) ../../src/gcc/cp/typeck.c:133 0x5cea01 grokdeclarator(cp_declarator const*, cp_decl_specifier_seq*, decl_context, int, tree_node**) ../../src/gcc/cp/decl.c:12043 0x61e302 grokfield(cp_declarator const*, cp_decl_specifier_seq*, tree_node*, bool, tree_node*, tree_node*) ../../src/gcc/cp/decl2.c:806 0x63343b cp_parser_member_declaration ../../src/gcc/cp/parser.c:23419 0x633e0a cp_parser_member_specification_opt ../../src/gcc/cp/parser.c:22968 0x633e0a cp_parser_class_specifier_1 ../../src/gcc/cp/parser.c:22121 0x635a61 cp_parser_class_specifier ../../src/gcc/cp/parser.c:22373 0x635a61 cp_parser_type_specifier ../../src/gcc/cp/parser.c:16446 0x63661c cp_parser_decl_specifier_seq ../../src/gcc/cp/parser.c:13349 0x657b41 cp_parser_simple_declaration ../../src/gcc/cp/parser.c:12664 0x658995 cp_parser_block_declaration ../../src/gcc/cp/parser.c:12611 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See <file:///usr/share/doc/gcc-7/README.Bugs> for instructions.