public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/58511] New: [c++0x] ICE using static const member variable in constexpr
@ 2013-09-23 19:53 reichelt at gcc dot gnu.org
  2013-09-24 16:52 ` [Bug c++/58511] [4.9 Regression] " mpolacek at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: reichelt at gcc dot gnu.org @ 2013-09-23 19:53 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 58511
           Summary: [c++0x] ICE using static const member variable in
                    constexpr
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          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++0x") triggers an ICE
since GCC 4.8.0 (when inheriting constructors were introduced):

====================================
struct A
{
  constexpr A(int, int = i) {}
  static const int i;
};

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

constexpr B b(0);
====================================

bug.cc:12:16: error: 'constexpr B::B(int)' called in a constant expression
 constexpr B b(0);
                ^
bug.cc:9:12: note: 'constexpr B::B(int)' is not usable as a constexpr function
because:
   using A::A;
            ^
bug.cc:9:12: internal compiler error: in synthesized_method_walk, at
cp/method.c:1218
0x675548 synthesized_method_walk
        ../../gcc-4.8.0/gcc/cp/method.c:1217
0x679692 explain_implicit_non_constexpr(tree_node*)
        ../../gcc-4.8.0/gcc/cp/method.c:1481
0x69f68b explain_invalid_constexpr_fn(tree_node*)
        ../../gcc-4.8.0/gcc/cp/semantics.c:6379
0x69faf6 cxx_eval_call_expression
        ../../gcc-4.8.0/gcc/cp/semantics.c:6751
0x6a1142 cxx_eval_constant_expression
        ../../gcc-4.8.0/gcc/cp/semantics.c:7814
0x6a14a9 cxx_eval_constant_expression
        ../../gcc-4.8.0/gcc/cp/semantics.c:7835
0x6a4426 cxx_eval_outermost_constant_expr
        ../../gcc-4.8.0/gcc/cp/semantics.c:8115
0x5bd69d store_init_value(tree_node*, tree_node*, vec<tree_node*, va_gc,
vl_embed>**, int)
        ../../gcc-4.8.0/gcc/cp/typeck2.c:722
0x540b40 check_initializer
        ../../gcc-4.8.0/gcc/cp/decl.c:5711
0x5537b5 cp_finish_decl(tree_node*, tree_node*, bool, tree_node*, int)
        ../../gcc-4.8.0/gcc/cp/decl.c:6328
0x62afeb cp_parser_init_declarator
        ../../gcc-4.8.0/gcc/cp/parser.c:16038
0x62b85e cp_parser_simple_declaration
        ../../gcc-4.8.0/gcc/cp/parser.c:10567
0x62d630 cp_parser_block_declaration
        ../../gcc-4.8.0/gcc/cp/parser.c:10448
0x6361fb cp_parser_declaration
        ../../gcc-4.8.0/gcc/cp/parser.c:10345
0x634ecd cp_parser_declaration_seq_opt
        ../../gcc-4.8.0/gcc/cp/parser.c:10231
0x636772 cp_parser_translation_unit
        ../../gcc-4.8.0/gcc/cp/parser.c:3807
0x636772 c_parse_file()
        ../../gcc-4.8.0/gcc/cp/parser.c:28186
0x73e504 c_common_parse_file()
        ../../gcc-4.8.0/gcc/c-family/c-opts.c:1046
Please submit a full bug report, [etc.]


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

end of thread, other threads:[~2014-07-14  5:26 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-09-23 19:53 [Bug c++/58511] New: [c++0x] ICE using static const member variable in constexpr reichelt at gcc dot gnu.org
2013-09-24 16:52 ` [Bug c++/58511] [4.9 Regression] " mpolacek at gcc dot gnu.org
2013-11-05 14:30 ` [Bug c++/58511] [4.8/4.9 Regression] [c++11] " rguenth at gcc dot gnu.org
2014-03-04 11:04 ` paolo.carlini at oracle dot com
2014-03-04 11:05 ` paolo.carlini at oracle dot com
2014-04-22 11:36 ` [Bug c++/58511] [4.8/4.9/4.10 " jakub at gcc dot gnu.org
2014-07-14  5:26 ` jason at gcc dot gnu.org
2014-07-14  5:26 ` jason 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).