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

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).