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

            Bug ID: 87080
           Summary: ice in cp_get_fndecl_from_callee, at cp/cvt.c:965
           Product: gcc
           Version: 8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: dcb314 at hotmail dot com
  Target Milestone: ---

The following C++ code, on recent gcc trunk, and flag -Wall,
does this:

$ ~/gcc/results/bin/g++ -c -Wall bug459.cc
bug459.cc: In function ‘a fn2()’:
bug459.cc:7:17: internal compiler error: in cp_get_fndecl_from_callee, at
cp/cvt.c:965
7 |   return c() << d;
  |                 ^
0x5b0ede cp_get_fndecl_from_callee(tree_node*, bool)
        ../../trunk/gcc/cp/cvt.c:965
0x5b0ede cp_get_callee_fndecl_nofold(tree_node*)
        ../../trunk/gcc/cp/cvt.c:992
0xca6670 is_std_move_p
        ../../trunk/gcc/cp/typeck.c:9147
0xca6670 maybe_warn_pessimizing_move
        ../../trunk/gcc/cp/typeck.c:9204

class a {
  template <typename b> a &operator<<(b);
};
a c();
template <typename> a fn2() {
  int d;
  return c() << d;
}

Reply via email to