public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/60389] New: [4.8/4,9 Regression] ICE with inheriting constructors and wrong usage of constexpr
@ 2014-03-02 21:06 reichelt at gcc dot gnu.org
  2014-03-02 21:06 ` [Bug c++/60389] [4.8/4,9 Regression] [c++11] " reichelt at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: reichelt at gcc dot gnu.org @ 2014-03-02 21:06 UTC (permalink / raw)
  To: gcc-bugs

http://gcc.gnu.org/bugzilla/show_bug.cgi?id=60389

            Bug ID: 60389
           Summary: [4.8/4,9 Regression] ICE with inheriting constructors
                    and wrong usage of constexpr
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Keywords: ice-on-invalid-code
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: reichelt at gcc dot gnu.org

The following invalid code snippet (compiled with "-std=c++11") triggers
an ICE since GCC 4.8.0:

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

struct B : A
{
  using A::A;
};

constexpr B b;
===========================================

bug.cc:11:13: error: the type 'const B' of constexpr variable 'b' is not
literal
 constexpr B b;
             ^
bug.cc:6:8: note: 'B' is not literal because:
 struct B : A
        ^
bug.cc:6:8: note:   'B' is not an aggregate, does not have a trivial default
constructor, and has no constexpr constructor that is not a copy or move
constructor
bug.cc:8:12: note: 'template<class ... T> B::B(T ...)' is not usable as a
constexpr function because:
   using A::A;
            ^
bug.cc:8:12: internal compiler error: tree check: expected function_decl, have
template_decl in is_valid_constexpr_fn, at cp/semantics.c:7434
0xdc0f54 tree_check_failed(tree_node const*, char const*, int, char const*,
...)
        ../../gcc/gcc/tree.c:9192
0x73e7f7 tree_check
        ../../gcc/gcc/tree.h:2709
0x73e7f7 is_valid_constexpr_fn
        ../../gcc/gcc/cp/semantics.c:7434
0x742fd0 explain_invalid_constexpr_fn(tree_node*)
        ../../gcc/gcc/cp/semantics.c:8019
0x73f4f2 ensure_literal_type_for_constexpr_object(tree_node*)
        ../../gcc/gcc/cp/semantics.c:7374
0x5dcddf cp_finish_decl(tree_node*, tree_node*, bool, tree_node*, int)
        ../../gcc/gcc/cp/decl.c:6206
0x6ce58d cp_parser_init_declarator
        ../../gcc/gcc/cp/parser.c:16819
0x6cfd49 cp_parser_simple_declaration
        ../../gcc/gcc/cp/parser.c:11205
0x6b3003 cp_parser_block_declaration
        ../../gcc/gcc/cp/parser.c:11086
0x6da2d2 cp_parser_declaration
        ../../gcc/gcc/cp/parser.c:10983
0x6d8fc8 cp_parser_declaration_seq_opt
        ../../gcc/gcc/cp/parser.c:10869
0x6da87a cp_parser_translation_unit
        ../../gcc/gcc/cp/parser.c:4014
0x6da87a c_parse_file()
        ../../gcc/gcc/cp/parser.c:31590
0x7fa103 c_common_parse_file()
        ../../gcc/gcc/c-family/c-opts.c:1060
Please submit a full bug report, [etc.]


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

end of thread, other threads:[~2014-03-11 17:36 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-03-02 21:06 [Bug c++/60389] New: [4.8/4,9 Regression] ICE with inheriting constructors and wrong usage of constexpr reichelt at gcc dot gnu.org
2014-03-02 21:06 ` [Bug c++/60389] [4.8/4,9 Regression] [c++11] " reichelt at gcc dot gnu.org
2014-03-03  9:01 ` [Bug c++/60389] [4.8/4.9 " rguenth at gcc dot gnu.org
2014-03-04 11:05 ` paolo.carlini at oracle dot com
2014-03-11 17:35 ` paolo at gcc dot gnu.org
2014-03-11 17:36 ` paolo.carlini at oracle dot com

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).