public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/94592] New: ICE in non-type template parameter with constexpr constructor
@ 2020-04-14 10:44 pacoarjonilla at yahoo dot es
  2020-04-14 10:49 ` [Bug c++/94592] " rguenth at gcc dot gnu.org
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: pacoarjonilla at yahoo dot es @ 2020-04-14 10:44 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 94592
           Summary: ICE in non-type template parameter with constexpr
                    constructor
           Product: gcc
           Version: 10.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: pacoarjonilla at yahoo dot es
  Target Milestone: ---

GCC10 --std=c++20

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

struct A {
    constexpr A() {}
};

template <A> struct B { };

template<typename> void bar () {
    B<{}> var;
}

void fu() {
    bar<int>();
}

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>


meta.cc: In instantiation of ‘struct B<((A)<brace-enclosed initializer
list>())>’:
meta.cc:37:11:   required from ‘void bar() [with <template-parameter-1-1> =
int]’
meta.cc:41:14:   required from here
meta.cc:34:23: internal compiler error: unexpected expression
‘(A)<brace-enclosed initializer list>()’ of kind implicit_conv_expr
   34 | template <A> struct B { };
      |                       ^
0x8c3f37 cxx_eval_constant_expression
        /home/paco/git/gcc/gcc/cp/constexpr.c:6301
0x8c4366 cxx_eval_outermost_constant_expr
        /home/paco/git/gcc/gcc/cp/constexpr.c:6502
0x8c8654 maybe_constant_value(tree_node*, tree_node*, bool, bool)
        /home/paco/git/gcc/gcc/cp/constexpr.c:6774
0x9f860c convert_nontype_argument
        /home/paco/git/gcc/gcc/cp/pt.c:7099
0x9f860c convert_template_argument
        /home/paco/git/gcc/gcc/cp/pt.c:8331
0x9f9893 coerce_template_parms
        /home/paco/git/gcc/gcc/cp/pt.c:8810
0xa1bf61 lookup_template_class_1
        /home/paco/git/gcc/gcc/cp/pt.c:9648
0xa1e363 lookup_template_class(tree_node*, tree_node*, tree_node*, tree_node*,
int, int)
        /home/paco/git/gcc/gcc/cp/pt.c:10020
0xa1e363 tsubst_aggr_type
        /home/paco/git/gcc/gcc/cp/pt.c:13301
0xa0e44f tsubst_decl
        /home/paco/git/gcc/gcc/cp/pt.c:14294
0xa3079d instantiate_class_template_1
        /home/paco/git/gcc/gcc/cp/pt.c:11748
0xa31ab2 instantiate_class_template(tree_node*)
        /home/paco/git/gcc/gcc/cp/pt.c:12007
0xa77ff9 complete_type(tree_node*)
        /home/paco/git/gcc/gcc/cp/typeck.c:137
0xa0e70b tsubst_decl
        /home/paco/git/gcc/gcc/cp/pt.c:14415
0xa063e0 tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
        /home/paco/git/gcc/gcc/cp/pt.c:17768
0xa0449e tsubst_expr(tree_node*, tree_node*, int, tree_node*, bool)
        /home/paco/git/gcc/gcc/cp/pt.c:17985
0xa01733 instantiate_decl(tree_node*, bool, bool)
        /home/paco/git/gcc/gcc/cp/pt.c:25509
0xa31d7b instantiate_pending_templates(int)
        /home/paco/git/gcc/gcc/cp/pt.c:25625
0x93b9f3 c_parse_final_cleanups()
        /home/paco/git/gcc/gcc/cp/decl2.c:4874
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.

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2020-04-20 23:55 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-14 10:44 [Bug c++/94592] New: ICE in non-type template parameter with constexpr constructor pacoarjonilla at yahoo dot es
2020-04-14 10:49 ` [Bug c++/94592] " rguenth at gcc dot gnu.org
2020-04-14 11:16 ` marxin at gcc dot gnu.org
2020-04-14 11:41 ` pacoarjonilla at yahoo dot es
2020-04-14 14:32 ` mpolacek at gcc dot gnu.org
2020-04-14 16:29 ` mpolacek at gcc dot gnu.org
2020-04-14 16:38 ` pacoarjonilla at yahoo dot es
2020-04-15 17:57 ` [Bug c++/94592] [10 Regression] " mpolacek at gcc dot gnu.org
2020-04-18  3:43 ` mpolacek at gcc dot gnu.org
2020-04-20 13:57 ` rguenth at gcc dot gnu.org
2020-04-20 23:55 ` cvs-commit at gcc dot gnu.org
2020-04-20 23:55 ` mpolacek at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).