public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/98662] New: checking ICE in friend_accessible_p since r227023
@ 2021-01-13 20:40 ppalka at gcc dot gnu.org
  2021-01-14  8:22 ` [Bug c++/98662] " marxin at gcc dot gnu.org
                   ` (10 more replies)
  0 siblings, 11 replies; 12+ messages in thread
From: ppalka at gcc dot gnu.org @ 2021-01-13 20:40 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 98662
           Summary: checking ICE in friend_accessible_p since r227023
           Product: gcc
           Version: 10.2.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: ppalka at gcc dot gnu.org
  Target Milestone: ---

$ cat testcase.C
template <class T>
struct S {
  friend int f(S) {
    S<const T> y;
    (void) y.i;
    (void) y.j;
    return 0;
  }
private:
  int i;
protected:
  int j;
};

extern S<int> s;
int a = f(s);

$ g++ testcase.C
testcase.C: In instantiation of ‘int f(S<int>)’:
testcase.C:18:12:   required from here              
testcase.C:8:14: internal compiler error: in friend_accessible_p, at
cp/search.c:732
    8 |     (void) y.j; // { dg-error "protected" }               
      |            ~~^                                                          
0x6c4b3c friend_accessible_p                                                    
        /home/patrick/gcc/gcc/cp/search.c:732
0xad439d friend_accessible_p                                                    
        /home/patrick/gcc/gcc/cp/search.c:724
0xad4662 dfs_accessible_post                                                    
        /home/patrick/gcc/gcc/cp/search.c:792
0xad2762 dfs_walk_once_accessible_r                                             
        /home/patrick/gcc/gcc/cp/search.c:1588
0xad3012 accessible_p(tree_node*, tree_node*, bool)                
        /home/patrick/gcc/gcc/cp/search.c:889
0xad54f3 enforce_access                                                         
        /home/patrick/gcc/gcc/cp/semantics.c:314
0xad5931 perform_or_defer_access_check(tree_node*, tree_node*, tree_node*, int,
access_failure_info*)
        /home/patrick/gcc/gcc/cp/semantics.c:403
0xad1995 lookup_member(tree_node*, tree_node*, int, bool, int,
access_failure_info*)
        /home/patrick/gcc/gcc/cp/search.c:1176
0xb2bc86 finish_class_member_access_expr(cp_expr, tree_node*, bool, int)
        /home/patrick/gcc/gcc/cp/typeck.c:3188
...

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

* [Bug c++/98662] checking ICE in friend_accessible_p since r227023
  2021-01-13 20:40 [Bug c++/98662] New: checking ICE in friend_accessible_p since r227023 ppalka at gcc dot gnu.org
@ 2021-01-14  8:22 ` marxin at gcc dot gnu.org
  2021-12-23  9:48 ` pinskia at gcc dot gnu.org
                   ` (9 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-01-14  8:22 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
     Ever confirmed|0                           |1
   Last reconfirmed|                            |2021-01-14
             Status|UNCONFIRMED                 |NEW
                 CC|                            |marxin at gcc dot gnu.org

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

* [Bug c++/98662] checking ICE in friend_accessible_p since r227023
  2021-01-13 20:40 [Bug c++/98662] New: checking ICE in friend_accessible_p since r227023 ppalka at gcc dot gnu.org
  2021-01-14  8:22 ` [Bug c++/98662] " marxin at gcc dot gnu.org
@ 2021-12-23  9:48 ` pinskia at gcc dot gnu.org
  2021-12-23 11:59 ` marxin at gcc dot gnu.org
                   ` (8 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: pinskia at gcc dot gnu.org @ 2021-12-23  9:48 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #1 from Andrew Pinski <pinskia at gcc dot gnu.org> ---
Before GCC 6, we accepted the code.

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

* [Bug c++/98662] checking ICE in friend_accessible_p since r227023
  2021-01-13 20:40 [Bug c++/98662] New: checking ICE in friend_accessible_p since r227023 ppalka at gcc dot gnu.org
  2021-01-14  8:22 ` [Bug c++/98662] " marxin at gcc dot gnu.org
  2021-12-23  9:48 ` pinskia at gcc dot gnu.org
@ 2021-12-23 11:59 ` marxin at gcc dot gnu.org
  2022-05-17 18:22 ` [Bug c++/98662] [9/10/11/12/13 Regression] " ppalka at gcc dot gnu.org
                   ` (7 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: marxin at gcc dot gnu.org @ 2021-12-23 11:59 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jason at gcc dot gnu.org

--- Comment #2 from Martin Liška <marxin at gcc dot gnu.org> ---
Started with r6-2860-g7ac2c0bd17900b3c.

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

* [Bug c++/98662] [9/10/11/12/13 Regression] checking ICE in friend_accessible_p since r227023
  2021-01-13 20:40 [Bug c++/98662] New: checking ICE in friend_accessible_p since r227023 ppalka at gcc dot gnu.org
                   ` (2 preceding siblings ...)
  2021-12-23 11:59 ` marxin at gcc dot gnu.org
@ 2022-05-17 18:22 ` ppalka at gcc dot gnu.org
  2022-05-27  9:44 ` [Bug c++/98662] [10/11/12/13 " rguenth at gcc dot gnu.org
                   ` (6 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: ppalka at gcc dot gnu.org @ 2022-05-17 18:22 UTC (permalink / raw)
  To: gcc-bugs

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

Patrick Palka <ppalka at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|checking ICE in             |[9/10/11/12/13 Regression]
                   |friend_accessible_p since   |checking ICE in
                   |r227023                     |friend_accessible_p since
                   |                            |r227023
   Target Milestone|---                         |9.5
      Known to fail|                            |10.3.0, 11.2.0, 12.0, 9.4.0
           See Also|                            |https://gcc.gnu.org/bugzill
                   |                            |a/show_bug.cgi?id=66957
      Known to work|                            |5.5.0

--- Comment #3 from Patrick Palka <ppalka at gcc dot gnu.org> ---
Thus marking as a regression.

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

* [Bug c++/98662] [10/11/12/13 Regression] checking ICE in friend_accessible_p since r227023
  2021-01-13 20:40 [Bug c++/98662] New: checking ICE in friend_accessible_p since r227023 ppalka at gcc dot gnu.org
                   ` (3 preceding siblings ...)
  2022-05-17 18:22 ` [Bug c++/98662] [9/10/11/12/13 Regression] " ppalka at gcc dot gnu.org
@ 2022-05-27  9:44 ` rguenth at gcc dot gnu.org
  2022-06-28 10:43 ` jakub at gcc dot gnu.org
                   ` (5 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-05-27  9:44 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|9.5                         |10.4

--- Comment #4 from Richard Biener <rguenth at gcc dot gnu.org> ---
GCC 9 branch is being closed

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

* [Bug c++/98662] [10/11/12/13 Regression] checking ICE in friend_accessible_p since r227023
  2021-01-13 20:40 [Bug c++/98662] New: checking ICE in friend_accessible_p since r227023 ppalka at gcc dot gnu.org
                   ` (4 preceding siblings ...)
  2022-05-27  9:44 ` [Bug c++/98662] [10/11/12/13 " rguenth at gcc dot gnu.org
@ 2022-06-28 10:43 ` jakub at gcc dot gnu.org
  2022-07-26 13:45 ` rguenth at gcc dot gnu.org
                   ` (4 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: jakub at gcc dot gnu.org @ 2022-06-28 10:43 UTC (permalink / raw)
  To: gcc-bugs

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

Jakub Jelinek <jakub at gcc dot gnu.org> changed:

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

--- Comment #5 from Jakub Jelinek <jakub at gcc dot gnu.org> ---
GCC 10.4 is being released, retargeting bugs to GCC 10.5.

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

* [Bug c++/98662] [10/11/12/13 Regression] checking ICE in friend_accessible_p since r227023
  2021-01-13 20:40 [Bug c++/98662] New: checking ICE in friend_accessible_p since r227023 ppalka at gcc dot gnu.org
                   ` (5 preceding siblings ...)
  2022-06-28 10:43 ` jakub at gcc dot gnu.org
@ 2022-07-26 13:45 ` rguenth at gcc dot gnu.org
  2022-10-19  9:26 ` rguenth at gcc dot gnu.org
                   ` (3 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-07-26 13:45 UTC (permalink / raw)
  To: gcc-bugs

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

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

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Last reconfirmed|2021-01-14 00:00:00         |2022-7-26

--- Comment #6 from Richard Biener <rguenth at gcc dot gnu.org> ---
Reconfirmed on trunk.

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

* [Bug c++/98662] [10/11/12/13 Regression] checking ICE in friend_accessible_p since r227023
  2021-01-13 20:40 [Bug c++/98662] New: checking ICE in friend_accessible_p since r227023 ppalka at gcc dot gnu.org
                   ` (6 preceding siblings ...)
  2022-07-26 13:45 ` rguenth at gcc dot gnu.org
@ 2022-10-19  9:26 ` rguenth at gcc dot gnu.org
  2022-12-20 13:30 ` rguenth at gcc dot gnu.org
                   ` (2 subsequent siblings)
  10 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-10-19  9:26 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #7 from Richard Biener <rguenth at gcc dot gnu.org> ---
So is this a rejects-valid as well?  The assert suggests the return value and
the diagnostic without checking is wrong:

> g++-11 t.C -c
t.C: In instantiation of 'int f(S<int>)':
t.C:16:10:   required from here
t.C:6:14: error: 'int S<const int>::j' is protected within this context
    6 |     (void) y.j;
      |            ~~^
t.C:12:7: note: declared protected here
   12 |   int j;
      |       ^

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

* [Bug c++/98662] [10/11/12/13 Regression] checking ICE in friend_accessible_p since r227023
  2021-01-13 20:40 [Bug c++/98662] New: checking ICE in friend_accessible_p since r227023 ppalka at gcc dot gnu.org
                   ` (7 preceding siblings ...)
  2022-10-19  9:26 ` rguenth at gcc dot gnu.org
@ 2022-12-20 13:30 ` rguenth at gcc dot gnu.org
  2023-07-07 10:38 ` [Bug c++/98662] [11/12/13/14 " rguenth at gcc dot gnu.org
  2024-03-11  2:40 ` [Bug c++/98662] [11/12/13 " law at gcc dot gnu.org
  10 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu.org @ 2022-12-20 13:30 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

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

* [Bug c++/98662] [11/12/13/14 Regression] checking ICE in friend_accessible_p since r227023
  2021-01-13 20:40 [Bug c++/98662] New: checking ICE in friend_accessible_p since r227023 ppalka at gcc dot gnu.org
                   ` (8 preceding siblings ...)
  2022-12-20 13:30 ` rguenth at gcc dot gnu.org
@ 2023-07-07 10:38 ` rguenth at gcc dot gnu.org
  2024-03-11  2:40 ` [Bug c++/98662] [11/12/13 " law at gcc dot gnu.org
  10 siblings, 0 replies; 12+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-07-07 10:38 UTC (permalink / raw)
  To: gcc-bugs

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

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

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

--- Comment #8 from Richard Biener <rguenth at gcc dot gnu.org> ---
GCC 10 branch is being closed.

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

* [Bug c++/98662] [11/12/13 Regression] checking ICE in friend_accessible_p since r227023
  2021-01-13 20:40 [Bug c++/98662] New: checking ICE in friend_accessible_p since r227023 ppalka at gcc dot gnu.org
                   ` (9 preceding siblings ...)
  2023-07-07 10:38 ` [Bug c++/98662] [11/12/13/14 " rguenth at gcc dot gnu.org
@ 2024-03-11  2:40 ` law at gcc dot gnu.org
  10 siblings, 0 replies; 12+ messages in thread
From: law at gcc dot gnu.org @ 2024-03-11  2:40 UTC (permalink / raw)
  To: gcc-bugs

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

Jeffrey A. Law <law at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |law at gcc dot gnu.org
            Summary|[11/12/13/14 Regression]    |[11/12/13 Regression]
                   |checking ICE in             |checking ICE in
                   |friend_accessible_p since   |friend_accessible_p since
                   |r227023                     |r227023

--- Comment #9 from Jeffrey A. Law <law at gcc dot gnu.org> ---
The trunk no longer ICEs.  Also note that it's rejected by clang++.  Removing
gcc-14 regression marker.

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

end of thread, other threads:[~2024-03-11  2:40 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-13 20:40 [Bug c++/98662] New: checking ICE in friend_accessible_p since r227023 ppalka at gcc dot gnu.org
2021-01-14  8:22 ` [Bug c++/98662] " marxin at gcc dot gnu.org
2021-12-23  9:48 ` pinskia at gcc dot gnu.org
2021-12-23 11:59 ` marxin at gcc dot gnu.org
2022-05-17 18:22 ` [Bug c++/98662] [9/10/11/12/13 Regression] " ppalka at gcc dot gnu.org
2022-05-27  9:44 ` [Bug c++/98662] [10/11/12/13 " rguenth at gcc dot gnu.org
2022-06-28 10:43 ` jakub at gcc dot gnu.org
2022-07-26 13:45 ` rguenth at gcc dot gnu.org
2022-10-19  9:26 ` rguenth at gcc dot gnu.org
2022-12-20 13:30 ` rguenth at gcc dot gnu.org
2023-07-07 10:38 ` [Bug c++/98662] [11/12/13/14 " rguenth at gcc dot gnu.org
2024-03-11  2:40 ` [Bug c++/98662] [11/12/13 " law 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).