public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/58674] New: [4.8/4.9 Regression] [c++11] ICE with template using declaration
@ 2013-10-09 21:15 reichelt at gcc dot gnu.org
  2013-10-10 12:03 ` [Bug c++/58674] " rguenth at gcc dot gnu.org
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: reichelt at gcc dot gnu.org @ 2013-10-09 21:15 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 58674
           Summary: [4.8/4.9 Regression] [c++11] ICE with template using
                    declaration
           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++11") triggers an ICE
since GCC 4.8.0:

====================================
template<int> struct A {};

template<int N> using B = A<N>;

template<typename T> struct C
{
  B<T::i> b;
};

struct X
{
  static const int i;
};

C<X> c;
====================================

bug.cc: In substitution of 'template<int N> using B = A<N> [with int N =
X::i]':
bug.cc:7:11:   required from 'struct C<X>'
bug.cc:15:6:   required from here
bug.cc:7:11: error: the value of 'X::i' is not usable in a constant expression
   B<T::i> b;
           ^
bug.cc:12:20: note: 'X::i' was not initialized with a constant expression
   static const int i;
                    ^
bug.cc:7:11: note: in template argument for type 'int' 
   B<T::i> b;
           ^
bug.cc:7:11: internal compiler error: tree check: expected tree_vec, have
error_mark in get_innermost_template_args, at cp/pt.c:569
0xcec8da tree_check_failed(tree_node const*, char const*, int, char const*,
...)
        ../../gcc/gcc/tree.c:9176
0x587845 tree_check
        ../../gcc/gcc/tree.h:2609
0x587845 get_innermost_template_args(tree_node*, int)
        ../../gcc/gcc/cp/pt.c:569
0x5d0585 instantiate_template_1
        ../../gcc/gcc/cp/pt.c:15042
0x5d0585 instantiate_template(tree_node*, tree_node*, int)
        ../../gcc/gcc/cp/pt.c:15117
0x5ac7bb instantiate_alias_template
        ../../gcc/gcc/cp/pt.c:15147
0x5ac7bb tsubst(tree_node*, tree_node*, int, tree_node*)
        ../../gcc/gcc/cp/pt.c:11312
0x5bca41 tsubst_decl
        ../../gcc/gcc/cp/pt.c:10657
0x5ac634 tsubst(tree_node*, tree_node*, int, tree_node*)
        ../../gcc/gcc/cp/pt.c:11285
0x5d8fc1 instantiate_class_template_1
        ../../gcc/gcc/cp/pt.c:8952
0x5d8fc1 instantiate_class_template(tree_node*)
        ../../gcc/gcc/cp/pt.c:9216
0x66435b complete_type(tree_node*)
        ../../gcc/gcc/cp/typeck.c:132
0x554fa9 start_decl_1(tree_node*, bool)
        ../../gcc/gcc/cp/decl.c:4670
0x57edbd start_decl(cp_declarator const*, cp_decl_specifier_seq*, int,
tree_node*, tree_node*, tree_node**)
        ../../gcc/gcc/cp/decl.c:4633
0x650fd8 cp_parser_init_declarator
        ../../gcc/gcc/cp/parser.c:16453
0x65187f cp_parser_simple_declaration
        ../../gcc/gcc/cp/parser.c:10995
0x653700 cp_parser_block_declaration
        ../../gcc/gcc/cp/parser.c:10876
0x65c73e cp_parser_declaration
        ../../gcc/gcc/cp/parser.c:10773
0x65b4aa cp_parser_declaration_seq_opt
        ../../gcc/gcc/cp/parser.c:10659
0x65cd76 cp_parser_translation_unit
        ../../gcc/gcc/cp/parser.c:3939
Please submit a full bug report, [etc.]


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

* [Bug c++/58674] [4.8/4.9 Regression] [c++11] ICE with template using declaration
  2013-10-09 21:15 [Bug c++/58674] New: [4.8/4.9 Regression] [c++11] ICE with template using declaration reichelt at gcc dot gnu.org
@ 2013-10-10 12:03 ` rguenth at gcc dot gnu.org
  2013-10-16  9:48 ` jakub at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: rguenth at gcc dot gnu.org @ 2013-10-10 12:03 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P5
   Target Milestone|---                         |4.8.2


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

* [Bug c++/58674] [4.8/4.9 Regression] [c++11] ICE with template using declaration
  2013-10-09 21:15 [Bug c++/58674] New: [4.8/4.9 Regression] [c++11] ICE with template using declaration reichelt at gcc dot gnu.org
  2013-10-10 12:03 ` [Bug c++/58674] " rguenth at gcc dot gnu.org
@ 2013-10-16  9:48 ` jakub at gcc dot gnu.org
  2014-01-29 13:49 ` paolo.carlini at oracle dot com
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: jakub at gcc dot gnu.org @ 2013-10-16  9:48 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|4.8.2                       |4.8.3

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
GCC 4.8.2 has been released.


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

* [Bug c++/58674] [4.8/4.9 Regression] [c++11] ICE with template using declaration
  2013-10-09 21:15 [Bug c++/58674] New: [4.8/4.9 Regression] [c++11] ICE with template using declaration reichelt at gcc dot gnu.org
  2013-10-10 12:03 ` [Bug c++/58674] " rguenth at gcc dot gnu.org
  2013-10-16  9:48 ` jakub at gcc dot gnu.org
@ 2014-01-29 13:49 ` paolo.carlini at oracle dot com
  2014-01-29 17:55 ` paolo at gcc dot gnu.org
  2014-01-29 17:56 ` [Bug c++/58674] [4.8 " paolo.carlini at oracle dot com
  4 siblings, 0 replies; 6+ messages in thread
From: paolo.carlini at oracle dot com @ 2014-01-29 13:49 UTC (permalink / raw)
  To: gcc-bugs

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

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |ASSIGNED
   Last reconfirmed|                            |2014-01-29
           Assignee|unassigned at gcc dot gnu.org      |paolo.carlini at oracle dot com
     Ever confirmed|0                           |1

--- Comment #2 from Paolo Carlini <paolo.carlini at oracle dot com> ---
Mine.


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

* [Bug c++/58674] [4.8/4.9 Regression] [c++11] ICE with template using declaration
  2013-10-09 21:15 [Bug c++/58674] New: [4.8/4.9 Regression] [c++11] ICE with template using declaration reichelt at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2014-01-29 13:49 ` paolo.carlini at oracle dot com
@ 2014-01-29 17:55 ` paolo at gcc dot gnu.org
  2014-01-29 17:56 ` [Bug c++/58674] [4.8 " paolo.carlini at oracle dot com
  4 siblings, 0 replies; 6+ messages in thread
From: paolo at gcc dot gnu.org @ 2014-01-29 17:55 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from paolo at gcc dot gnu.org <paolo at gcc dot gnu.org> ---
Author: paolo
Date: Wed Jan 29 17:54:51 2014
New Revision: 207275

URL: http://gcc.gnu.org/viewcvs?rev=207275&root=gcc&view=rev
Log:
/cp
2014-01-29  Paolo Carlini  <paolo.carlini@oracle.com>

    PR c++/58674
    * pt.c (instantiate_template_1): Check for error_mark_node the second
    argument too.

/testsuite
2014-01-29  Paolo Carlini  <paolo.carlini@oracle.com>

    PR c++/58674
    * g++.dg/cpp0x/pr58674.C: New.

Added:
    trunk/gcc/testsuite/g++.dg/cpp0x/pr58674.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/pt.c
    trunk/gcc/testsuite/ChangeLog


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

* [Bug c++/58674] [4.8 Regression] [c++11] ICE with template using declaration
  2013-10-09 21:15 [Bug c++/58674] New: [4.8/4.9 Regression] [c++11] ICE with template using declaration reichelt at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2014-01-29 17:55 ` paolo at gcc dot gnu.org
@ 2014-01-29 17:56 ` paolo.carlini at oracle dot com
  4 siblings, 0 replies; 6+ messages in thread
From: paolo.carlini at oracle dot com @ 2014-01-29 17:56 UTC (permalink / raw)
  To: gcc-bugs

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

Paolo Carlini <paolo.carlini at oracle dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED
   Target Milestone|4.8.3                       |4.9.0
            Summary|[4.8/4.9 Regression]        |[4.8 Regression] [c++11]
                   |[c++11] ICE with template   |ICE with template using
                   |using declaration           |declaration

--- Comment #4 from Paolo Carlini <paolo.carlini at oracle dot com> ---
Fixed for 4.9.0.


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

end of thread, other threads:[~2014-01-29 17:56 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-10-09 21:15 [Bug c++/58674] New: [4.8/4.9 Regression] [c++11] ICE with template using declaration reichelt at gcc dot gnu.org
2013-10-10 12:03 ` [Bug c++/58674] " rguenth at gcc dot gnu.org
2013-10-16  9:48 ` jakub at gcc dot gnu.org
2014-01-29 13:49 ` paolo.carlini at oracle dot com
2014-01-29 17:55 ` paolo at gcc dot gnu.org
2014-01-29 17:56 ` [Bug c++/58674] [4.8 " 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).