https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79325
Bug ID: 79325 Summary: ICE on valid C++ code on x86_64-linux-gnu: in arg_assoc_type, at cp/name-lookup.c:5823 Product: gcc Version: unknown Status: UNCONFIRMED Severity: normal Priority: P3 Component: c++ Assignee: unassigned at gcc dot gnu.org Reporter: su at cs dot ucdavis.edu Target Milestone: --- It seems to affect 4.8.x and later, but not 4.7.x. It might be related to PR 71820. $ g++-trunk -v Using built-in specs. COLLECT_GCC=g++-trunk COLLECT_LTO_WRAPPER=/usr/local/gcc-trunk/libexec/gcc/x86_64-pc-linux-gnu/7.0.1/lto-wrapper Target: x86_64-pc-linux-gnu Configured with: ../gcc-source-trunk/configure --enable-languages=c,c++,lto --prefix=/usr/local/gcc-trunk --disable-bootstrap Thread model: posix gcc version 7.0.1 20170201 (experimental) [trunk revision 245079] (GCC) $ $ g++-4.7 -c small.cpp $ clang++ -c small.cpp $ $ g++-trunk -c small.cpp small.cpp:3:27: internal compiler error: in arg_assoc_type, at cp/name-lookup.c:5823 __typeof__ (f (foo < int >)) bar; ^ 0x89be72 arg_assoc_type ../../gcc-source-trunk/gcc/cp/name-lookup.c:5823 0x89be06 arg_assoc_args ../../gcc-source-trunk/gcc/cp/name-lookup.c:5834 0x89be06 arg_assoc_type ../../gcc-source-trunk/gcc/cp/name-lookup.c:5806 0x89b66d arg_assoc ../../gcc-source-trunk/gcc/cp/name-lookup.c:5905 0x89b838 arg_assoc ../../gcc-source-trunk/gcc/cp/name-lookup.c:5893 0x89e931 arg_assoc_args_vec ../../gcc-source-trunk/gcc/cp/name-lookup.c:5849 0x89e931 lookup_arg_dependent_1 ../../gcc-source-trunk/gcc/cp/name-lookup.c:5954 0x89e931 lookup_arg_dependent(tree_node*, tree_node*, vec<tree_node*, va_gc, vl_embed>*) ../../gcc-source-trunk/gcc/cp/name-lookup.c:5982 0x838e24 perform_koenig_lookup(cp_expr, vec<tree_node*, va_gc, vl_embed>*, int) ../../gcc-source-trunk/gcc/cp/semantics.c:2252 0x7b3e95 cp_parser_postfix_expression ../../gcc-source-trunk/gcc/cp/parser.c:6916 0x7ae4bc cp_parser_unary_expression ../../gcc-source-trunk/gcc/cp/parser.c:8098 0x7bb717 cp_parser_cast_expression ../../gcc-source-trunk/gcc/cp/parser.c:8775 0x7bbd25 cp_parser_binary_expression ../../gcc-source-trunk/gcc/cp/parser.c:8877 0x7bc610 cp_parser_assignment_expression ../../gcc-source-trunk/gcc/cp/parser.c:9165 0x7bf0d9 cp_parser_expression ../../gcc-source-trunk/gcc/cp/parser.c:9332 0x7b17d9 cp_parser_primary_expression ../../gcc-source-trunk/gcc/cp/parser.c:4923 0x7b323e cp_parser_postfix_expression ../../gcc-source-trunk/gcc/cp/parser.c:6779 0x7ae4bc cp_parser_unary_expression ../../gcc-source-trunk/gcc/cp/parser.c:8098 0x7aed6c cp_parser_sizeof_operand ../../gcc-source-trunk/gcc/cp/parser.c:27439 0x7af219 cp_parser_simple_type_specifier ../../gcc-source-trunk/gcc/cp/parser.c:16707 Please submit a full bug report, with preprocessed source if appropriate. Please include the complete backtrace with any bug report. See <http://gcc.gnu.org/bugs.html> for instructions. $ ---------------------------------------------------------- int f (void (*) (int, int)); template < typename T > void foo (T t, __typeof__ (t)); __typeof__ (f (foo < int >)) bar;