public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/69410] friend declarations in local classes
       [not found] <bug-69410-4@http.gcc.gnu.org/bugzilla/>
@ 2022-07-22  1:45 ` creatorsmithmdt at gmail dot com
  2022-07-24 23:39 ` creatorsmithmdt at gmail dot com
                   ` (15 subsequent siblings)
  16 siblings, 0 replies; 17+ messages in thread
From: creatorsmithmdt at gmail dot com @ 2022-07-22  1:45 UTC (permalink / raw)
  To: gcc-bugs

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

Zopolis0 <creatorsmithmdt at gmail dot com> changed:

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

--- Comment #3 from Zopolis0 <creatorsmithmdt at gmail dot com> ---
This issue is still present in gcc-12, with the same error message. 

Testing under godbolt, the code compiles fine under clang 14 and 13, msvc 19.32
and latest, zig 0.9.0 and trunk.

Again testing under godbolt, the code compiles under gcc 4.1.2, but fails on
4.4.7, so it is probably a regression between them.

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

* [Bug c++/69410] friend declarations in local classes
       [not found] <bug-69410-4@http.gcc.gnu.org/bugzilla/>
  2022-07-22  1:45 ` [Bug c++/69410] friend declarations in local classes creatorsmithmdt at gmail dot com
@ 2022-07-24 23:39 ` creatorsmithmdt at gmail dot com
  2022-07-25 10:50 ` [Bug c++/69410] [10/11/12/13 Regression] " redi at gcc dot gnu.org
                   ` (14 subsequent siblings)
  16 siblings, 0 replies; 17+ messages in thread
From: creatorsmithmdt at gmail dot com @ 2022-07-24 23:39 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #4 from Zopolis0 <creatorsmithmdt at gmail dot com> ---
I believe I've bisected the breaking change to
7655e009c8f506454a5cc16bace7282b67513c00

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

* [Bug c++/69410] [10/11/12/13 Regression] friend declarations in local classes
       [not found] <bug-69410-4@http.gcc.gnu.org/bugzilla/>
  2022-07-22  1:45 ` [Bug c++/69410] friend declarations in local classes creatorsmithmdt at gmail dot com
  2022-07-24 23:39 ` creatorsmithmdt at gmail dot com
@ 2022-07-25 10:50 ` redi at gcc dot gnu.org
  2022-07-25 14:55 ` rguenth at gcc dot gnu.org
                   ` (13 subsequent siblings)
  16 siblings, 0 replies; 17+ messages in thread
From: redi at gcc dot gnu.org @ 2022-07-25 10:50 UTC (permalink / raw)
  To: gcc-bugs

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

Jonathan Wakely <redi at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
      Known to work|                            |4.1.2
      Known to fail|                            |4.3.6
            Summary|friend declarations in      |[10/11/12/13 Regression]
                   |local classes               |friend declarations in
                   |                            |local classes
   Last reconfirmed|2021-08-04 00:00:00         |2022-7-25

--- Comment #5 from Jonathan Wakely <redi at gcc dot gnu.org> ---
Yes, that looks likely. It was somewhere between r131726 and r131751 for sure.

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

* [Bug c++/69410] [10/11/12/13 Regression] friend declarations in local classes
       [not found] <bug-69410-4@http.gcc.gnu.org/bugzilla/>
                   ` (2 preceding siblings ...)
  2022-07-25 10:50 ` [Bug c++/69410] [10/11/12/13 Regression] " redi at gcc dot gnu.org
@ 2022-07-25 14:55 ` rguenth at gcc dot gnu.org
  2022-07-26 13:49 ` rguenth at gcc dot gnu.org
                   ` (12 subsequent siblings)
  16 siblings, 0 replies; 17+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-07-25 14:55 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |10.5

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

* [Bug c++/69410] [10/11/12/13 Regression] friend declarations in local classes
       [not found] <bug-69410-4@http.gcc.gnu.org/bugzilla/>
                   ` (3 preceding siblings ...)
  2022-07-25 14:55 ` rguenth at gcc dot gnu.org
@ 2022-07-26 13:49 ` rguenth at gcc dot gnu.org
  2022-08-11  9:08 ` creatorsmithmdt at gmail dot com
                   ` (11 subsequent siblings)
  16 siblings, 0 replies; 17+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-07-26 13:49 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

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

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

* [Bug c++/69410] [10/11/12/13 Regression] friend declarations in local classes
       [not found] <bug-69410-4@http.gcc.gnu.org/bugzilla/>
                   ` (4 preceding siblings ...)
  2022-07-26 13:49 ` rguenth at gcc dot gnu.org
@ 2022-08-11  9:08 ` creatorsmithmdt at gmail dot com
  2022-08-12  7:19 ` creatorsmithmdt at gmail dot com
                   ` (10 subsequent siblings)
  16 siblings, 0 replies; 17+ messages in thread
From: creatorsmithmdt at gmail dot com @ 2022-08-11  9:08 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #6 from Zopolis0 <creatorsmithmdt at gmail dot com> ---
I found success in simply disabling the check at line 3754 of
gcc/cp/name-lookup.cc by setting it to 'if (1 != 1)', which then generated an
ICE at line 2484 of gcc/cp/name-lookup.cc, so I simply disabled the check
there. 

While this worked for my issue, I have not tested the change very thoroughly
and it no doubt causes issues elsewhere. 

I will look into this further.

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

* [Bug c++/69410] [10/11/12/13 Regression] friend declarations in local classes
       [not found] <bug-69410-4@http.gcc.gnu.org/bugzilla/>
                   ` (5 preceding siblings ...)
  2022-08-11  9:08 ` creatorsmithmdt at gmail dot com
@ 2022-08-12  7:19 ` creatorsmithmdt at gmail dot com
  2022-08-24  0:25 ` creatorsmithmdt at gmail dot com
                   ` (9 subsequent siblings)
  16 siblings, 0 replies; 17+ messages in thread
From: creatorsmithmdt at gmail dot com @ 2022-08-12  7:19 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from Zopolis0 <creatorsmithmdt at gmail dot com> ---
With this change, GCC gets most of the way through bootstrapping until failing
on a issue on stage 3 specific to my machine so it seems like this doesn't
break anything.

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

* [Bug c++/69410] [10/11/12/13 Regression] friend declarations in local classes
       [not found] <bug-69410-4@http.gcc.gnu.org/bugzilla/>
                   ` (6 preceding siblings ...)
  2022-08-12  7:19 ` creatorsmithmdt at gmail dot com
@ 2022-08-24  0:25 ` creatorsmithmdt at gmail dot com
  2022-10-21  1:38 ` creatorsmithmdt at gmail dot com
                   ` (8 subsequent siblings)
  16 siblings, 0 replies; 17+ messages in thread
From: creatorsmithmdt at gmail dot com @ 2022-08-24  0:25 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #8 from Zopolis0 <creatorsmithmdt at gmail dot com> ---
Created attachment 53498
  --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=53498&action=edit
Possible patch

This is a more production-ready version of the patch I used, gcc completes a
full no bootstrap build with this.

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

* [Bug c++/69410] [10/11/12/13 Regression] friend declarations in local classes
       [not found] <bug-69410-4@http.gcc.gnu.org/bugzilla/>
                   ` (7 preceding siblings ...)
  2022-08-24  0:25 ` creatorsmithmdt at gmail dot com
@ 2022-10-21  1:38 ` creatorsmithmdt at gmail dot com
  2022-10-21  3:55 ` creatorsmithmdt at gmail dot com
                   ` (7 subsequent siblings)
  16 siblings, 0 replies; 17+ messages in thread
From: creatorsmithmdt at gmail dot com @ 2022-10-21  1:38 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #9 from Zopolis0 <creatorsmithmdt at gmail dot com> ---
While doing unrelated bisecting, I have tracked down the actual source of the
issue to c74e6f7cfd7a741fc0477fe3660eec57581b22c5 with significant confidence. 

It worked fine in gcc11 when the code checked for is_friend, and does not in
gcc12 when it checks for hiding, and thats the only part of that code that
changed between 11 and 12.

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

* [Bug c++/69410] [10/11/12/13 Regression] friend declarations in local classes
       [not found] <bug-69410-4@http.gcc.gnu.org/bugzilla/>
                   ` (8 preceding siblings ...)
  2022-10-21  1:38 ` creatorsmithmdt at gmail dot com
@ 2022-10-21  3:55 ` creatorsmithmdt at gmail dot com
  2023-03-17 13:42 ` jason at gcc dot gnu.org
                   ` (6 subsequent siblings)
  16 siblings, 0 replies; 17+ messages in thread
From: creatorsmithmdt at gmail dot com @ 2022-10-21  3:55 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #10 from Zopolis0 <creatorsmithmdt at gmail dot com> ---
Well, not the whole issue. c74e6f7 broke an additional subset of valid code,
although not the original example posted.

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

* [Bug c++/69410] [10/11/12/13 Regression] friend declarations in local classes
       [not found] <bug-69410-4@http.gcc.gnu.org/bugzilla/>
                   ` (9 preceding siblings ...)
  2022-10-21  3:55 ` creatorsmithmdt at gmail dot com
@ 2023-03-17 13:42 ` jason at gcc dot gnu.org
  2023-03-17 18:44 ` cvs-commit at gcc dot gnu.org
                   ` (5 subsequent siblings)
  16 siblings, 0 replies; 17+ messages in thread
From: jason at gcc dot gnu.org @ 2023-03-17 13:42 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

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

* [Bug c++/69410] [10/11/12/13 Regression] friend declarations in local classes
       [not found] <bug-69410-4@http.gcc.gnu.org/bugzilla/>
                   ` (10 preceding siblings ...)
  2023-03-17 13:42 ` jason at gcc dot gnu.org
@ 2023-03-17 18:44 ` cvs-commit at gcc dot gnu.org
  2023-03-17 18:49 ` [Bug c++/69410] [10/11/12 " jason at gcc dot gnu.org
                   ` (4 subsequent siblings)
  16 siblings, 0 replies; 17+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-03-17 18:44 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #11 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The trunk branch has been updated by Jason Merrill <jason@gcc.gnu.org>:

https://gcc.gnu.org/g:ae7190e345a8d80310835cb83b3b41ef2aeb0d37

commit r13-6740-gae7190e345a8d80310835cb83b3b41ef2aeb0d37
Author: Jason Merrill <jason@redhat.com>
Date:   Fri Mar 17 09:43:48 2023 -0400

    c++: namespace-scoped friend in local class [PR69410]

    do_friend was only considering class-qualified identifiers for the
    qualified-id case, but we also need to skip local scope when there's an
    explicit namespace scope.

            PR c++/69410

    gcc/cp/ChangeLog:

            * friend.cc (do_friend): Handle namespace as scope argument.
            * decl.cc (grokdeclarator): Pass down in_namespace.

    gcc/testsuite/ChangeLog:

            * g++.dg/lookup/friend24.C: New test.

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

* [Bug c++/69410] [10/11/12 Regression] friend declarations in local classes
       [not found] <bug-69410-4@http.gcc.gnu.org/bugzilla/>
                   ` (11 preceding siblings ...)
  2023-03-17 18:44 ` cvs-commit at gcc dot gnu.org
@ 2023-03-17 18:49 ` jason at gcc dot gnu.org
  2023-04-18 20:46 ` cvs-commit at gcc dot gnu.org
                   ` (3 subsequent siblings)
  16 siblings, 0 replies; 17+ messages in thread
From: jason at gcc dot gnu.org @ 2023-03-17 18:49 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #12 from Jason Merrill <jason at gcc dot gnu.org> ---
(In reply to Zopolis0 from comment #8)

Thanks for your work on this bug!

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

* [Bug c++/69410] [10/11/12 Regression] friend declarations in local classes
       [not found] <bug-69410-4@http.gcc.gnu.org/bugzilla/>
                   ` (12 preceding siblings ...)
  2023-03-17 18:49 ` [Bug c++/69410] [10/11/12 " jason at gcc dot gnu.org
@ 2023-04-18 20:46 ` cvs-commit at gcc dot gnu.org
  2023-04-21 20:28 ` [Bug c++/69410] [10/11 " cvs-commit at gcc dot gnu.org
                   ` (2 subsequent siblings)
  16 siblings, 0 replies; 17+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-04-18 20:46 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #13 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-12 branch has been updated by Jason Merrill
<jason@gcc.gnu.org>:

https://gcc.gnu.org/g:615c48b317397c2dc3d6769954d5c399ea882f7a

commit r12-9439-g615c48b317397c2dc3d6769954d5c399ea882f7a
Author: Jason Merrill <jason@redhat.com>
Date:   Fri Mar 17 09:43:48 2023 -0400

    c++: namespace-scoped friend in local class [PR69410]

    do_friend was only considering class-qualified identifiers for the
    qualified-id case, but we also need to skip local scope when there's an
    explicit namespace scope.

            PR c++/69410

    gcc/cp/ChangeLog:

            * friend.cc (do_friend): Handle namespace as scope argument.
            * decl.cc (grokdeclarator): Pass down in_namespace.

    gcc/testsuite/ChangeLog:

            * g++.dg/lookup/friend24.C: New test.

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

* [Bug c++/69410] [10/11 Regression] friend declarations in local classes
       [not found] <bug-69410-4@http.gcc.gnu.org/bugzilla/>
                   ` (13 preceding siblings ...)
  2023-04-18 20:46 ` cvs-commit at gcc dot gnu.org
@ 2023-04-21 20:28 ` cvs-commit at gcc dot gnu.org
  2023-04-22  0:22 ` cvs-commit at gcc dot gnu.org
  2023-07-07  7:29 ` rguenth at gcc dot gnu.org
  16 siblings, 0 replies; 17+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-04-21 20:28 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #14 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-10 branch has been updated by Jason Merrill
<jason@gcc.gnu.org>:

https://gcc.gnu.org/g:fc03893d2fead133ed336511ac00d75c10c5a88d

commit r10-11304-gfc03893d2fead133ed336511ac00d75c10c5a88d
Author: Jason Merrill <jason@redhat.com>
Date:   Fri Mar 17 09:43:48 2023 -0400

    c++: namespace-scoped friend in local class [PR69410]

    do_friend was only considering class-qualified identifiers for the
    qualified-id case, but we also need to skip local scope when there's an
    explicit namespace scope.

            PR c++/69410

    gcc/cp/ChangeLog:

            * friend.c (do_friend): Handle namespace as scope argument.
            * decl.c (grokdeclarator): Pass down in_namespace.

    gcc/testsuite/ChangeLog:

            * g++.dg/lookup/friend24.C: New test.

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

* [Bug c++/69410] [10/11 Regression] friend declarations in local classes
       [not found] <bug-69410-4@http.gcc.gnu.org/bugzilla/>
                   ` (14 preceding siblings ...)
  2023-04-21 20:28 ` [Bug c++/69410] [10/11 " cvs-commit at gcc dot gnu.org
@ 2023-04-22  0:22 ` cvs-commit at gcc dot gnu.org
  2023-07-07  7:29 ` rguenth at gcc dot gnu.org
  16 siblings, 0 replies; 17+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-04-22  0:22 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #15 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-11 branch has been updated by Jason Merrill
<jason@gcc.gnu.org>:

https://gcc.gnu.org/g:fbf72bbaed4477f1e3881a8d25977dd3890015eb

commit r11-10644-gfbf72bbaed4477f1e3881a8d25977dd3890015eb
Author: Jason Merrill <jason@redhat.com>
Date:   Fri Mar 17 09:43:48 2023 -0400

    c++: namespace-scoped friend in local class [PR69410]

    do_friend was only considering class-qualified identifiers for the
    qualified-id case, but we also need to skip local scope when there's an
    explicit namespace scope.

            PR c++/69410

    gcc/cp/ChangeLog:

            * friend.c (do_friend): Handle namespace as scope argument.
            * decl.c (grokdeclarator): Pass down in_namespace.

    gcc/testsuite/ChangeLog:

            * g++.dg/lookup/friend24.C: New test.

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

* [Bug c++/69410] [10/11 Regression] friend declarations in local classes
       [not found] <bug-69410-4@http.gcc.gnu.org/bugzilla/>
                   ` (15 preceding siblings ...)
  2023-04-22  0:22 ` cvs-commit at gcc dot gnu.org
@ 2023-07-07  7:29 ` rguenth at gcc dot gnu.org
  16 siblings, 0 replies; 17+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-07-07  7:29 UTC (permalink / raw)
  To: gcc-bugs

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

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|10.5                        |11.4
      Known to work|                            |11.4.0
      Known to fail|                            |10.5.0, 11.3.0
             Status|ASSIGNED                    |RESOLVED
         Resolution|---                         |FIXED

--- Comment #16 from Richard Biener <rguenth at gcc dot gnu.org> ---
Fixed in GCC 11.

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

end of thread, other threads:[~2023-07-07  7:29 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <bug-69410-4@http.gcc.gnu.org/bugzilla/>
2022-07-22  1:45 ` [Bug c++/69410] friend declarations in local classes creatorsmithmdt at gmail dot com
2022-07-24 23:39 ` creatorsmithmdt at gmail dot com
2022-07-25 10:50 ` [Bug c++/69410] [10/11/12/13 Regression] " redi at gcc dot gnu.org
2022-07-25 14:55 ` rguenth at gcc dot gnu.org
2022-07-26 13:49 ` rguenth at gcc dot gnu.org
2022-08-11  9:08 ` creatorsmithmdt at gmail dot com
2022-08-12  7:19 ` creatorsmithmdt at gmail dot com
2022-08-24  0:25 ` creatorsmithmdt at gmail dot com
2022-10-21  1:38 ` creatorsmithmdt at gmail dot com
2022-10-21  3:55 ` creatorsmithmdt at gmail dot com
2023-03-17 13:42 ` jason at gcc dot gnu.org
2023-03-17 18:44 ` cvs-commit at gcc dot gnu.org
2023-03-17 18:49 ` [Bug c++/69410] [10/11/12 " jason at gcc dot gnu.org
2023-04-18 20:46 ` cvs-commit at gcc dot gnu.org
2023-04-21 20:28 ` [Bug c++/69410] [10/11 " cvs-commit at gcc dot gnu.org
2023-04-22  0:22 ` cvs-commit at gcc dot gnu.org
2023-07-07  7:29 ` rguenth 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).