Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use params.useExceptions instead of betterC to gate generation of try/catch in ctors #15357

Merged
merged 1 commit into from
Jun 27, 2023

Conversation

ibuclaw
Copy link
Member

@ibuclaw ibuclaw commented Jun 27, 2023

In DMD, -betterC is the mechanism that controls this individual feature setting, it should not be the gauge as to whether nothrow violating code should be generated or not.

This almost allows the entire front-end to be built with -fno-exceptions. The one remaining place that falls foul is a scope(failure) in semantic2 that shouldn't be there.

@ibuclaw ibuclaw added GDC Gnu D Compiler Easy Review labels Jun 27, 2023
@dlang-bot
Copy link
Contributor

Thanks for your pull request, @ibuclaw!

Bugzilla references

Your PR doesn't reference any Bugzilla issue.

If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog.

Testing this PR locally

If you don't have a local development environment setup, you can use Digger to test this PR:

dub run digger -- build "master + dmd#15357"

@ibuclaw ibuclaw merged commit 846835e into dlang:master Jun 27, 2023
@ibuclaw ibuclaw deleted the useexceptions branch June 27, 2023 20:06
nstester pushed a commit to nstester/gcc that referenced this pull request Jul 1, 2023
…no-exceptions'

The version flags for RTMI, RTTI, and exceptions was unconditionally
predefined.  These are now only predefined if the feature flag is
enabled.  It was noticed that there was no `-fexceptions' definition
inside d/lang.opt, so the detection of the exceptions option flag was
only partially working.  Once that was fixed, a few places in the
front-end implementation were found to fall fowl of `nothrow' rules,
these have been fixed upstream and backported here as well.

Reviewed-on: dlang/dmd#15357
	     dlang/dmd#15360

	PR d/110471

gcc/d/ChangeLog:

	* d-builtins.cc (d_init_versions): Predefine D_ModuleInfo,
	D_Exceptions, and D_TypeInfo only if feature is enabled.
	* lang.opt: Add -fexceptions.

gcc/testsuite/ChangeLog:

	* gdc.dg/pr110471a.d: New test.
	* gdc.dg/pr110471b.d: New test.
	* gdc.dg/pr110471c.d: New test.
sebhub pushed a commit to RTEMS/gnu-mirror-gcc that referenced this pull request Jul 1, 2023
…no-exceptions'

The version flags for RTMI, RTTI, and exceptions was unconditionally
predefined.  These are now only predefined if the feature flag is
enabled.  It was noticed that there was no `-fexceptions' definition
inside d/lang.opt, so the detection of the exceptions option flag was
only partially working.  Once that was fixed, a few places in the
front-end implementation were found to fall fowl of `nothrow' rules,
these have been fixed upstream and backported here as well.

Reviewed-on: dlang/dmd#15357
	     dlang/dmd#15360

	PR d/110471

gcc/d/ChangeLog:

	* d-builtins.cc (d_init_versions): Predefine D_ModuleInfo,
	D_Exceptions, and D_TypeInfo only if feature is enabled.
	* lang.opt: Add -fexceptions.

gcc/testsuite/ChangeLog:

	* gdc.dg/pr110471a.d: New test.
	* gdc.dg/pr110471b.d: New test.
	* gdc.dg/pr110471c.d: New test.

(cherry picked from commit da108c7)
rsh-raj pushed a commit to rsh-raj/gcc that referenced this pull request Oct 6, 2023
…no-exceptions'

The version flags for RTMI, RTTI, and exceptions was unconditionally
predefined.  These are now only predefined if the feature flag is
enabled.  It was noticed that there was no `-fexceptions' definition
inside d/lang.opt, so the detection of the exceptions option flag was
only partially working.  Once that was fixed, a few places in the
front-end implementation were found to fall fowl of `nothrow' rules,
these have been fixed upstream and backported here as well.

Reviewed-on: dlang/dmd#15357
	     dlang/dmd#15360

	PR d/110471

gcc/d/ChangeLog:

	* d-builtins.cc (d_init_versions): Predefine D_ModuleInfo,
	D_Exceptions, and D_TypeInfo only if feature is enabled.
	* lang.opt: Add -fexceptions.

gcc/testsuite/ChangeLog:

	* gdc.dg/pr110471a.d: New test.
	* gdc.dg/pr110471b.d: New test.
	* gdc.dg/pr110471c.d: New test.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Easy Review GDC Gnu D Compiler
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants