public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/60222] New: [4.8/4.9 Regression] ICE with reference as template parameter
@ 2014-02-16 16:54 reichelt at gcc dot gnu.org
  2014-02-16 16:55 ` [Bug c++/60222] " 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-02-16 16:54 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 60222
           Summary: [4.8/4.9 Regression] ICE with reference as template
                    parameter
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Keywords: ice-on-valid-code
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: reichelt at gcc dot gnu.org
                CC: jason at gcc dot gnu.org

The following valid code snippet triggers an ICE on the 4.8 branch and trunk:

==========================================
template<int&> struct A
{
  template<typename> struct B;

  template<typename T> struct B<T*> {};
};
==========================================

bug.cc:5:35: internal compiler error: tree check: expected record_type or
union_type or qual_union_type, have template_decl in lookup_template_class_1,
at cp/pt.c:7674
   template<typename T> struct B<T*> {};
                                   ^
0xdbfcc4 tree_check_failed(tree_node const*, char const*, int, char const*,
...)
        ../../gcc/gcc/tree.c:9192
0x5bc4b9 tree_check3(tree_node*, char const*, int, char const*, tree_code,
tree_code, tree_code)
        ../../gcc/gcc/tree.h:2749
0x6251fc lookup_template_class_1
        ../../gcc/gcc/cp/pt.c:7674
0x6251fc lookup_template_class(tree_node*, tree_node*, tree_node*, tree_node*,
int, int)
        ../../gcc/gcc/cp/pt.c:7725
0x72dcb2 finish_template_type(tree_node*, tree_node*, int)
        ../../gcc/gcc/cp/semantics.c:2953
0x6c2068 cp_parser_template_id
        ../../gcc/gcc/cp/parser.c:13440
0x6c2388 cp_parser_class_name
        ../../gcc/gcc/cp/parser.c:19074
0x6b3bb9 cp_parser_qualifying_entity
        ../../gcc/gcc/cp/parser.c:5524
0x6b3bb9 cp_parser_nested_name_specifier_opt
        ../../gcc/gcc/cp/parser.c:5249
0x6aa243 cp_parser_class_head
        ../../gcc/gcc/cp/parser.c:19529
0x6aa243 cp_parser_class_specifier_1
        ../../gcc/gcc/cp/parser.c:19155
0x6aa243 cp_parser_class_specifier
        ../../gcc/gcc/cp/parser.c:19437
0x6aa243 cp_parser_type_specifier
        ../../gcc/gcc/cp/parser.c:14302
0x6c2ba0 cp_parser_decl_specifier_seq
        ../../gcc/gcc/cp/parser.c:11547
0x6c8883 cp_parser_single_declaration
        ../../gcc/gcc/cp/parser.c:23039
0x6c8d64 cp_parser_template_declaration_after_export
        ../../gcc/gcc/cp/parser.c:22915
0x6a5f36 cp_parser_member_declaration
        ../../gcc/gcc/cp/parser.c:20049
0x6a9724 cp_parser_member_specification_opt
        ../../gcc/gcc/cp/parser.c:19976
0x6a9724 cp_parser_class_specifier_1
        ../../gcc/gcc/cp/parser.c:19210
0x6a9724 cp_parser_class_specifier
        ../../gcc/gcc/cp/parser.c:19437
Please submit a full bug report, [etc.]

The example compiles fine with GCC 4.8.0 - 4.8.2.

The regression might be fallout from the fix for PR58606.
Jason, would you mind having a look?


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

* [Bug c++/60222] [4.8/4.9 Regression] ICE with reference as template parameter
  2014-02-16 16:54 [Bug c++/60222] New: [4.8/4.9 Regression] ICE with reference as template parameter reichelt at gcc dot gnu.org
@ 2014-02-16 16:55 ` reichelt at gcc dot gnu.org
  2014-02-17 10:00 ` jakub at gcc dot gnu.org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: reichelt at gcc dot gnu.org @ 2014-02-16 16:55 UTC (permalink / raw)
  To: gcc-bugs

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

Volker Reichelt <reichelt at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to work|                            |4.7.0, 4.8.0, 4.8.1, 4.8.2
   Target Milestone|---                         |4.8.3
      Known to fail|                            |4.8.3, 4.9.0


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

* [Bug c++/60222] [4.8/4.9 Regression] ICE with reference as template parameter
  2014-02-16 16:54 [Bug c++/60222] New: [4.8/4.9 Regression] ICE with reference as template parameter reichelt at gcc dot gnu.org
  2014-02-16 16:55 ` [Bug c++/60222] " reichelt at gcc dot gnu.org
@ 2014-02-17 10:00 ` jakub at gcc dot gnu.org
  2014-02-21  4:56 ` [Bug c++/60222] [4.9 " jason at gcc dot gnu.org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: jakub at gcc dot gnu.org @ 2014-02-17 10:00 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P1
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2014-02-17
                 CC|                            |jakub at gcc dot gnu.org
            Version|4.9.0                       |4.8.3
     Ever confirmed|0                           |1

--- Comment #1 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Indeed, started with r207167.


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

* [Bug c++/60222] [4.9 Regression] ICE with reference as template parameter
  2014-02-16 16:54 [Bug c++/60222] New: [4.8/4.9 Regression] ICE with reference as template parameter reichelt at gcc dot gnu.org
  2014-02-16 16:55 ` [Bug c++/60222] " reichelt at gcc dot gnu.org
  2014-02-17 10:00 ` jakub at gcc dot gnu.org
@ 2014-02-21  4:56 ` jason at gcc dot gnu.org
  2014-02-21 14:01 ` jason at gcc dot gnu.org
  2014-02-21 14:30 ` jakub at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: jason at gcc dot gnu.org @ 2014-02-21  4:56 UTC (permalink / raw)
  To: gcc-bugs

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

Jason Merrill <jason at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |jason at gcc dot gnu.org
            Summary|[4.8/4.9 Regression] ICE    |[4.9 Regression] ICE with
                   |with reference as template  |reference as template
                   |parameter                   |parameter
      Known to fail|4.8.3                       |

--- Comment #2 from Jason Merrill <jason at gcc dot gnu.org> ---
Reverted offending patch on 4.8.


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

* [Bug c++/60222] [4.9 Regression] ICE with reference as template parameter
  2014-02-16 16:54 [Bug c++/60222] New: [4.8/4.9 Regression] ICE with reference as template parameter reichelt at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2014-02-21  4:56 ` [Bug c++/60222] [4.9 " jason at gcc dot gnu.org
@ 2014-02-21 14:01 ` jason at gcc dot gnu.org
  2014-02-21 14:30 ` jakub at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: jason at gcc dot gnu.org @ 2014-02-21 14:01 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Jason Merrill <jason at gcc dot gnu.org> ---
Author: jason
Date: Fri Feb 21 14:00:44 2014
New Revision: 207994

URL: http://gcc.gnu.org/viewcvs?rev=207994&root=gcc&view=rev
Log:
    PR c++/60167
    PR c++/60222
    PR c++/58606
    * parser.c (cp_parser_template_argument): Restore dereference.
    * pt.c (template_parm_to_arg): Dereference non-pack expansions too.
    (process_partial_specialization): Handle deref.
    (unify): Likewise.

Added:
    trunk/gcc/testsuite/g++.dg/template/ref7.C
    trunk/gcc/testsuite/g++.dg/template/ref8.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/parser.c
    trunk/gcc/cp/pt.c


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

* [Bug c++/60222] [4.9 Regression] ICE with reference as template parameter
  2014-02-16 16:54 [Bug c++/60222] New: [4.8/4.9 Regression] ICE with reference as template parameter reichelt at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2014-02-21 14:01 ` jason at gcc dot gnu.org
@ 2014-02-21 14:30 ` jakub at gcc dot gnu.org
  4 siblings, 0 replies; 6+ messages in thread
From: jakub at gcc dot gnu.org @ 2014-02-21 14:30 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED

--- Comment #4 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
Fixed.


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

end of thread, other threads:[~2014-02-21 14:30 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-02-16 16:54 [Bug c++/60222] New: [4.8/4.9 Regression] ICE with reference as template parameter reichelt at gcc dot gnu.org
2014-02-16 16:55 ` [Bug c++/60222] " reichelt at gcc dot gnu.org
2014-02-17 10:00 ` jakub at gcc dot gnu.org
2014-02-21  4:56 ` [Bug c++/60222] [4.9 " jason at gcc dot gnu.org
2014-02-21 14:01 ` jason at gcc dot gnu.org
2014-02-21 14:30 ` jakub 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).