public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "ppalka at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug c++/98662] New: checking ICE in friend_accessible_p since r227023
Date: Wed, 13 Jan 2021 20:40:50 +0000	[thread overview]
Message-ID: <bug-98662-4@http.gcc.gnu.org/bugzilla/> (raw)

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

             reply	other threads:[~2021-01-13 20:40 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-13 20:40 ppalka at gcc dot gnu.org [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-98662-4@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).