public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug c++/110242] New: ICE on valid (decltype with lambda)
@ 2023-06-13 21:05 stevenxia990430 at gmail dot com
  2024-02-29 15:54 ` [Bug c++/110242] " mpolacek at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: stevenxia990430 at gmail dot com @ 2023-06-13 21:05 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 110242
           Summary: ICE on valid (decltype with lambda)
           Product: gcc
           Version: 12.1.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: c++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: stevenxia990430 at gmail dot com
  Target Milestone: ---

The following program reports an internal compiler error: error reporting
routines re-entered.

To quickly reproduce: https://gcc.godbolt.org/z/h4aG89rWT
```
#include <tuple>
template <typename Tuple>
auto foo(const Tuple& t) -> decltype(([](auto&&... xs){return 0;})){
}

int main(){
    const std::tuple<int> t{1};
    return foo([](){ return 0;})(t);
}
```

Note that this code when tested on clang-trunk successfully compiles.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug c++/110242] ICE on valid (decltype with lambda)
  2023-06-13 21:05 [Bug c++/110242] New: ICE on valid (decltype with lambda) stevenxia990430 at gmail dot com
@ 2024-02-29 15:54 ` mpolacek at gcc dot gnu.org
  2024-02-29 16:02 ` mpolacek at gcc dot gnu.org
  2024-02-29 20:28 ` mpolacek at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2024-02-29 15:54 UTC (permalink / raw)
  To: gcc-bugs

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

Marek Polacek <mpolacek at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |NEW
   Last reconfirmed|                            |2024-02-29
     Ever confirmed|0                           |1
                 CC|                            |mpolacek at gcc dot gnu.org

--- Comment #1 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
Confirmed.

internal compiler error: error reporting routines re-entered.
0x10bc067 push_template_decl(tree_node*, bool)
        /home/mpolacek/src/gcc/gcc/cp/pt.cc:5883
0xed6ec4 start_preparsed_function(tree_node*, tree_node*, int)
        /home/mpolacek/src/gcc/gcc/cp/decl.cc:17845
0xf4eb00 start_lambda_function(tree_node*, tree_node*)
        /home/mpolacek/src/gcc/gcc/cp/lambda.cc:1696
0x1106d94 tsubst_lambda_expr(tree_node*, tree_node*, int, tree_node*)
        /home/mpolacek/src/gcc/gcc/cp/pt.cc:19748
0x11119fc tsubst_expr(tree_node*, tree_node*, int, tree_node*)
        /home/mpolacek/src/gcc/gcc/cp/pt.cc:21684
0x10f5523 tsubst(tree_node*, tree_node*, int, tree_node*)
        /home/mpolacek/src/gcc/gcc/cp/pt.cc:16895
0xf0be5a dump_template_bindings
        /home/mpolacek/src/gcc/gcc/cp/error.cc:494
0xf12a3d dump_substitution
        /home/mpolacek/src/gcc/gcc/cp/error.cc:1705
0xf14cb0 dump_function_decl
        /home/mpolacek/src/gcc/gcc/cp/error.cc:1878
0xf11580 dump_decl
        /home/mpolacek/src/gcc/gcc/cp/error.cc:1427
0xf1c053 decl_to_string
        /home/mpolacek/src/gcc/gcc/cp/error.cc:3323
0xf201a4 cp_printer
        /home/mpolacek/src/gcc/gcc/cp/error.cc:4501
0x36610a4 pp_format(pretty_printer*, text_info*, urlifier const*)
        /home/mpolacek/src/gcc/gcc/pretty-print.cc:1750
0x3661837 pp_format_verbatim(pretty_printer*, text_info*)
        /home/mpolacek/src/gcc/gcc/pretty-print.cc:1950
0x36620b9 pp_verbatim(pretty_printer*, char const*, ...)
        /home/mpolacek/src/gcc/gcc/pretty-print.cc:2200
0xf1e211 print_instantiation_full_context
        /home/mpolacek/src/gcc/gcc/cp/error.cc:3738
0xf1e79f maybe_print_instantiation_context
        /home/mpolacek/src/gcc/gcc/cp/error.cc:3888
0xf1c97e cp_diagnostic_starter
        /home/mpolacek/src/gcc/gcc/cp/error.cc:3574
0x3631f74 diagnostic_text_output_format::on_begin_diagnostic(diagnostic_info
const&)
        /home/mpolacek/src/gcc/gcc/diagnostic.cc:2401
0x362f4d7 diagnostic_context::report_diagnostic(diagnostic_info*)
        /home/mpolacek/src/gcc/gcc/diagnostic.cc:1605

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug c++/110242] ICE on valid (decltype with lambda)
  2023-06-13 21:05 [Bug c++/110242] New: ICE on valid (decltype with lambda) stevenxia990430 at gmail dot com
  2024-02-29 15:54 ` [Bug c++/110242] " mpolacek at gcc dot gnu.org
@ 2024-02-29 16:02 ` mpolacek at gcc dot gnu.org
  2024-02-29 20:28 ` mpolacek at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2024-02-29 16:02 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #2 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
*** Bug 110107 has been marked as a duplicate of this bug. ***

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug c++/110242] ICE on valid (decltype with lambda)
  2023-06-13 21:05 [Bug c++/110242] New: ICE on valid (decltype with lambda) stevenxia990430 at gmail dot com
  2024-02-29 15:54 ` [Bug c++/110242] " mpolacek at gcc dot gnu.org
  2024-02-29 16:02 ` mpolacek at gcc dot gnu.org
@ 2024-02-29 20:28 ` mpolacek at gcc dot gnu.org
  2 siblings, 0 replies; 4+ messages in thread
From: mpolacek at gcc dot gnu.org @ 2024-02-29 20:28 UTC (permalink / raw)
  To: gcc-bugs

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

--- Comment #3 from Marek Polacek <mpolacek at gcc dot gnu.org> ---
We're trying to emit the "no return statement in function returning non-void"
warning, which triggers dump_template_bindings:

 493       push_deferring_access_checks (dk_no_check);
 494       t = tsubst (t, args, tf_none, NULL_TREE);
 495       pop_deferring_access_checks ();

The tsubst leads to tsubst_lambda_expr with complain=tf_none, but there we have

19748       tree body = start_lambda_function (fn, r);

which has no complain, and in it, push_template_decl warns about

5883       warning (OPT_Wtemplates, "template %qD declared", decl);

so we crash.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-02-29 20:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-13 21:05 [Bug c++/110242] New: ICE on valid (decltype with lambda) stevenxia990430 at gmail dot com
2024-02-29 15:54 ` [Bug c++/110242] " mpolacek at gcc dot gnu.org
2024-02-29 16:02 ` mpolacek at gcc dot gnu.org
2024-02-29 20:28 ` mpolacek 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).