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

            Bug ID: 124241
           Summary: [reflection] internal compiler error: in
                    friend_accessible_p, at cp/search.cc:817
           Product: gcc
           Version: 16.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: mpolacek at gcc dot gnu.org
  Target Milestone: ---

This PR tracks the TODO in is_accessible2.C.

```
#include <meta>
using namespace std::meta;

struct N
{
protected:
  union { int b; };
public:
  static constexpr auto ctx = access_context::current ();
  static constexpr info rb = ^^b;
};

static_assert (is_accessible (N::rb, N::ctx));
```

results in:

is_accessible2.C:13:30: internal compiler error: in friend_accessible_p, at
cp/search.cc:817
   13 | static_assert (is_accessible (N::rb, N::ctx));
      |                ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~
0x3197af8 internal_error(char const*, ...)
        /home/mpolacek/src/gcc/gcc/diagnostic-global-context.cc:787
0x31a6403 fancy_abort(char const*, int, char const*)
        /home/mpolacek/src/gcc/gcc/diagnostics/context.cc:1812
0x88d2d5 friend_accessible_p
        /home/mpolacek/src/gcc/gcc/cp/search.cc:817
0x88d4a7 dfs_accessible_post
        /home/mpolacek/src/gcc/gcc/cp/search.cc:877
0x88f77b dfs_walk_once_accessible_r
        /home/mpolacek/src/gcc/gcc/cp/search.cc:1694
0x88f88d dfs_walk_once_accessible
        /home/mpolacek/src/gcc/gcc/cp/search.cc:1714
0x88d93c accessible_p(tree_node*, tree_node*, bool)
        /home/mpolacek/src/gcc/gcc/cp/search.cc:978
0x877c43 eval_is_accessible
        /home/mpolacek/src/gcc/gcc/cp/reflect.cc:6398
0x87f87b process_metafunction(constexpr_ctx const*, tree_node*, tree_node*,
bool*, bool*, tree_node**)
        /home/mpolacek/src/gcc/gcc/cp/reflect.cc:7623
0x4921e4 cxx_eval_call_expression
        /home/mpolacek/src/gcc/gcc/cp/constexpr.cc:4013
0x4a9f80 cxx_eval_constant_expression(constexpr_ctx const*, tree_node*,
value_cat, bool*, bool*, tree_node**)
        /home/mpolacek/src/gcc/gcc/cp/constexpr.cc:9351
0x4b1f82 cxx_eval_outermost_constant_expr
        /home/mpolacek/src/gcc/gcc/cp/constexpr.cc:10938
0x4b37e6 maybe_constant_value(tree_node*, tree_node*, mce_value)
        /home/mpolacek/src/gcc/gcc/cp/constexpr.cc:11365
0x4b3e2c fold_non_dependent_expr(tree_node*, int, bool, tree_node*)
        /home/mpolacek/src/gcc/gcc/cp/constexpr.cc:11505
0x8d724a finish_static_assert(tree_node*, tree_node*, unsigned long, bool,
bool, bool)
        /home/mpolacek/src/gcc/gcc/cp/semantics.cc:13100
0x728a94 cp_parser_static_assert
        /home/mpolacek/src/gcc/gcc/cp/parser.cc:19260
0x725793 cp_parser_block_declaration
        /home/mpolacek/src/gcc/gcc/cp/parser.cc:17853
0x7252e2 cp_parser_declaration
        /home/mpolacek/src/gcc/gcc/cp/parser.cc:17684
0x7253bf cp_parser_toplevel_declaration
        /home/mpolacek/src/gcc/gcc/cp/parser.cc:17705
0x7050ce cp_parser_translation_unit
        /home/mpolacek/src/gcc/gcc/cp/parser.cc:5596

Reply via email to