Haojian Wu
6aa2e49648
[clang][Parser] Fix an assertion during decltype error recovery with missing ; ( #188123 )
...
Fix an assertion failure in `ParseDecltypeSpecifier` when parsing
malformed expressions e.g. `decltype(union { ... )`.
When a class/union definition is missing a semicolon, clang's error
recovery may synthetically set the current token to `tok::semi` without
actually inserting it into the preprocessor's backtrack cache, see
9096c9cda3/clang/lib/Parse/ParseDeclCXX.cpp (L1920-L1927)
If `ParseDecltypeSpecifier` later encounters this synthetic semicolon
during its own error recovery, its attempts to revert the cache and
re-lex the tokens will lead to reading unexpected tokens from the
historical stream, failing the strict
`Tok.is(tok::semi)` assertion.
This patch removes this assertion, acknowledging that during invalid
parses and error recovery, the preprocessor's cache state may not
strictly align with the parser's simulated state.
Fixes : #188014
2026-03-31 20:30:28 +00:00
..
2025-02-27 10:41:04 -05:00
2020-10-26 10:50:05 +01:00
2021-10-04 14:16:47 -05:00
2017-03-21 22:06:18 +00:00
2021-05-13 11:48:32 -04:00
2024-05-21 15:01:13 -04:00
2015-03-19 00:10:23 +00:00
2009-12-15 20:14:24 +00:00
2009-12-15 20:14:24 +00:00
2009-12-15 20:14:24 +00:00
2017-08-07 20:52:04 +00:00
2023-02-16 17:58:35 -08:00
2023-08-28 12:13:42 -04:00
2025-07-08 11:36:52 +03:00
2025-07-08 11:36:52 +03:00
2025-07-08 11:36:52 +03:00
2023-08-30 11:46:54 +03:00
2024-05-19 10:46:12 -07:00
2017-03-01 18:06:25 +00:00
2023-08-30 11:46:54 +03:00
2024-08-15 14:42:39 -04:00
2023-08-28 12:13:42 -04:00
2022-05-04 08:35:47 -04:00
2022-02-07 15:29:36 -05:00
2022-02-07 15:29:36 -05:00
2012-10-19 12:44:48 +00:00
2023-06-05 14:56:58 +02:00
2025-08-23 11:43:58 +02:00
2022-02-07 15:29:36 -05:00
2022-02-07 15:29:36 -05:00
2023-11-07 08:27:41 -05:00
2020-05-08 19:32:00 -07:00
2025-05-09 14:10:18 -04:00
2024-01-15 09:41:32 +00:00
2024-01-15 09:41:32 +00:00
2025-05-09 00:49:01 +03:00
2023-07-22 09:34:15 -07:00
2025-10-17 21:50:08 +03:00
2023-08-11 08:42:01 -04:00
2023-08-11 08:42:01 -04:00
2024-04-03 18:39:53 +02:00
2025-07-07 07:09:09 -04:00
2024-02-16 15:08:04 -05:00
2022-07-29 13:18:44 -04:00
2024-03-06 09:46:35 +01:00
2025-07-07 07:09:09 -04:00
2022-02-07 15:29:36 -05:00
2011-10-13 22:29:44 +00:00
2022-02-07 15:29:36 -05:00
2023-08-28 12:13:42 -04:00
2023-08-28 12:13:42 -04:00
2024-10-02 01:54:29 +02:00
2012-06-06 17:25:21 +00:00
2024-07-01 17:43:07 +02:00
2020-08-31 20:59:20 -07:00
2022-02-07 15:29:36 -05:00
2009-12-15 20:14:24 +00:00
2020-11-12 11:42:53 -08:00
2016-10-08 22:15:58 +00:00
2019-05-08 00:52:33 +00:00
2024-01-27 10:23:38 +01:00
2025-08-23 01:31:06 +03:00
2025-07-08 11:36:52 +03:00
2017-09-29 23:57:25 +00:00
2026-03-12 16:56:43 +00:00
2023-06-07 10:31:11 +02:00
2024-01-15 09:41:32 +00:00
2025-10-05 06:20:09 +00:00
2023-08-22 18:10:41 -07:00
2014-06-11 00:49:52 +00:00
2014-02-19 00:13:27 +00:00
2016-01-03 15:55:40 +00:00
2025-10-16 18:28:38 +02:00
2023-05-04 19:19:52 +02:00
2025-10-16 18:28:38 +02:00
2025-06-13 06:45:40 -04:00
2021-09-28 10:00:15 -07:00
2022-09-04 05:29:32 +00:00
2016-12-20 21:35:28 +00:00
2025-08-04 08:51:22 +02:00
2024-07-15 13:22:40 +02:00
2024-04-23 20:34:22 +08:00
2021-05-16 10:42:52 -07:00
2023-04-10 17:33:09 +02:00
2023-08-29 11:28:57 -07:00
2023-05-20 13:22:58 +02:00
2023-05-04 19:19:52 +02:00
2023-05-04 19:19:52 +02:00
2025-09-30 02:16:01 +03:00
2026-01-17 10:43:51 -05:00
2023-05-04 19:19:52 +02:00
2025-10-16 18:28:38 +02:00
2024-11-19 14:31:00 -05:00
2025-08-14 12:51:58 +02:00
2025-06-13 06:45:40 -04:00
2025-08-04 08:51:22 +02:00
2024-08-15 21:16:30 +02:00
2025-03-10 09:37:38 -03:00
2025-09-15 21:04:45 +08:00
2024-03-21 12:57:24 +01:00
2025-06-15 00:01:25 +03:00
2018-05-24 22:02:52 +00:00
2017-04-04 21:18:36 +00:00
2023-07-03 06:07:04 -04:00
2024-10-11 06:10:03 -07:00
2023-02-23 14:40:58 +08:00
2022-09-28 08:50:27 -07:00
2025-07-29 11:53:02 +08:00
2026-03-12 16:56:43 +00:00
2026-03-24 14:31:42 -04:00
2026-03-24 14:31:42 -04:00
2014-05-28 12:26:32 +00:00
2023-05-20 13:22:58 +02:00
2020-03-27 17:11:04 -07:00
2024-10-02 01:54:29 +02:00
2025-03-10 09:37:38 -03:00
2024-09-18 10:11:03 +02:00
2022-09-04 05:29:32 +00:00
2024-10-02 16:40:06 +02:00
2022-08-30 15:11:38 +02:00
2025-04-22 10:41:16 +08:00
2024-02-13 14:25:56 -05:00
2024-03-04 09:25:29 -08:00
2023-08-28 12:13:42 -04:00
2012-10-19 12:44:48 +00:00
2016-04-14 23:47:07 +00:00
2024-01-04 21:04:54 +01:00
2025-05-13 06:31:10 -04:00
2025-06-16 23:17:47 +08:00
2022-05-04 08:35:47 -04:00
2023-08-28 12:13:42 -04:00
2023-04-25 23:08:30 +02:00
2023-02-16 14:05:16 +08:00
2023-05-15 07:39:58 -04:00
2010-07-26 04:08:02 +00:00
2025-12-03 17:24:33 +02:00
2025-05-31 19:34:11 -03:00
2025-03-10 10:32:08 +01:00
2025-03-14 15:30:01 +01:00
2023-05-15 07:39:58 -04:00
2025-08-04 08:51:22 +02:00
2011-12-15 00:38:15 +00:00
2023-08-28 12:13:42 -04:00
2023-01-18 12:41:44 +01:00
2014-03-07 22:36:23 +00:00
2025-08-14 12:51:58 +02:00
2025-09-15 16:55:00 +00:00
2024-05-28 14:55:18 -04:00
2017-02-14 22:47:20 +00:00
2026-03-31 20:30:28 +00:00
2025-03-21 03:55:42 +01:00
2025-12-11 05:54:09 +01:00
2025-12-11 05:54:09 +01:00
2025-10-15 10:30:03 -03:00
2025-07-25 15:21:30 -04:00
2009-12-15 20:14:24 +00:00
2025-08-14 06:42:55 -03:00
2026-01-06 21:38:41 +02:00
2012-10-19 12:44:48 +00:00
2025-08-13 07:03:09 -07:00
2022-05-04 08:35:47 -04:00
2022-05-04 08:35:47 -04:00
2022-02-07 15:29:36 -05:00
2025-04-21 18:12:07 +03:00
2018-11-20 18:59:05 +00:00
2022-01-05 14:49:03 +08:00
2024-05-04 23:08:11 -07:00
2011-02-17 03:38:46 +00:00
2022-10-14 10:55:29 -04:00
2024-08-22 23:33:40 +02:00
2024-08-21 17:38:24 +04:00
2022-02-07 15:29:36 -05:00
2024-07-02 08:19:07 -04:00
2023-06-05 11:35:03 -04:00
2024-01-10 08:49:36 +08:00
2024-01-10 08:49:36 +08:00
2023-09-19 04:02:04 +02:00
2023-09-12 11:06:06 -07:00
2024-12-10 09:17:41 +01:00
2025-07-15 18:09:51 +02:00
2025-04-30 07:31:42 -07:00
2023-08-28 12:13:42 -04:00
2012-10-19 12:44:48 +00:00
2009-12-15 20:14:24 +00:00
2022-07-22 15:24:54 -04:00
2022-04-08 16:19:58 -04:00
2025-09-02 16:37:19 +00:00
2022-11-04 07:33:31 +00:00
2025-11-06 22:55:36 +02:00
2024-05-21 15:14:03 -04:00
2025-06-11 14:19:25 -07:00
2020-05-11 18:55:45 +01:00
2018-08-21 16:47:04 +00:00
2023-08-28 12:13:42 -04:00
2010-07-26 04:08:02 +00:00
2026-01-13 12:33:58 +01:00
2025-08-09 05:06:53 -03:00
2023-08-28 12:13:42 -04:00
2023-08-03 12:58:48 +08:00
2023-08-28 12:13:42 -04:00
2023-08-28 12:13:42 -04:00
2023-08-03 12:58:48 +08:00
2023-08-28 12:13:42 -04:00
2016-03-21 16:08:49 +00:00
2025-11-05 14:43:40 +08:00
2022-02-07 15:29:36 -05:00
2022-10-10 15:45:02 -04:00
2022-02-07 15:29:36 -05:00
2023-08-30 11:46:54 +03:00
2024-07-26 08:39:46 -04:00
2022-02-09 09:11:49 -05:00
2025-01-09 17:01:30 +02:00
2019-11-09 15:33:01 +01:00
2019-11-09 15:33:01 +01:00
2022-02-09 09:11:49 -05:00
2023-08-28 12:13:42 -04:00
2024-05-03 10:23:53 -07:00
2022-02-09 09:11:49 -05:00
2023-08-28 12:13:42 -04:00
2024-12-20 09:47:26 -08:00
2023-08-28 12:13:42 -04:00
2023-08-18 16:27:57 +02:00
2023-08-28 12:13:42 -04:00
2022-05-04 08:35:47 -04:00
2025-06-13 06:45:40 -04:00
2023-08-28 12:13:42 -04:00
2023-08-28 12:13:42 -04:00
2022-02-09 09:11:49 -05:00
2016-12-20 02:43:58 +00:00
2023-08-28 12:13:42 -04:00
2022-07-25 07:22:54 -04:00
2022-08-11 08:44:38 +02:00
2024-05-23 14:50:29 -04:00
2020-06-12 15:21:38 +02:00
2025-06-15 00:01:25 +03:00
2023-08-28 12:13:42 -04:00
2016-05-31 18:46:31 +00:00
2012-03-06 03:21:47 +00:00
2016-02-05 19:36:39 +00:00
2011-04-14 17:21:19 +00:00
2024-12-20 09:47:26 -08:00
2024-03-21 12:57:24 +01:00
2019-12-27 13:42:07 +00:00
2025-06-13 06:45:40 -04:00
2022-10-20 09:29:09 -07:00
2016-02-26 03:13:03 +00:00
2022-05-13 08:31:52 -04:00
2022-06-15 10:54:46 +01:00
2021-02-05 07:20:41 -05:00
2020-06-23 21:25:56 -05:00
2025-03-19 15:16:38 +01:00
2026-02-06 11:32:17 -05:00
2026-02-06 11:32:17 -05:00
2019-04-11 17:55:30 +00:00
2022-02-09 09:11:49 -05:00
2009-12-15 20:14:24 +00:00
2013-07-04 16:16:58 +00:00
2019-08-04 10:08:51 +00:00
2026-02-26 23:48:53 +02:00
2026-01-23 14:46:31 -05:00
2026-01-23 14:46:31 -05:00
2022-02-09 09:11:49 -05:00
2023-09-27 18:58:01 +02:00
2023-11-28 23:38:50 +09:00
2019-08-04 10:08:51 +00:00
2022-11-21 16:02:54 +00:00
2023-11-28 23:38:50 +09:00
2018-08-03 01:21:16 +00:00
2025-12-11 12:18:35 -05:00
2023-10-20 13:10:03 -04:00
2017-07-28 14:41:21 +00:00
2019-07-25 07:33:13 +00:00
2024-04-29 22:00:41 +08:00
2020-12-31 00:27:11 -08:00
2010-08-05 07:00:53 +00:00
2013-10-28 22:04:30 +00:00
2025-01-18 19:16:33 +01:00
2025-04-15 12:54:25 -07:00
2025-10-02 16:11:31 +02:00
2025-06-13 06:45:40 -04:00
2025-04-18 16:27:27 +08:00
2011-03-26 01:53:26 +00:00
2023-08-28 12:13:42 -04:00
2022-02-09 09:11:49 -05:00
2018-05-17 09:24:37 +00:00
2018-05-17 09:24:37 +00:00
2020-05-20 09:46:18 -07:00
2022-10-10 15:53:48 -04:00
2025-07-09 08:54:30 +08:00
2025-07-08 09:34:13 +02:00
2024-09-16 08:58:50 -04:00
2023-06-27 01:15:45 +03:00
2023-06-27 01:15:45 +03:00
2023-06-27 01:15:45 +03:00
2025-06-13 06:45:40 -04:00
2025-06-13 06:45:40 -04:00
2025-04-25 08:21:41 -04:00
2022-02-09 09:11:49 -05:00
2021-06-02 10:30:24 -04:00
2019-05-01 23:33:49 +00:00
2011-12-22 23:26:17 +00:00
2023-03-17 18:31:44 +01:00
2022-07-25 11:48:24 +08:00
2022-07-25 11:48:24 +08:00
2025-09-14 10:09:46 -07:00