This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug c++/88348] New: ICE in pp_cxx_unqualified_id when handling pointer to pointer to member


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

            Bug ID: 88348
           Summary: ICE in pp_cxx_unqualified_id when handling pointer to
                    pointer to member
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: zhouzhouyi at gmail dot com
  Target Milestone: ---

g++ from git ICE when compiling following program because of  incorrect
handling pointer to pointer to member
---
void* operator new (__SIZE_TYPE__, void *p) { return p; }
int i;
struct Z {
  void f(int = 0) const;
};

template <class T> struct helper {};

typedef void (Z::**QF)(int) const;

template <class T> void check1( helper<new QF> * ) { }
---

./cc1plus /root/zzy/mangle52.C
 void* operator new(long unsigned int, void*)‘
At global scope:
Segmentation fault
   11 | template <class T> void check1( helper<new QF> * ) { }
      |                                            ^~
0x105c80f crash_signal
        ../../gcc-git/gcc/toplev.c:326
0x812b40 pp_cxx_unqualified_id
        ../../gcc-git/gcc/cp/cxx-pretty-print.c:128
0x812e63 pp_cxx_unqualified_id
        ../../gcc-git/gcc/cp/cxx-pretty-print.c:173
0x813ae6 pp_cxx_qualified_id
        ../../gcc-git/gcc/cp/cxx-pretty-print.c:291
0x8166d5 cxx_pretty_printer::simple_type_specifier(tree_node*)
        ../../gcc-git/gcc/cp/cxx-pretty-print.c:1338
0xb189db pp_c_specifier_qualifier_list(c_pretty_printer*, tree_node*)
        ../../gcc-git/gcc/c-family/c-pretty-print.c:483
0xb18a31 pp_c_specifier_qualifier_list(c_pretty_printer*, tree_node*)
        ../../gcc-git/gcc/c-family/c-pretty-print.c:447
0xb18c40 c_pretty_printer::type_id(tree_node*)
        ../../gcc-git/gcc/c-family/c-pretty-print.c:615
0x818481 cxx_pretty_printer::type_id(tree_node*)
        ../../gcc-git/gcc/cp/cxx-pretty-print.c:1833
0x814d39 pp_cxx_new_expression
        ../../gcc-git/gcc/cp/cxx-pretty-print.c:722
0x815cf0 cxx_pretty_printer::expression(tree_node*)
        ../../gcc-git/gcc/cp/cxx-pretty-print.c:1127
0x897e2e dump_expr
        ../../gcc-git/gcc/cp/error.c:2796
0x898a22 expr_to_string(tree_node*)
        ../../gcc-git/gcc/cp/error.c:3078
0x89b925 cp_printer
        ../../gcc-git/gcc/cp/error.c:4087
0x1d2224d pp_format(pretty_printer*, text_info*)
        ../../gcc-git/gcc/pretty-print.c:1392
0x1d03dcd diagnostic_report_diagnostic(diagnostic_context*, diagnostic_info*)
        ../../gcc-git/gcc/diagnostic.c:1015
0x1d040a3 diagnostic_impl
        ../../gcc-git/gcc/diagnostic.c:1159
0x1d04da8 error_at(unsigned int, char const*, ...)
        ../../gcc-git/gcc/diagnostic.c:1461
0x7e1833 potential_constant_expression_1
        ../../gcc-git/gcc/cp/constexpr.c:5947
0x7e306a potential_constant_expression_1(tree_node*, bool, bool, bool, int)
        ../../gcc-git/gcc/cp/constexpr.c:6339
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.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]