Skip to content

Conversation

i-garrison
Copy link
Contributor

Stop null dereference in ExecIf when thenClauseExec is null. This happens with throw declaration in thenClause, and ExecIf already allows for null in elseClauseExec so this is a bit more consistent.

Null thenClauseExec can be from encountered valid static_assert declaration, handle it during constexpr execution as new special problem type STATIC_ASSERT_FAILED.

Fix these and add unit test.

@i-garrison i-garrison force-pushed the feature/constexpr-execute-static-assert branch 3 times, most recently from b94bc49 to 3cc59d9 Compare September 17, 2025 20:54
Copy link

github-actions bot commented Sep 17, 2025

Test Results

  584 files   -    34    584 suites   - 34   14m 0s ⏱️ - 22m 33s
9 888 tests  - 1 215  9 864 ✅  - 1 095  24 💤  - 120  0 ❌ ±0 
9 926 runs   - 1 215  9 902 ✅  - 1 095  24 💤  - 120  0 ❌ ±0 

Results for commit e610e39. ± Comparison against base commit fc9f3ac.

This pull request removes 1217 and adds 2 tests. Note that renamed tests count towards both.
org.eclipse.cdt.debug.gdbjtag.core.tests.jtagdevice.GDBJtagDeviceContributionTest ‑ testGdbJtagDeviceContribution
org.eclipse.cdt.debug.gdbjtag.core.tests.launch.GDBJtagLaunchTest ‑ testGdbJtagLaunch[gdb]
org.eclipse.cdt.debug.gdbjtag.core.tests.launch.GDBJtagLaunchTest ‑ testGdbJtagLaunch[gdbserver]
org.eclipse.cdt.tests.dsf.gdb.tests.CommandLineArgsTest ‑ testSettingArgumentsWithQuotes[gdb]
org.eclipse.cdt.tests.dsf.gdb.tests.CommandLineArgsTest ‑ testSettingArgumentsWithQuotes[gdbserver]
org.eclipse.cdt.tests.dsf.gdb.tests.CommandLineArgsTest ‑ testSettingArgumentsWithSpecialSymbols[gdb]
org.eclipse.cdt.tests.dsf.gdb.tests.CommandLineArgsTest ‑ testSettingArgumentsWithSpecialSymbols[gdbserver]
org.eclipse.cdt.tests.dsf.gdb.tests.CommandLineArgsTest ‑ testSettingArgumentsWithSymbols[gdb]
org.eclipse.cdt.tests.dsf.gdb.tests.CommandLineArgsTest ‑ testSettingArgumentsWithSymbols[gdbserver]
org.eclipse.cdt.tests.dsf.gdb.tests.CommandLineArgsTest ‑ testSettingArgumentsWithTabs[gdb]
…
org.eclipse.cdt.core.parser.tests.ast2.AST2TemplateTests ‑ testIfThenElseClauseStaticAssert
org.eclipse.cdt.core.parser.tests.ast2.AST2TemplateTests ‑ testStaticAssertInCompoundStatement

♻️ This comment has been updated with latest results.

@i-garrison i-garrison marked this pull request as draft September 17, 2025 21:21
@i-garrison i-garrison marked this pull request as ready for review September 17, 2025 21:36
@i-garrison i-garrison force-pushed the feature/constexpr-execute-static-assert branch from 3cc59d9 to e17148d Compare September 29, 2025 20:27
…n substatement

Stop null dereference in ExecIf when thenClauseExec is null. This happens with
throw declaration in thenClause, and ExecIf already allows for null in elseClauseExec
so this is a bit more consistent.

Null thenClauseExec can be from encountered valid static_assert declaration,
handle it during constexpr execution as new special problem type STATIC_ASSERT_FAILED.
@i-garrison i-garrison force-pushed the feature/constexpr-execute-static-assert branch from e17148d to 58ef0e5 Compare October 4, 2025 09:54
@i-garrison i-garrison marked this pull request as draft October 5, 2025 18:05
…atement

If static assertion fails, propagate that up through the call chain to allow
evaluating it to STATIC_ASSERTION_FAILED_ERROR.
@i-garrison i-garrison marked this pull request as ready for review October 5, 2025 20:38
@jonahgraham jonahgraham added the language C/C++ Language Support label Oct 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

language C/C++ Language Support

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants