Created attachment 49134 [details] BZ2-compressed preprocessed source https://gcc.gnu.org/bugzilla/show_bug.cgi?id=96732 looks similar, but this is on 10.2, not 11... $ g++ -E -pipe -O2 -fPIC -std=c++2a -fvisibility=hidden -fvisibility-inlines-hidden -ffunction-sections -fdata-sections -fno-exceptions -Wall -Wextra -Wvla -Wdate-time -Wshift-overflow=2 -Wduplicated-cond -Wno-stringop-overflow -Wno-format-overflow -Wsuggest-override -D_REENTRANT -DQT_NO_JAVA_STYLE_ITERATORS -DPCRE2_DISABLE_JIT -DHAVE_CONFIG_H -DQT_VERSION_STR='"6.0.0"' -DQT_VERSION_MAJOR=6 -DQT_VERSION_MINOR=0 -DQT_VERSION_PATCH=0 -DQT_BOOTSTRAPPED -DQT_NO_CAST_TO_ASCII -DPCRE2_CODE_UNIT_WIDTH=16 -DQT_NO_FOREACH -DQT_NO_CAST_FROM_ASCII -DQT_NO_NARROWING_CONVERSIONS_IN_CONNECT -DQT_BUILD_BOOTSTRAP_LIB -DQT_BUILDING_QT -DQT_ASCII_CAST_WARNINGS -DQT_MOC_COMPAT -DQT_USE_QSTRINGBUILDER -DQT_DEPRECATED_WARNINGS -DQT_DISABLE_DEPRECATED_BEFORE=0x050000 -DQT_DEPRECATED_WARNINGS_SINCE=0x060000 -DQT_NO_EXCEPTIONS -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_NO_DEBUG -I/home/marc/Qt/qtbase/src/tools/bootstrap -I. -I/home/marc/Qt/qtbase/src/tools -I/home/marc/Qt/qtbase/src/3rdparty/tinycbor/src -I/home/marc/Qt/qtbase/src/3rdparty/pcre2/src -I../../../include -I../../../include/QtCore -I../../../include/QtCore/6.0.0 -I../../../include/QtCore/6.0.0/QtCore -I../../../include/QtXml -I../../../include/QtXml/6.0.0 -I../../../include/QtXml/6.0.0/QtXml -I/home/marc/Qt/qtbase/mkspecs/linux-g++ -o qendian.ii /home/marc/Qt/qtbase/src/corelib/global/qendian.cpp ../../../include/QtCore/../../../qtbase/src/corelib/tools/qarraydataops.h:102:77: internal compiler error: Segmentation fault 102 | noexcept(std::is_nothrow_constructible_v<T, iterator_copy_value<ForwardIt>>) | ^~~~~~~~~ 0xc2ee1f crash_signal ../../gcc/gcc/toplev.c:328 0x6280c5 pop_nested_class() ../../gcc/gcc/cp/class.c:8184 0x738747 instantiate_template_1 ../../gcc/gcc/cp/pt.c:20853 0x733694 instantiate_template(tree_node*, tree_node*, int) ../../gcc/gcc/cp/pt.c:20908 0x733694 instantiate_alias_template ../../gcc/gcc/cp/pt.c:20946 0x733694 tsubst(tree_node*, tree_node*, int, tree_node*) ../../gcc/gcc/cp/pt.c:15147 0x739b0f lookup_template_class_1 ../../gcc/gcc/cp/pt.c:9853 0x73a1ec lookup_template_class(tree_node*, tree_node*, tree_node*, tree_node*, int, int) ../../gcc/gcc/cp/pt.c:10119 0x756b3d finish_template_type(tree_node*, tree_node*, int) ../../gcc/gcc/cp/semantics.c:3408 0x6fe15d cp_parser_template_id ../../gcc/gcc/cp/parser.c:16739 0x6fe3cc cp_parser_class_name ../../gcc/gcc/cp/parser.c:23713 0x6fb101 cp_parser_qualifying_entity ../../gcc/gcc/cp/parser.c:6776 0x6fb101 cp_parser_nested_name_specifier_opt ../../gcc/gcc/cp/parser.c:6458 0x702706 cp_parser_simple_type_specifier ../../gcc/gcc/cp/parser.c:18134 0x6e93ed cp_parser_type_specifier ../../gcc/gcc/cp/parser.c:17792 0x6fc9a9 cp_parser_type_specifier_seq ../../gcc/gcc/cp/parser.c:22402 0x6f6f34 cp_parser_type_id_1 ../../gcc/gcc/cp/parser.c:22219 0x6f9473 cp_parser_template_type_arg ../../gcc/gcc/cp/parser.c:22310 0x6fcb2f cp_parser_template_argument ../../gcc/gcc/cp/parser.c:17189 0x6fcb2f cp_parser_template_argument_list ../../gcc/gcc/cp/parser.c:17100 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See <https://gcc.gnu.org/bugs/> for instructions.
$ g++ -v Using built-in specs. COLLECT_GCC=g++ COLLECT_LTO_WRAPPER=/d/gcc/10/libexec/gcc/x86_64-pc-linux-gnu/10.2.1/lto-wrapper Target: x86_64-pc-linux-gnu Configured with: ../gcc/configure --prefix=/d/gcc/10 --enable-languages=c,c++,fortran,lto,objc --no-create --no-recursion : (reconfigured) ../gcc/configure --prefix=/d/gcc/10 --enable-languages=c,c++,fortran,lto,objc --no-create --no-recursion Thread model: posix Supported LTO compression algorithms: zlib gcc version 10.2.1 20200824 (GCC)
also in gcc version 10.2.1 20200826 (GCC)
Confirmed. Seems like this one started with r11-2747 instead.
Reduced test-case: $ cat qendian.ii template <typename> bool is_nothrow_constructible_v; template <typename> struct QArrayExceptionSafetyPrimitives { struct { template <typename> using iterator_move_value = decltype(0); template <typename ForwardIt> void move() noexcept(is_nothrow_constructible_v<iterator_move_value<ForwardIt>>); }; };
*** Bug 96819 has been marked as a duplicate of this bug. ***
*** Bug 96732 has been marked as a duplicate of this bug. ***
*** Bug 96872 has been marked as a duplicate of this bug. ***
*** Bug 97293 has been marked as a duplicate of this bug. ***
I see no progress on this bug for over a month now. I'd be happy to help with testing. Perhaps Jason is best placed to make progress on this bug.
Here's a more condensed testcase (accepted with -std=c++11/14, ICEs with -std=c++17/20): template <typename> class a { template <int b> struct c { template <bool> using t = int; t<b> m; }; };
The master branch has been updated by Jason Merrill <jason@gcc.gnu.org>: https://gcc.gnu.org/g:1c56c143b2011080d8a4516f37f78f647b0ee258 commit r11-3738-g1c56c143b2011080d8a4516f37f78f647b0ee258 Author: Jason Merrill <jason@redhat.com> Date: Thu Oct 8 15:43:26 2020 -0400 c++: Fix member alias template in C++17 and up. [PR96805] Here we're trying to push into a<T>::c<N> in order to instantiate t<N>, but were building a TYPENAME_TYPE for it because a<T> isn't open yet. Don't do that when we know we're trying to enter the scope. gcc/cp/ChangeLog: PR c++/96805 PR c++/96199 * pt.c (tsubst_aggr_type): Don't build a TYPENAME_TYPE when entering_scope. (tsubst_template_decl): Use tsubst_aggr_type. gcc/testsuite/ChangeLog: PR c++/96805 * g++.dg/cpp0x/alias-decl-pr96805.C: New test.
Fixed on trunk(?)
The releases/gcc-10 branch has been updated by Jason Merrill <jason@gcc.gnu.org>: https://gcc.gnu.org/g:e89ebd3e896f27d4afc400044d5a2b69cb524bcb commit r10-9069-ge89ebd3e896f27d4afc400044d5a2b69cb524bcb Author: Jason Merrill <jason@redhat.com> Date: Thu Oct 8 15:43:26 2020 -0400 c++: Fix member alias template in C++17 and up. [PR96805] Here we're trying to push into a<T>::c<N> in order to instantiate t<N>, but were building a TYPENAME_TYPE for it because a<T> isn't open yet. Don't do that when we know we're trying to enter the scope. gcc/cp/ChangeLog: PR c++/96805 PR c++/96199 * pt.c (tsubst_aggr_type): Don't build a TYPENAME_TYPE when entering_scope. (tsubst_template_decl): Use tsubst_aggr_type. gcc/testsuite/ChangeLog: PR c++/96805 * g++.dg/cpp0x/alias-decl-pr96805.C: New test.
Fixed.
*** Bug 99550 has been marked as a duplicate of this bug. ***