public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "reichelt at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/60389] New: [4.8/4,9 Regression] ICE with inheriting constructors and wrong usage of constexpr
Date: Sun, 02 Mar 2014 21:06:00 -0000	[thread overview]
Message-ID: <bug-60389-4@http.gcc.gnu.org/bugzilla/> (raw)

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


             reply	other threads:[~2014-03-02 21:06 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-02 21:06 reichelt at gcc dot gnu.org [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-60389-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).