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

            Bug ID: 84002
           Summary: [8 Regression] ICE with template conversion operator
           Product: gcc
           Version: 8.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: reichelt at gcc dot gnu.org
  Target Milestone: ---

The following valid code snippet triggers an ICE on trunk:

==========================================================
struct A
{
  template<typename T> operator T() { return T(); }
};

template<typename T> void foo()
{
  A().operator T();
}

void bar()
{
  foo<int>();
}
==========================================================

bug.cc: In instantiation of 'void foo() [with T = int]':
bug.cc:13:12:   required from here
bug.cc:8:16: internal compiler error: in tsubst_baselink, at cp/pt.c:14450
   A().operator T();
   ~~~~~~~~~~~~~^
0x63c039 tsubst_baselink
        ../../gcc/gcc/cp/pt.c:14450
0xa4fe5e tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool,
bool)
        ../../gcc/gcc/cp/pt.c:17963
0xa50175 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool,
bool)
        ../../gcc/gcc/cp/pt.c:17575
0xa43f07 tsubst_copy_and_build(tree_node*, tree_node*, int, tree_node*, bool,
bool)
        ../../gcc/gcc/cp/pt.c:17012
0xa43f07 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
        ../../gcc/gcc/cp/pt.c:16750
0xa428af tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
        ../../gcc/gcc/cp/pt.c:15987
0xa417d9 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
        ../../gcc/gcc/cp/pt.c:16234
0xa40a56 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
        ../../gcc/gcc/cp/pt.c:15958
0xa40a56 instantiate_decl(tree_node*, bool, bool)
        ../../gcc/gcc/cp/pt.c:23283
0xa6df23 instantiate_pending_templates(int)
        ../../gcc/gcc/cp/pt.c:23399
0x99753a c_parse_final_cleanups()
        ../../gcc/gcc/cp/decl2.c:4680
Please submit a full bug report, [etc.]

The regression was introduced between 2017-11-26 and 2017-12-18.

Reply via email to