https://gcc.gnu.org/bugzilla/show_bug.cgi?id=85070

            Bug ID: 85070
           Summary: ICE on C++ code: in lazily_declare_fn, at
                    cp/method.c:2409
           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: ---

$ g++tk -v
Using built-in specs.
COLLECT_GCC=g++tk
COLLECT_LTO_WRAPPER=/home/su/software/tmp/gcc/gcc-trunk/libexec/gcc/x86_64-pc-linux-gnu/8.0.1/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc-source-trunk/configure --enable-languages=c,c++,lto
--prefix=/home/su/software/tmp/gcc/gcc-trunk --disable-bootstrap
Thread model: posix
gcc version 8.0.1 20180324 (experimental) [trunk revision 258835] (GCC) 
$ 
$ g++tk -std=c++11 tmp.cpp -c
$ 
$ g++tk -std=c++14 tmp.cpp -c
tmp.cpp:8:8: error: ‘constexpr A& A::operator=(const A&)’ cannot be overloaded
with ‘constexpr A& B::operator=(const A&)’
 struct A : B
        ^
tmp.cpp:5:17: note: previous declaration ‘constexpr A& B::operator=(const A&)’
   constexpr A & operator= (const A &);
                 ^~~~~~~~
tmp.cpp:11:11: internal compiler error: in lazily_declare_fn, at
cp/method.c:2409
 } a { a = a };
           ^
0x7dadb5 lazily_declare_fn(special_function_kind, tree_node*)
        ../../gcc-source-trunk/gcc/cp/method.c:2409
0x7e2bdc get_class_binding(tree_node*, tree_node*, int)
        ../../gcc-source-trunk/gcc/cp/name-lookup.c:1309
0x8b7a75 lookup_field_r
        ../../gcc-source-trunk/gcc/cp/search.c:977
0x8b688e dfs_walk_all(tree_node*, tree_node* (*)(tree_node*, void*), tree_node*
(*)(tree_node*, void*), void*)
        ../../gcc-source-trunk/gcc/cp/search.c:1410
0x8b6a51 lookup_member(tree_node*, tree_node*, int, bool, int,
access_failure_info*)
        ../../gcc-source-trunk/gcc/cp/search.c:1134
0x8b6e13 lookup_fnfields(tree_node*, tree_node*, int)
        ../../gcc-source-trunk/gcc/cp/search.c:1330
0x6d2006 build_new_op_1
        ../../gcc-source-trunk/gcc/cp/call.c:5694
0x6d2e1e build_new_op(unsigned int, tree_code, int, tree_node*, tree_node*,
tree_node*, tree_node**, int)
        ../../gcc-source-trunk/gcc/cp/call.c:6058
0x91d707 cp_build_modify_expr(unsigned int, tree_node*, tree_code, tree_node*,
int)
        ../../gcc-source-trunk/gcc/cp/typeck.c:8055
0x91ecec build_x_modify_expr(unsigned int, tree_node*, tree_code, tree_node*,
int)
        ../../gcc-source-trunk/gcc/cp/typeck.c:8301
0x8036ee cp_parser_assignment_expression
        ../../gcc-source-trunk/gcc/cp/parser.c:9532
0x804513 cp_parser_constant_expression
        ../../gcc-source-trunk/gcc/cp/parser.c:9772
0x8049f7 cp_parser_initializer_clause
        ../../gcc-source-trunk/gcc/cp/parser.c:21931
0x804b3d cp_parser_initializer_list
        ../../gcc-source-trunk/gcc/cp/parser.c:22198
0x804b3d cp_parser_braced_list
        ../../gcc-source-trunk/gcc/cp/parser.c:21969
0x8079b6 cp_parser_initializer
        ../../gcc-source-trunk/gcc/cp/parser.c:21887
0x82a6f1 cp_parser_init_declarator
        ../../gcc-source-trunk/gcc/cp/parser.c:19686
0x82c1c8 cp_parser_simple_declaration
        ../../gcc-source-trunk/gcc/cp/parser.c:13067
0x82d04f cp_parser_block_declaration
        ../../gcc-source-trunk/gcc/cp/parser.c:12885
0x838910 cp_parser_declaration
        ../../gcc-source-trunk/gcc/cp/parser.c:12782
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.
$ 


-----------------------------------------


struct A;

struct B
{
  constexpr A & operator= (const A &); 
};

struct A : B
{
  using B::operator=;
} a { a = a };

Reply via email to