public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/99120] New: ICE in -Wshadow in templated member function
@ 2021-02-16 17:28 maeriberii+gcc at gmail dot com
  2021-02-16 17:37 ` [Bug c++/99120] [8/9/10/11 Regression] " mpolacek at gcc dot gnu.org
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: maeriberii+gcc at gmail dot com @ 2021-02-16 17:28 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 99120
           Summary: ICE in -Wshadow in templated member function
           Product: gcc
           Version: 11.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: maeriberii+gcc at gmail dot com
  Target Milestone: ---

Created attachment 50202
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=50202&action=edit
Minimal test case

Minimal test case attached.
Does not trigger ICE when member function is not templated.

Versions of GCC tested: 8.3, 11.1, current master (72d78655a9)

Systems tested on: AArch64 Linux, x86-64 macOS

Complete command line that triggers the bug: g++ -Wshadow a.cpp

Compiler output:

 void ARM64XEmitter::MOVI2RImpl()
/Users/mary/Workspace/dolphin/test/a.cpp:10:7: internal compiler error:
Segmentation fault: 11
   10 |       MOVZ,
      |       ^~~~
Please submit a full bug report,
with preprocessed source if appropriate.
See <https://gcc.gnu.org/bugs/> for instructions.

Appears to be caused by a nullptr dereference at name-lookup.c:3319.

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

* [Bug c++/99120] [8/9/10/11 Regression] ICE in -Wshadow in templated member function
  2021-02-16 17:28 [Bug c++/99120] New: ICE in -Wshadow in templated member function maeriberii+gcc at gmail dot com
@ 2021-02-16 17:37 ` mpolacek at gcc dot gnu.org
  2021-02-16 17:39 ` mpolacek at gcc dot gnu.org
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2021-02-16 17:37 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
                 CC|                            |mpolacek at gcc dot gnu.org
   Target Milestone|---                         |8.5
   Last reconfirmed|                            |2021-02-16
            Summary|ICE in -Wshadow in          |[8/9/10/11 Regression] ICE
                   |templated member function   |in -Wshadow in templated
                   |                            |member function
           Keywords|                            |ice-on-valid-code
     Ever confirmed|0                           |1

--- Comment #1 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Started with r214357.

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

* [Bug c++/99120] [8/9/10/11 Regression] ICE in -Wshadow in templated member function
  2021-02-16 17:28 [Bug c++/99120] New: ICE in -Wshadow in templated member function maeriberii+gcc at gmail dot com
  2021-02-16 17:37 ` [Bug c++/99120] [8/9/10/11 Regression] " mpolacek at gcc dot gnu.org
@ 2021-02-16 17:39 ` mpolacek at gcc dot gnu.org
  2021-02-16 17:40 ` mpolacek at gcc dot gnu.org
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2021-02-16 17:39 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P3                          |P2

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

* [Bug c++/99120] [8/9/10/11 Regression] ICE in -Wshadow in templated member function
  2021-02-16 17:28 [Bug c++/99120] New: ICE in -Wshadow in templated member function maeriberii+gcc at gmail dot com
  2021-02-16 17:37 ` [Bug c++/99120] [8/9/10/11 Regression] " mpolacek at gcc dot gnu.org
  2021-02-16 17:39 ` mpolacek at gcc dot gnu.org
@ 2021-02-16 17:40 ` mpolacek at gcc dot gnu.org
  2021-03-05 22:56 ` 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 @ 2021-02-16 17:40 UTC (permalink / raw)
  To: gcc-bugs

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

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++/99120] [8/9/10/11 Regression] ICE in -Wshadow in templated member function
  2021-02-16 17:28 [Bug c++/99120] New: ICE in -Wshadow in templated member function maeriberii+gcc at gmail dot com
                   ` (2 preceding siblings ...)
  2021-02-16 17:40 ` mpolacek at gcc dot gnu.org
@ 2021-03-05 22:56 ` cvs-commit at gcc dot gnu.org
  2021-03-05 22:57 ` [Bug c++/99120] [8/9/10 " mpolacek at gcc dot gnu.org
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-03-05 22:56 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 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:c2e64c33d9d903f0a52565ad98300feea0ffc580

commit r11-7535-gc2e64c33d9d903f0a52565ad98300feea0ffc580
Author: Marek Polacek <polacek@redhat.com>
Date:   Fri Mar 5 10:41:41 2021 -0500

    c++: ICE with -Wshadow and enumerator in template [PR99120]

    We crash here, because in a template, an enumerator doesn't have
    a type until we've called finish_enum_value_list.  But our -Wshadow
    implementation, check_local_shadow, is called when we pushdecl in
    build_enumerator, which takes place before finish_enum_value_list.

    gcc/cp/ChangeLog:

            PR c++/99120
            * name-lookup.c (check_local_shadow): Check if the type of decl
            is non-null before checking TYPE_PTR*.

    gcc/testsuite/ChangeLog:

            PR c++/99120
            * g++.dg/warn/Wshadow-17.C: New test.

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

* [Bug c++/99120] [8/9/10 Regression] ICE in -Wshadow in templated member function
  2021-02-16 17:28 [Bug c++/99120] New: ICE in -Wshadow in templated member function maeriberii+gcc at gmail dot com
                   ` (3 preceding siblings ...)
  2021-03-05 22:56 ` cvs-commit at gcc dot gnu.org
@ 2021-03-05 22:57 ` mpolacek at gcc dot gnu.org
  2021-04-09 22:38 ` cvs-commit at gcc dot gnu.org
  2021-04-09 22:38 ` mpolacek at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2021-03-05 22:57 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|[8/9/10/11 Regression] ICE  |[8/9/10 Regression] ICE in
                   |in -Wshadow in templated    |-Wshadow in templated
                   |member function             |member function

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

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

* [Bug c++/99120] [8/9/10 Regression] ICE in -Wshadow in templated member function
  2021-02-16 17:28 [Bug c++/99120] New: ICE in -Wshadow in templated member function maeriberii+gcc at gmail dot com
                   ` (4 preceding siblings ...)
  2021-03-05 22:57 ` [Bug c++/99120] [8/9/10 " mpolacek at gcc dot gnu.org
@ 2021-04-09 22:38 ` cvs-commit at gcc dot gnu.org
  2021-04-09 22:38 ` mpolacek at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2021-04-09 22:38 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 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:c7d7c15540d5173f76b570bd457e866f09a17722

commit r10-9686-gc7d7c15540d5173f76b570bd457e866f09a17722
Author: Marek Polacek <polacek@redhat.com>
Date:   Fri Mar 5 10:41:41 2021 -0500

    c++: ICE with -Wshadow and enumerator in template [PR99120]

    We crash here, because in a template, an enumerator doesn't have
    a type until we've called finish_enum_value_list.  But our -Wshadow
    implementation, check_local_shadow, is called when we pushdecl in
    build_enumerator, which takes place before finish_enum_value_list.

    gcc/cp/ChangeLog:

            PR c++/99120
            * name-lookup.c (check_local_shadow): Check if the type of decl
            is non-null before checking TYPE_PTR*.

    gcc/testsuite/ChangeLog:

            PR c++/99120
            * g++.dg/warn/Wshadow-17.C: New test.

    (cherry picked from commit c2e64c33d9d903f0a52565ad98300feea0ffc580)

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

* [Bug c++/99120] [8/9/10 Regression] ICE in -Wshadow in templated member function
  2021-02-16 17:28 [Bug c++/99120] New: ICE in -Wshadow in templated member function maeriberii+gcc at gmail dot com
                   ` (5 preceding siblings ...)
  2021-04-09 22:38 ` cvs-commit at gcc dot gnu.org
@ 2021-04-09 22:38 ` mpolacek at gcc dot gnu.org
  6 siblings, 0 replies; 8+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2021-04-09 22:38 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #5 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Fixed in GCC 10.4 too.

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

end of thread, other threads:[~2021-04-09 22:38 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-16 17:28 [Bug c++/99120] New: ICE in -Wshadow in templated member function maeriberii+gcc at gmail dot com
2021-02-16 17:37 ` [Bug c++/99120] [8/9/10/11 Regression] " mpolacek at gcc dot gnu.org
2021-02-16 17:39 ` mpolacek at gcc dot gnu.org
2021-02-16 17:40 ` mpolacek at gcc dot gnu.org
2021-03-05 22:56 ` cvs-commit at gcc dot gnu.org
2021-03-05 22:57 ` [Bug c++/99120] [8/9/10 " mpolacek at gcc dot gnu.org
2021-04-09 22:38 ` cvs-commit at gcc dot gnu.org
2021-04-09 22:38 ` 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).