Bug 100019 - ICE Segmentation fault with try-catch block in lambda
Summary: ICE Segmentation fault with try-catch block in lambda
Status: NEW
Alias: None
Product: gcc
Classification: Unclassified
Component: c++ (show other bugs)
Version: 11.0
: P3 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords: c++-lambda, ice-on-invalid-code
Depends on:
Blocks:
 
Reported: 2021-04-10 16:47 UTC by 康桓瑋
Modified: 2024-04-15 22:33 UTC (History)
2 users (show)

See Also:
Host:
Target:
Build:
Known to work:
Known to fail:
Last reconfirmed: 2024-04-15 00:00:00


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description 康桓瑋 2021-04-10 16:47:54 UTC
https://godbolt.org/z/WajPza5fM

void f(auto... args) {
  [] {
    try {} catch (decltype(args)) {}
  };
}

int main() {
  f(0);
}

<source>:3:19: internal compiler error: Segmentation fault
    3 |     try {} catch (decltype(args)) {}
      |                   ^~~~~~~~~~~~~~
0x1d00a79 internal_error(char const*, ...)
	???:0
0x98c0ff finish_decltype_type(tree_node*, bool, int)
	???:0
0x9170e3 tsubst(tree_node*, tree_node*, int, tree_node*)
	???:0
0x9177e7 tsubst(tree_node*, tree_node*, int, tree_node*)
	???:0
0x94acb2 tsubst_lambda_expr(tree_node*, tree_node*, int, tree_node*)
	???:0
0x91d61f instantiate_decl(tree_node*, bool, bool)
	???:0
0x95f4eb instantiate_pending_templates(int)
	???:0
0x7ccff9 c_parse_final_cleanups()
	???:0
Please submit a full bug report,
with preprocessed source if appropriate.
Comment 1 Marek Polacek 2021-04-10 16:58:43 UTC
Confirmed.