public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/58536] New: [c++1y] ICE with auto in constructor
@ 2013-09-25 21:14 reichelt at gcc dot gnu.org
  2013-09-29 17:15 ` [Bug c++/58536] " daniel.kruegler at googlemail dot com
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: reichelt at gcc dot gnu.org @ 2013-09-25 21:14 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 58536
           Summary: [c++1y] ICE with auto in constructor
           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 (valid, I think) code snippet (compiled with "-std=gnu++1y")
triggers an ICE on trunk (4.9.0 20130922):

================
struct A
{
  A(auto);
};

A::A(auto) {}
================

bug.cc:6:10: internal compiler error: in poplevel_class, at
cp/name-lookup.c:2928
 A::A(auto) {}
          ^
0x6f4834 poplevel_class()
        ../../gcc/gcc/cp/name-lookup.c:2928
0x5e9c88 popclass()
        ../../gcc/gcc/cp/class.c:7033
0x5ea10a pop_nested_class()
        ../../gcc/gcc/cp/class.c:7179
0x642cf9 cp_parser_direct_declarator
        ../../gcc/gcc/cp/parser.c:17213
0x642cf9 cp_parser_declarator
        ../../gcc/gcc/cp/parser.c:16690
0x649679 cp_parser_init_declarator
        ../../gcc/gcc/cp/parser.c:16258
0x64a32f cp_parser_simple_declaration
        ../../gcc/gcc/cp/parser.c:10986
0x64c190 cp_parser_block_declaration
        ../../gcc/gcc/cp/parser.c:10867
0x6551ae cp_parser_declaration
        ../../gcc/gcc/cp/parser.c:10764
0x653f0d cp_parser_declaration_seq_opt
        ../../gcc/gcc/cp/parser.c:10650
0x6557e6 cp_parser_translation_unit
        ../../gcc/gcc/cp/parser.c:3939
0x6557e6 c_parse_file()
        ../../gcc/gcc/cp/parser.c:28893
0x768164 c_common_parse_file()
        ../../gcc/gcc/c-family/c-opts.c:1046
Please submit a full bug report, [etc.]


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

* [Bug c++/58536] [c++1y] ICE with auto in constructor
  2013-09-25 21:14 [Bug c++/58536] New: [c++1y] ICE with auto in constructor reichelt at gcc dot gnu.org
@ 2013-09-29 17:15 ` daniel.kruegler at googlemail dot com
  2013-09-29 20:41 ` reichelt at gcc dot gnu.org
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: daniel.kruegler at googlemail dot com @ 2013-09-29 17:15 UTC (permalink / raw)
  To: gcc-bugs

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset="UTF-8", Size: 10526 bytes --]

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

Daniel Krügler <daniel.kruegler at googlemail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |daniel.kruegler@googlemail.
                   |                            |com

--- Comment #1 from Daniel Krügler <daniel.kruegler at googlemail dot com> ---
This code snippet is not valid, not even in C++14. Could you explain why you
think it would be valid?
>From gcc-bugs-return-430756-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sun Sep 29 17:23:18 2013
Return-Path: <gcc-bugs-return-430756-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 13443 invoked by alias); 29 Sep 2013 17:23:18 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 13386 invoked by uid 48); 29 Sep 2013 17:23:14 -0000
From: "daniel.kruegler at googlemail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/58548] [4.9 Regression] [c++1y] ICE with local struct in function with auto parameter
Date: Sun, 29 Sep 2013 17:23:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: c++
X-Bugzilla-Version: 4.9.0
X-Bugzilla-Keywords: ice-on-valid-code, rejects-valid
X-Bugzilla-Severity: normal
X-Bugzilla-Who: daniel.kruegler at googlemail dot com
X-Bugzilla-Status: NEW
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: 4.9.0
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: cc
Message-ID: <bug-58548-4-7aWtJETecV@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-58548-4@http.gcc.gnu.org/bugzilla/>
References: <bug-58548-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2013-09/txt/msg01996.txt.bz2
Content-length: 593

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

Daniel Krügler <daniel.kruegler at googlemail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |daniel.kruegler@googlemail.
                   |                            |com

--- Comment #2 from Daniel Krügler <daniel.kruegler at googlemail dot com> ---
This is invalid code. The auto placeholder in the position of a parameter is
only valid for polymorphic lambda closures.
>From gcc-bugs-return-430757-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sun Sep 29 17:25:04 2013
Return-Path: <gcc-bugs-return-430757-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 15435 invoked by alias); 29 Sep 2013 17:25:03 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 15249 invoked by uid 48); 29 Sep 2013 17:25:01 -0000
From: "daniel.kruegler at googlemail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/58549] [4.9 Regression] [c++1y] ICE with local function in function with auto parameter
Date: Sun, 29 Sep 2013 17:25:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: c++
X-Bugzilla-Version: 4.9.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: daniel.kruegler at googlemail dot com
X-Bugzilla-Status: NEW
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: 4.9.0
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: cc
Message-ID: <bug-58549-4-ev9oKGtCw0@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-58549-4@http.gcc.gnu.org/bugzilla/>
References: <bug-58549-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2013-09/txt/msg01997.txt.bz2
Content-length: 564

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

Daniel Krügler <daniel.kruegler at googlemail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |daniel.kruegler@googlemail.
                   |                            |com

--- Comment #4 from Daniel Krügler <daniel.kruegler at googlemail dot com> ---
This is invalid code (auto as decl-specifier only supported by polymorphic
lambda closures)
>From gcc-bugs-return-430758-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sun Sep 29 17:47:53 2013
Return-Path: <gcc-bugs-return-430758-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 30882 invoked by alias); 29 Sep 2013 17:47:53 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 30853 invoked by uid 48); 29 Sep 2013 17:47:50 -0000
From: "daniel.kruegler at googlemail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/58561] [c++11] ICE using declaration of function with auto in return type
Date: Sun, 29 Sep 2013 17:47:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: changed
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: c++
X-Bugzilla-Version: 4.9.0
X-Bugzilla-Keywords: ice-on-valid-code
X-Bugzilla-Severity: normal
X-Bugzilla-Who: daniel.kruegler at googlemail dot com
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: cc
Message-ID: <bug-58561-4-bnrOmuX2ah@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-58561-4@http.gcc.gnu.org/bugzilla/>
References: <bug-58561-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2013-09/txt/msg01998.txt.bz2
Content-length: 536

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

Daniel Krügler <daniel.kruegler at googlemail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |daniel.kruegler@googlemail.
                   |                            |com

--- Comment #1 from Daniel Krügler <daniel.kruegler at googlemail dot com> ---
The code is invalid under C++11 but should be valid under C++14
>From gcc-bugs-return-430759-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Sun Sep 29 18:05:43 2013
Return-Path: <gcc-bugs-return-430759-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 17073 invoked by alias); 29 Sep 2013 18:05:42 -0000
Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm
Precedence: bulk
List-Id: <gcc-bugs.gcc.gnu.org>
List-Archive: <http://gcc.gnu.org/ml/gcc-bugs/>
List-Post: <mailto:gcc-bugs@gcc.gnu.org>
List-Help: <mailto:gcc-bugs-help@gcc.gnu.org>
Sender: gcc-bugs-owner@gcc.gnu.org
Delivered-To: mailing list gcc-bugs@gcc.gnu.org
Received: (qmail 16999 invoked by uid 48); 29 Sep 2013 18:05:37 -0000
From: "jakub at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/58574] New: [4.9 Regression] Wrong code due to s390x machine reorg pass
Date: Sun, 29 Sep 2013 18:05:00 -0000
X-Bugzilla-Reason: CC
X-Bugzilla-Type: new
X-Bugzilla-Watch-Reason: None
X-Bugzilla-Product: gcc
X-Bugzilla-Component: target
X-Bugzilla-Version: 4.9.0
X-Bugzilla-Keywords: wrong-code
X-Bugzilla-Severity: normal
X-Bugzilla-Who: jakub at gcc dot gnu.org
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Priority: P3
X-Bugzilla-Assigned-To: unassigned at gcc dot gnu.org
X-Bugzilla-Target-Milestone: ---
X-Bugzilla-Flags:
X-Bugzilla-Changed-Fields: bug_id short_desc product version bug_status keywords bug_severity priority component assigned_to reporter cc attachments.created
Message-ID: <bug-58574-4@http.gcc.gnu.org/bugzilla/>
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: 7bit
X-Bugzilla-URL: http://gcc.gnu.org/bugzilla/
Auto-Submitted: auto-generated
MIME-Version: 1.0
X-SW-Source: 2013-09/txt/msg01999.txt.bz2
Content-length: 916

http://gcc.gnu.org/bugzilla/show_bug.cgi?idX574

            Bug ID: 58574
           Summary: [4.9 Regression] Wrong code due to s390x machine reorg
                    pass
           Product: gcc
           Version: 4.9.0
            Status: UNCONFIRMED
          Keywords: wrong-code
          Severity: normal
          Priority: P3
         Component: target
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jakub at gcc dot gnu.org
                CC: krebbel at gcc dot gnu.org

Created attachment 30928
  --> http://gcc.gnu.org/bugzilla/attachment.cgi?id0928&actioníit
scipy.C

The attached testcase is miscompiled with -O2 -march=z10 -m64 on s390x-linux.
foo function starts with:
        cfdbr   %r1,5,%f0
        clijle  %r1,93,.L70
.L68:
        larl    %r5,.L586
but doesn't initialize %r5 at all at label .L70 or after it (that is the
switch), while various cases use %r5.


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

* [Bug c++/58536] [c++1y] ICE with auto in constructor
  2013-09-25 21:14 [Bug c++/58536] New: [c++1y] ICE with auto in constructor reichelt at gcc dot gnu.org
  2013-09-29 17:15 ` [Bug c++/58536] " daniel.kruegler at googlemail dot com
@ 2013-09-29 20:41 ` reichelt at gcc dot gnu.org
  2013-11-12 20:17 ` abutcher at gcc dot gnu.org
  2013-11-13  6:46 ` reichelt at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: reichelt at gcc dot gnu.org @ 2013-09-29 20:41 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Volker Reichelt <reichelt at gcc dot gnu.org> ---
It's a GNU extension as mentioned in the ChangeLog:

2013-09-16  Adam Butcher  <adam@jessamine.co.uk>

    * cp-tree.h (type_uses_auto_or_concept): Declare.
    (is_auto_or_concept): Declare.
    * decl.c (grokdeclarator): Allow 'auto' parameters in lambdas with
    -std=gnu++1y or -std=c++1y or, as a GNU extension, in plain functions.
        [...]


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

* [Bug c++/58536] [c++1y] ICE with auto in constructor
  2013-09-25 21:14 [Bug c++/58536] New: [c++1y] ICE with auto in constructor reichelt at gcc dot gnu.org
  2013-09-29 17:15 ` [Bug c++/58536] " daniel.kruegler at googlemail dot com
  2013-09-29 20:41 ` reichelt at gcc dot gnu.org
@ 2013-11-12 20:17 ` abutcher at gcc dot gnu.org
  2013-11-13  6:46 ` reichelt at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: abutcher at gcc dot gnu.org @ 2013-11-12 20:17 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from abutcher at gcc dot gnu.org ---
Author: abutcher
Date: Tue Nov 12 20:17:33 2013
New Revision: 204714

URL: http://gcc.gnu.org/viewcvs?rev=204714&root=gcc&view=rev
Log:
Refactor implicit function template implementation and fix 58534, 58536, 58548,
58549 and 58637.

gcc/
    * tree.c (grow_tree_vec_stat): New function ...
    * tree.h (grow_tree_vec_stat) (grow_tree_vec): ... and its declaration
    and macro front-end.

gcc/cp/
    PR c++/58534
    PR c++/58536
    PR c++/58548
    PR c++/58549
    PR c++/58637
    * parser.h (struct cp_parser): New members implicit_template_parms,
    implicit_template_scope and auto_is_implicit_function_template_parm_p.
    * parser.c (add_implicit_template_parms): Refactor as ...
    (synthesize_implicit_template_parm): ... this to append a new template
    type parm to the current template parameter list (introducing a new list
    if necessary).  Removed push_deferring_access_checks.
    (finish_fully_implicit_template): Removed pop_deferring_access_checks.
    (cp_parser_new): Initialize new cp_parser members.
    (cp_parser_parameter_declaration_clause): Consider auto as implicit
    template parm when parsing a parameter declaration (unless parsing an
    explicit specialization).
    (cp_parser_parameter_declaration_list): Remove local
    implicit_template_parms counter and reset cp_parser implicit template
    state when complete.
    (cp_parser_lambda_expression): Reset implicit template cp_parser members
    whilst generating lambda class.
    (cp_parser_function_definition_after_declarator): Reset implicit
    template cp_parser members whilst parsing function definition.
    (make_generic_type_name): Respell '<autoN>' as 'auto:N' which works
    better with template diagnostics.
    (cp_parser_simple_type_specifier): Synthesize implicit template parm on
    parsing 'auto' if auto_is_implicit_function_template_parm_p and provide
    diagnostics ...
    * decl.c (grokdeclarator): ... that were previously done here.

gcc/testsuite/g++.dg/
    * cpp1y/pr58534.C: New testcase.
    * cpp1y/pr58536.C: New testcase.
    * cpp1y/pr58548.C: New testcase.
    * cpp1y/pr58549.C: New testcase.
    * cpp1y/pr58637.C: New testcase.

Added:
    trunk/gcc/testsuite/g++.dg/cpp1y/pr58534.C
    trunk/gcc/testsuite/g++.dg/cpp1y/pr58536.C
    trunk/gcc/testsuite/g++.dg/cpp1y/pr58548.C
    trunk/gcc/testsuite/g++.dg/cpp1y/pr58549.C
    trunk/gcc/testsuite/g++.dg/cpp1y/pr58637.C
Modified:
    trunk/gcc/ChangeLog
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/decl.c
    trunk/gcc/cp/parser.c
    trunk/gcc/cp/parser.h
    trunk/gcc/testsuite/ChangeLog
    trunk/gcc/tree.c
    trunk/gcc/tree.h


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

* [Bug c++/58536] [c++1y] ICE with auto in constructor
  2013-09-25 21:14 [Bug c++/58536] New: [c++1y] ICE with auto in constructor reichelt at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2013-11-12 20:17 ` abutcher at gcc dot gnu.org
@ 2013-11-13  6:46 ` reichelt at gcc dot gnu.org
  3 siblings, 0 replies; 5+ messages in thread
From: reichelt at gcc dot gnu.org @ 2013-11-13  6:46 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |FIXED
   Target Milestone|---                         |4.9.0

--- Comment #4 from Volker Reichelt <reichelt at gcc dot gnu.org> ---
Fixed by Adam's patch.


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

end of thread, other threads:[~2013-11-13  6:46 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-09-25 21:14 [Bug c++/58536] New: [c++1y] ICE with auto in constructor reichelt at gcc dot gnu.org
2013-09-29 17:15 ` [Bug c++/58536] " daniel.kruegler at googlemail dot com
2013-09-29 20:41 ` reichelt at gcc dot gnu.org
2013-11-12 20:17 ` abutcher at gcc dot gnu.org
2013-11-13  6:46 ` reichelt 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).