public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/95562] New: ICE when using noexcept depending on boolean template parameter
@ 2020-06-06 13:19 philipp.koegel at mailbox dot org
  2020-06-09 11:28 ` [Bug c++/95562] [10/11 Regression] ICE when using noexcept depending on boolean template parameter since r10-1280-g78f7607db4c53f8c marxin at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: philipp.koegel at mailbox dot org @ 2020-06-06 13:19 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 95562
           Summary: ICE when using noexcept depending on boolean template
                    parameter
           Product: gcc
           Version: 10.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: philipp.koegel at mailbox dot org
  Target Milestone: ---

* gcc version: 10.1.0

* system type: x86_64-linux-gnu

* configured with: ../gcc-10.1.0/configure
--prefix=/opt/compiler-explorer/gcc-build/staging --build=x86_64-linux-gnu
--host=x86_64-linux-gnu --target=x86_64-linux-gnu --disable-bootstrap
--enable-multiarch --with-abi=m64 --with-multilib-list=m32,m64,mx32
--enable-multilib --enable-clocale=gnu --enable-languages=c,c++,fortran,ada,d
--enable-ld=yes --enable-gold=yes --enable-libstdcxx-debug
--enable-libstdcxx-time=yes --enable-linker-build-id --enable-lto
--enable-plugins --enable-threads=posix
--with-pkgversion=Compiler-Explorer-Build

* The command line that triggers the bug:
g++ -c noexcept_bug.cpp

* Source code that triggers the bug:
template <bool Nothrow>
struct Functions
{
    void (*func)(void*) noexcept(Nothrow);
};

void test()
{
    Functions<true> f{nullptr};
}

* Compiler output:
<source>: In instantiation of 'struct Functions<true>':
<source>:9:21:   required from here
<source>:4:12: internal compiler error: Segmentation fault
    4 |     void (*func)(void*) noexcept(Nothrow);
      |            ^~~~
Please submit a full bug report,
with preprocessed source if appropriate.
See <https://gcc.gnu.org/bugs/> for instructions.


* Additional notes:
g++ version 9.3 has no issues with the above code.

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

* [Bug c++/95562] [10/11 Regression] ICE when using noexcept depending on boolean template parameter since r10-1280-g78f7607db4c53f8c
  2020-06-06 13:19 [Bug c++/95562] New: ICE when using noexcept depending on boolean template parameter philipp.koegel at mailbox dot org
@ 2020-06-09 11:28 ` marxin at gcc dot gnu.org
  2020-06-09 13:21 ` mpolacek at gcc dot gnu.org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: marxin at gcc dot gnu.org @ 2020-06-09 11:28 UTC (permalink / raw)
  To: gcc-bugs

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

Martin Liška <marxin at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to work|                            |9.3.0
      Known to fail|                            |10.1.0, 11.0
             Status|UNCONFIRMED                 |NEW
            Summary|ICE when using noexcept     |[10/11 Regression] ICE when
                   |depending on boolean        |using noexcept depending on
                   |template parameter          |boolean template parameter
                   |                            |since
                   |                            |r10-1280-g78f7607db4c53f8c
   Last reconfirmed|                            |2020-06-09
                 CC|                            |marxin at gcc dot gnu.org,
                   |                            |mpolacek at gcc dot gnu.org
     Ever confirmed|0                           |1

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

* [Bug c++/95562] [10/11 Regression] ICE when using noexcept depending on boolean template parameter since r10-1280-g78f7607db4c53f8c
  2020-06-06 13:19 [Bug c++/95562] New: ICE when using noexcept depending on boolean template parameter philipp.koegel at mailbox dot org
  2020-06-09 11:28 ` [Bug c++/95562] [10/11 Regression] ICE when using noexcept depending on boolean template parameter since r10-1280-g78f7607db4c53f8c marxin at gcc dot gnu.org
@ 2020-06-09 13:21 ` mpolacek at gcc dot gnu.org
  2020-06-09 22:05 ` mpolacek at gcc dot gnu.org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2020-06-09 13:21 UTC (permalink / raw)
  To: gcc-bugs

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

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Assignee|unassigned at gcc dot gnu.org      |mpolacek at gcc dot gnu.org
             Status|NEW                         |ASSIGNED

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

* [Bug c++/95562] [10/11 Regression] ICE when using noexcept depending on boolean template parameter since r10-1280-g78f7607db4c53f8c
  2020-06-06 13:19 [Bug c++/95562] New: ICE when using noexcept depending on boolean template parameter philipp.koegel at mailbox dot org
  2020-06-09 11:28 ` [Bug c++/95562] [10/11 Regression] ICE when using noexcept depending on boolean template parameter since r10-1280-g78f7607db4c53f8c marxin at gcc dot gnu.org
  2020-06-09 13:21 ` mpolacek at gcc dot gnu.org
@ 2020-06-09 22:05 ` mpolacek at gcc dot gnu.org
  2020-06-10 13:36 ` cvs-commit at gcc dot gnu.org
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2020-06-09 22:05 UTC (permalink / raw)
  To: gcc-bugs

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

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |10.2

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

* [Bug c++/95562] [10/11 Regression] ICE when using noexcept depending on boolean template parameter since r10-1280-g78f7607db4c53f8c
  2020-06-06 13:19 [Bug c++/95562] New: ICE when using noexcept depending on boolean template parameter philipp.koegel at mailbox dot org
                   ` (2 preceding siblings ...)
  2020-06-09 22:05 ` mpolacek at gcc dot gnu.org
@ 2020-06-10 13:36 ` cvs-commit at gcc dot gnu.org
  2020-06-10 15:33 ` cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-06-10 13:36 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Marek Polacek <mpolacek@gcc.gnu.org>:

https://gcc.gnu.org/g:4fed5d5dd85e3f5d812d125f692351646a0417cb

commit r11-1176-g4fed5d5dd85e3f5d812d125f692351646a0417cb
Author: Marek Polacek <polacek@redhat.com>
Date:   Tue Jun 9 18:08:45 2020 -0400

    c++: Fix ICE with delayed parsing of noexcept-specifier [PR95562]

    Here we ICE because a DEFERRED_PARSE expression leaked to tsubst_copy.
    We create these expressions for deferred noexcept-specifiers in
    cp_parser_save_noexcept; they are supposed to be re-parsed in
    cp_parser_late_noexcept_specifier.  In this case we never got around
    to re-parsing it because the noexcept-specifier was attached to a
    pointer to a function, not to a function declaration.  But we should
    not have delayed the parsing here in the first place; we already
    avoid delaying the parsing for alias-decls, typedefs, and friend
    function declarations.  (Clang++ also doesn't delay the parsing
    for pointers to function.)

    gcc/cp/ChangeLog:

            PR c++/95562
            * parser.c (cp_parser_direct_declarator): Clear
            CP_PARSER_FLAGS_DELAY_NOEXCEPT if the declarator kind is not
            cdk_id.

    gcc/testsuite/ChangeLog:

            PR c++/95562
            * g++.dg/cpp0x/noexcept60.C: New test.

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

* [Bug c++/95562] [10/11 Regression] ICE when using noexcept depending on boolean template parameter since r10-1280-g78f7607db4c53f8c
  2020-06-06 13:19 [Bug c++/95562] New: ICE when using noexcept depending on boolean template parameter philipp.koegel at mailbox dot org
                   ` (3 preceding siblings ...)
  2020-06-10 13:36 ` cvs-commit at gcc dot gnu.org
@ 2020-06-10 15:33 ` cvs-commit at gcc dot gnu.org
  2020-06-10 15:34 ` mpolacek at gcc dot gnu.org
  2020-06-15 16:19 ` mpolacek at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2020-06-10 15:33 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-10 branch has been updated by Marek Polacek
<mpolacek@gcc.gnu.org>:

https://gcc.gnu.org/g:977a173c196dc5ba5ac2e1b890083beb0451cf60

commit r10-8268-g977a173c196dc5ba5ac2e1b890083beb0451cf60
Author: Marek Polacek <polacek@redhat.com>
Date:   Wed Jun 10 10:49:08 2020 -0400

    c++: Fix ICE with delayed parsing of noexcept-specifier [PR95562]

    Here we ICE because a DEFERRED_PARSE expression leaked to tsubst_copy.
    We create these expressions for deferred noexcept-specifiers in
    cp_parser_save_noexcept; they are supposed to be re-parsed in
    cp_parser_late_noexcept_specifier.  In this case we never got around
    to re-parsing it because the noexcept-specifier was attached to a
    pointer to a function, not to a function declaration.  But we should
    not have delayed the parsing here in the first place; we already
    avoid delaying the parsing for alias-decls, typedefs, and friend
    function declarations.  (Clang++ also doesn't delay the parsing
    for pointers to function.)

    gcc/cp/ChangeLog:

            PR c++/95562
            * parser.c (cp_parser_direct_declarator): Clear
            CP_PARSER_FLAGS_DELAY_NOEXCEPT if the declarator kind is not
            cdk_id.

    gcc/testsuite/ChangeLog:

            PR c++/95562
            * g++.dg/cpp0x/noexcept60.C: New test.

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

* [Bug c++/95562] [10/11 Regression] ICE when using noexcept depending on boolean template parameter since r10-1280-g78f7607db4c53f8c
  2020-06-06 13:19 [Bug c++/95562] New: ICE when using noexcept depending on boolean template parameter philipp.koegel at mailbox dot org
                   ` (4 preceding siblings ...)
  2020-06-10 15:33 ` cvs-commit at gcc dot gnu.org
@ 2020-06-10 15:34 ` mpolacek at gcc dot gnu.org
  2020-06-15 16:19 ` mpolacek at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2020-06-10 15:34 UTC (permalink / raw)
  To: gcc-bugs

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

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

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

--- Comment #3 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Fixed.

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

* [Bug c++/95562] [10/11 Regression] ICE when using noexcept depending on boolean template parameter since r10-1280-g78f7607db4c53f8c
  2020-06-06 13:19 [Bug c++/95562] New: ICE when using noexcept depending on boolean template parameter philipp.koegel at mailbox dot org
                   ` (5 preceding siblings ...)
  2020-06-10 15:34 ` mpolacek at gcc dot gnu.org
@ 2020-06-15 16:19 ` mpolacek at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2020-06-15 16:19 UTC (permalink / raw)
  To: gcc-bugs

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

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |janezz55 at gmail dot com

--- Comment #4 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
*** Bug 95684 has been marked as a duplicate of this bug. ***

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

end of thread, other threads:[~2020-06-15 16:19 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-06-06 13:19 [Bug c++/95562] New: ICE when using noexcept depending on boolean template parameter philipp.koegel at mailbox dot org
2020-06-09 11:28 ` [Bug c++/95562] [10/11 Regression] ICE when using noexcept depending on boolean template parameter since r10-1280-g78f7607db4c53f8c marxin at gcc dot gnu.org
2020-06-09 13:21 ` mpolacek at gcc dot gnu.org
2020-06-09 22:05 ` mpolacek at gcc dot gnu.org
2020-06-10 13:36 ` cvs-commit at gcc dot gnu.org
2020-06-10 15:33 ` cvs-commit at gcc dot gnu.org
2020-06-10 15:34 ` mpolacek at gcc dot gnu.org
2020-06-15 16:19 ` mpolacek 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).