public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/67845] New: ICE on invalid use of const qualifier on x86_64-linux-gnu
@ 2015-10-05  3:10 su at cs dot ucdavis.edu
  2015-10-22 15:56 ` [Bug c++/67845] ICE on invalid use of const qualifier on x86_64-linux-gnu in merge_types, at cp/typeck.c:854 paolo.carlini at oracle dot com
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: su at cs dot ucdavis.edu @ 2015-10-05  3:10 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67845

            Bug ID: 67845
           Summary: ICE on invalid use of const qualifier on
                    x86_64-linux-gnu
           Product: gcc
           Version: 6.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: su at cs dot ucdavis.edu
  Target Milestone: ---

The following code causes an ICE when compiled with the current gcc trunk on
x86_64-linux-gnu.  

This is a regression from 5.2.x. 


$ g++-trunk -v
Using built-in specs.
COLLECT_GCC=g++-trunk
COLLECT_LTO_WRAPPER=/usr/local/gcc-trunk/libexec/gcc/x86_64-pc-linux-gnu/6.0.0/lto-wrapper
Target: x86_64-pc-linux-gnu
Configured with: ../gcc-trunk/configure --prefix=/usr/local/gcc-trunk
--enable-languages=c,c++ --disable-werror --enable-multilib
Thread model: posix
gcc version 6.0.0 20151004 (experimental) [trunk revision 228457] (GCC) 
$ 
$ g++-5.2 -c small.cc
small.cc:3:3: error: non-member function ‘void foo()’ cannot have cv-qualifier
 F foo;
   ^
small.cc:4: confused by earlier errors, bailing out
$ 
$ 
$ g++-trunk -c small.cc
small.cc:3:3: error: non-member function ‘void foo()’ cannot have cv-qualifier
 F foo;
   ^
small.cc:4:11: internal compiler error: in merge_types, at cp/typeck.c:854
 void foo ();
           ^
0x71e224 merge_types(tree_node*, tree_node*)
        ../../gcc-trunk/gcc/cp/typeck.c:854
0x5f8f72 duplicate_decls(tree_node*, tree_node*, bool)
        ../../gcc-trunk/gcc/cp/decl.c:2029
0x7bd77e pushdecl_maybe_friend_1
        ../../gcc-trunk/gcc/cp/name-lookup.c:812
0x7bd77e pushdecl_maybe_friend(tree_node*, bool)
        ../../gcc-trunk/gcc/cp/name-lookup.c:1305
0x6134e3 start_decl(cp_declarator const*, cp_decl_specifier_seq*, int,
tree_node*, tree_node*, tree_node**)
        ../../gcc-trunk/gcc/cp/decl.c:4913
0x7016b2 cp_parser_init_declarator
        ../../gcc-trunk/gcc/cp/parser.c:18042
0x702282 cp_parser_simple_declaration
        ../../gcc-trunk/gcc/cp/parser.c:11956
0x6fda24 cp_parser_block_declaration
        ../../gcc-trunk/gcc/cp/parser.c:11837
0x70bfd7 cp_parser_declaration
        ../../gcc-trunk/gcc/cp/parser.c:11734
0x70a53a cp_parser_declaration_seq_opt
        ../../gcc-trunk/gcc/cp/parser.c:11613
0x70a880 cp_parser_translation_unit
        ../../gcc-trunk/gcc/cp/parser.c:4169
0x70a880 c_parse_file()
        ../../gcc-trunk/gcc/cp/parser.c:34599
0x857542 c_common_parse_file()
        ../../gcc-trunk/gcc/c-family/c-opts.c:1064
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <http://gcc.gnu.org/bugs.html> for instructions.
$ 


------------------------------


typedef void F () const;

F foo;
void foo ();
>From gcc-bugs-return-498739-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org Mon Oct 05 03:43:07 2015
Return-Path: <gcc-bugs-return-498739-listarch-gcc-bugs=gcc.gnu.org@gcc.gnu.org>
Delivered-To: listarch-gcc-bugs@gcc.gnu.org
Received: (qmail 107427 invoked by alias); 5 Oct 2015 03:43:07 -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 107373 invoked by uid 48); 5 Oct 2015 03:43:03 -0000
From: "pinskia at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/67845] ICE on invalid use of const qualifier on x86_64-linux-gnu in merge_types, at cp/typeck.c:854
Date: Mon, 05 Oct 2015 03:43: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: 6.0
X-Bugzilla-Keywords:
X-Bugzilla-Severity: normal
X-Bugzilla-Who: pinskia at gcc dot gnu.org
X-Bugzilla-Status: UNCONFIRMED
X-Bugzilla-Resolution:
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:
Message-ID: <bug-67845-4-Yh3E08VSJD@http.gcc.gnu.org/bugzilla/>
In-Reply-To: <bug-67845-4@http.gcc.gnu.org/bugzilla/>
References: <bug-67845-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: 2015-10/txt/msg00294.txt.bz2
Content-length: 387

https://gcc.gnu.org/bugzilla/show_bug.cgi?idg845

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
>This is a regression from 5.2.x.

No it is not because 5.2 does:
> small.cc:4: confused by earlier errors, bailing out

Which is just saying there was an ICE after an error had been produced :).

--enable-checking disables that and the trunk defaults to that mode.


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

* [Bug c++/67845] ICE on invalid use of const qualifier on x86_64-linux-gnu in merge_types, at cp/typeck.c:854
  2015-10-05  3:10 [Bug c++/67845] New: ICE on invalid use of const qualifier on x86_64-linux-gnu su at cs dot ucdavis.edu
@ 2015-10-22 15:56 ` paolo.carlini at oracle dot com
  2015-10-29 10:22 ` paolo.carlini at oracle dot com
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: paolo.carlini at oracle dot com @ 2015-10-22 15:56 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67845

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |ice-on-invalid-code
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2015-10-22
     Ever confirmed|0                           |1


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

* [Bug c++/67845] ICE on invalid use of const qualifier on x86_64-linux-gnu in merge_types, at cp/typeck.c:854
  2015-10-05  3:10 [Bug c++/67845] New: ICE on invalid use of const qualifier on x86_64-linux-gnu su at cs dot ucdavis.edu
  2015-10-22 15:56 ` [Bug c++/67845] ICE on invalid use of const qualifier on x86_64-linux-gnu in merge_types, at cp/typeck.c:854 paolo.carlini at oracle dot com
@ 2015-10-29 10:22 ` paolo.carlini at oracle dot com
  2015-10-29 13:13 ` paolo at gcc dot gnu.org
  2015-10-29 13:14 ` paolo.carlini at oracle dot com
  3 siblings, 0 replies; 5+ messages in thread
From: paolo.carlini at oracle dot com @ 2015-10-29 10:22 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67845

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
           Assignee|unassigned at gcc dot gnu.org      |paolo.carlini at oracle dot com
   Target Milestone|---                         |6.0

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


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

* [Bug c++/67845] ICE on invalid use of const qualifier on x86_64-linux-gnu in merge_types, at cp/typeck.c:854
  2015-10-05  3:10 [Bug c++/67845] New: ICE on invalid use of const qualifier on x86_64-linux-gnu su at cs dot ucdavis.edu
  2015-10-22 15:56 ` [Bug c++/67845] ICE on invalid use of const qualifier on x86_64-linux-gnu in merge_types, at cp/typeck.c:854 paolo.carlini at oracle dot com
  2015-10-29 10:22 ` paolo.carlini at oracle dot com
@ 2015-10-29 13:13 ` paolo at gcc dot gnu.org
  2015-10-29 13:14 ` paolo.carlini at oracle dot com
  3 siblings, 0 replies; 5+ messages in thread
From: paolo at gcc dot gnu.org @ 2015-10-29 13:13 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67845

--- Comment #3 from paolo at gcc dot gnu.org <paolo at gcc dot gnu.org> ---
Author: paolo
Date: Thu Oct 29 13:12:45 2015
New Revision: 229523

URL: https://gcc.gnu.org/viewcvs?rev=229523&root=gcc&view=rev
Log:
/cp
2015-10-29  Paolo Carlini  <paolo.carlini@oracle.com>

        PR c++/67845
        * decl.c (grokfndecl): In case of erroneous cv-qualified non-member
        functions consistently reset TREE_TYPE (decl) too.

/testsuite
2015-10-29  Paolo Carlini  <paolo.carlini@oracle.com>

        PR c++/67845
        * g++.dg/other/cv_func4.C: New.

Added:
    trunk/gcc/testsuite/g++.dg/other/cv_func4.C
Modified:
    trunk/gcc/cp/ChangeLog
    trunk/gcc/cp/decl.c
    trunk/gcc/testsuite/ChangeLog


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

* [Bug c++/67845] ICE on invalid use of const qualifier on x86_64-linux-gnu in merge_types, at cp/typeck.c:854
  2015-10-05  3:10 [Bug c++/67845] New: ICE on invalid use of const qualifier on x86_64-linux-gnu su at cs dot ucdavis.edu
                   ` (2 preceding siblings ...)
  2015-10-29 13:13 ` paolo at gcc dot gnu.org
@ 2015-10-29 13:14 ` paolo.carlini at oracle dot com
  3 siblings, 0 replies; 5+ messages in thread
From: paolo.carlini at oracle dot com @ 2015-10-29 13:14 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=67845

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED
           Assignee|paolo.carlini at oracle dot com    |unassigned at gcc dot gnu.org

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


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

end of thread, other threads:[~2015-10-29 13:14 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-05  3:10 [Bug c++/67845] New: ICE on invalid use of const qualifier on x86_64-linux-gnu su at cs dot ucdavis.edu
2015-10-22 15:56 ` [Bug c++/67845] ICE on invalid use of const qualifier on x86_64-linux-gnu in merge_types, at cp/typeck.c:854 paolo.carlini at oracle dot com
2015-10-29 10:22 ` paolo.carlini at oracle dot com
2015-10-29 13:13 ` paolo at gcc dot gnu.org
2015-10-29 13:14 ` 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).