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

            Bug ID: 80840
           Summary: ICE in convert_nontype_argument reference to double
           Product: gcc
           Version: 7.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: cipherjason at hotmail dot com
  Target Milestone: ---

The following code causes an internal compiler error:

#include <iostream>

template <class T, T X>
struct Just;

template <const double& X>
struct Number {
    static constexpr double value = X;
    using result = Just<const double&, value>;
};

int main() {}



prog.cc:9:45: internal compiler error: in convert_nontype_argument, at
cp/pt.c:6828
     using result = Just<const double&, value>;
                                             ^
0x5e59bd convert_nontype_argument
        ../../gcc-7.1.0/gcc/cp/pt.c:6827
0x5e59bd convert_template_argument
        ../../gcc-7.1.0/gcc/cp/pt.c:7668
0x5e669c coerce_template_parms
        ../../gcc-7.1.0/gcc/cp/pt.c:8128
0x5e8a09 lookup_template_class_1
        ../../gcc-7.1.0/gcc/cp/pt.c:8664
0x5e8a09 lookup_template_class(tree_node*, tree_node*, tree_node*, tree_node*,
int, int)
        ../../gcc-7.1.0/gcc/cp/pt.c:9009
0x6827dd finish_template_type(tree_node*, tree_node*, int)
        ../../gcc-7.1.0/gcc/cp/semantics.c:3151
0x631ff4 cp_parser_template_id
        ../../gcc-7.1.0/gcc/cp/parser.c:15495
0x63214f cp_parser_class_name
        ../../gcc-7.1.0/gcc/cp/parser.c:21953
0x63c737 cp_parser_qualifying_entity
        ../../gcc-7.1.0/gcc/cp/parser.c:6286
0x63c737 cp_parser_nested_name_specifier_opt
        ../../gcc-7.1.0/gcc/cp/parser.c:5972
0x63f452 cp_parser_simple_type_specifier
        ../../gcc-7.1.0/gcc/cp/parser.c:16826
0x62828d cp_parser_type_specifier
        ../../gcc-7.1.0/gcc/cp/parser.c:16499
0x63e6c2 cp_parser_type_specifier_seq
        ../../gcc-7.1.0/gcc/cp/parser.c:20781
0x6355f1 cp_parser_type_id_1
        ../../gcc-7.1.0/gcc/cp/parser.c:20627
0x63bb28 cp_parser_type_id
        ../../gcc-7.1.0/gcc/cp/parser.c:20697
0x63bb28 cp_parser_alias_declaration
        ../../gcc-7.1.0/gcc/cp/parser.c:18593
0x625d3c cp_parser_member_declaration
        ../../gcc-7.1.0/gcc/cp/parser.c:23041
0x62696a cp_parser_member_specification_opt
        ../../gcc-7.1.0/gcc/cp/parser.c:22945
0x62696a cp_parser_class_specifier_1
        ../../gcc-7.1.0/gcc/cp/parser.c:22098
0x6285c1 cp_parser_class_specifier
        ../../gcc-7.1.0/gcc/cp/parser.c:22350
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.

Reply via email to