Explicit mangling provided via `pragma(mangle, "..")` cannot be mapped
to C++. For `extern(C)` function it's possible to emulate the behavior
by replacing the identifier with the custom mangling. This doesn't work
for `extern(C++)` functions, so they are ignored.
The same rationale + solution applies to global variables with custom
mangling.
Ensure that `__traits(parameters)` consistently returns the parameters
of the enclosing function and instead of the parameters of the
`opApply` delegate (leaking an implementation detail).
Also added a bunch of tests - the parts hidden by `version (Fixed)`
fail due to another bug.
A common misunderstanding is the difference between scope at the usage site
and scope on class declaration. So be extra verbose to let the user know
what is deprecated and what is not. Also remove the mention of structs,
as 'scope' on struct doesn't seem to have any effect, and many people
don't even know it is possible.
* WIP: Remove -unittest special cases wrt. template emission
* WIP
* WIP2
* WIP3
* WIP4
* WIP5
* Print full compiler command-line in case building the unit_test_runner executable fails
* WIP6
* WIP7
* Ignore unittest blocks in non-root modules
* Temporary: Test with enforced -allinst
* Revert "Temporary: Test with enforced -allinst"
This reverts commit 6f1a5302d7cb981654e55722860fae0ddadbbc07.
* Add comment as to why unittests in non-root modules are ignored
And ignore them for doDocComments/doHdrGeneration too, for
consistency.
* Add changelog entry
* Produce MS Coff by default when targetting windows
This rebases #12825 but doesn't attempt to rename phobos libraries and doesn't change the build infra where possible(and doesn't have a large diff in `link.d`). See if this fixes the CI issues.
* remove OMF piplines
* Update glue.d
* Update target.d
* Update target.d
* Update frontend.h
Currently DMD does not allow casting to TypeTuple even if they
are the same type is.
This is a bit odd, so only allow it in certain case.
Co-authored-by: Boris Carvajal <boris2.9@gmail.com>
Co-authored-by: Razvan Nitu <razvan.nitu1305@gmail.com>
* Set the preview switch fix16997 to true now.
* Add preview switch.
* Fix test suit
* Fix the reverthelp.d test
* Auto gen the frontend
* Fix changelog/fix16997.dd
* Corrected frontend.h
* Update fix16997.dd
Modify changelog
* Fix trimming of spaces for changelog/fix16997.dd
* Update fix16997.dd
Fix Title description tile for changelog and move some text around
* Remove empty line
* Update fix16997.dd
add markdown
* Update fix16997.dd
* single quotes
Co-authored-by: MoonlightSentinel <moonlightsentinel@disroot.org>
`__traits(initSymbol, S)` was introduced in ldc-developers/ldc#3774 and
provides access to the initializer symbol of `S` in a way that does not
rely on `TypeInfo` or other hacks.
This commit contains some small adjustments to the initial patch which
improve the user experience:
- generated `VarExp` points to the `TraitsExp` instead of the symbol LoC
- CTFE issues a specific error message
- rejects interfaces because they don't have an initializer symbol and
hence cause linker failures
- more extensive tests
Co-authored-by: Nicholas Wilson <iamthewilsonator@hotmail.com>
The error has now been moved to the grammar. However there are new
deprecations for when the only remaining allowed use of allocators is
not explicitly `@disable new();`
* Add .i extension for preprocessed C files to known set of file extensions
Added .i as extension for preprocessed C files, which can be fed directly
to DMD. The file is then processed as C source file.
Supporting .i as file exzension allows to preprocess C code with GCC -E and
store the output to some file for further processing by DMD.
* Update existing Changelog on 'importc' feature.
Add some example on how to use the '.i' suffix instead of the '.c' suffix
for C files using C includes. Result of C preprocessor can be saved as
'.i' file and used as input to DMD.
* Add some first simple test for importc with .i files passed on cmdline
* Hide preprocessed C files
* Changed importc test to use .i.in file to fake preprocessor
TODO: Find some preprocessor, which works on Windows and Max targets.
Co-authored-by: Carsten Schlote <carsten.schlote@leica-camera.com>
... static members.
This ensures that the header generator writes the required prefix for
`__gshared` variables and also prevents the emission of static functions
outside of the enclosing aggregate.
... length is a constant (instead of a literal).
`int[SomeLength]` is parsed as `TypeAArray` even if `SomeLength` is later
resolved to be an integral constant instead of a type. This caused the
visitor to emit such symbols as `void*`.
This commit checks for such types and tries to resolve the "key" to
determine if it's actually an associative array.