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

            Bug ID: 85031
           Summary: internal compiler error: Segmentation fault
                    (field_accessor_p()/dfs_locate_field_accessor_pre())
           Product: gcc
           Version: 8.0.1
            Status: UNCONFIRMED
          Keywords: ice-on-invalid-code
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: vegard.nossum at oracle dot com
                CC: webrown.cpp at gmail dot com
  Target Milestone: ---

Input:

struct {
private:
  int a;
  void b() { return; }
} *a(a->a);

Output:

$ cc1plus 
 void<unnamed struct>::b()
<stdin>: At global scope:
<stdin>:5:9: error: 'int <unnamed struct>::a' is private within this context
<stdin>:3:7: note: declared private here
<stdin>:5:9: internal compiler error: Segmentation fault
0x3152ce9 crash_signal
        /home/vegard/git/gcc/gcc/toplev.c:325
0x121f448 field_accessor_p
        /home/vegard/git/gcc/gcc/cp/search.c:1764
0x121f448 dfs_locate_field_accessor_pre
        /home/vegard/git/gcc/gcc/cp/search.c:1819
0x1247ebc dfs_walk_once_accessible_r
        /home/vegard/git/gcc/gcc/cp/search.c:1536
0x1247ebc dfs_walk_once_accessible
        /home/vegard/git/gcc/gcc/cp/search.c:1603
0x1247ebc locate_field_accessor(tree_node*, tree_node*, bool)
        /home/vegard/git/gcc/gcc/cp/search.c:1839
0x1413c73 access_failure_info::maybe_suggest_accessor(bool) const
        /home/vegard/git/gcc/gcc/cp/typeck.c:2727
0x1415702 finish_class_member_access_expr(cp_expr, tree_node*, bool, int)
        /home/vegard/git/gcc/gcc/cp/typeck.c:2930
0xf4a842 cp_parser_postfix_dot_deref_expression
        /home/vegard/git/gcc/gcc/cp/parser.c:7632
0xf75672 cp_parser_postfix_expression
        /home/vegard/git/gcc/gcc/cp/parser.c:7276
0xf2a4b7 cp_parser_unary_expression
        /home/vegard/git/gcc/gcc/cp/parser.c:8322
0xebfeca cp_parser_cast_expression
        /home/vegard/git/gcc/gcc/cp/parser.c:9090
0xec24f6 cp_parser_binary_expression
        /home/vegard/git/gcc/gcc/cp/parser.c:9191
0xec62ca cp_parser_assignment_expression
        /home/vegard/git/gcc/gcc/cp/parser.c:9486
0xecc0a3 cp_parser_constant_expression
        /home/vegard/git/gcc/gcc/cp/parser.c:9770
0xed376b cp_parser_parenthesized_expression_list
        /home/vegard/git/gcc/gcc/cp/parser.c:7758
0xedc2bc cp_parser_initializer
        /home/vegard/git/gcc/gcc/cp/parser.c:21864
0xfa0f3d cp_parser_init_declarator
        /home/vegard/git/gcc/gcc/cp/parser.c:19677
0xfa57a7 cp_parser_simple_declaration
        /home/vegard/git/gcc/gcc/cp/parser.c:13065
0xfab998 cp_parser_block_declaration
        /home/vegard/git/gcc/gcc/cp/parser.c:12883
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.

Version:

GNU C++14 (GCC) version 8.0.1 20180306 (experimental) (x86_64-pc-linux-gnu)

7.3.0 seems fine with it.

Reply via email to