Fixes https://github.com/dlang/dmd/issues/20423
Ultimate cause of this issue was that va_arg was being shadowed
by the collected template-like macros. As va_arg is not a normal
function (it takes a type as a parameter), this interfered with
the cparser's rewrite of va_arg to a call to the single argument
template version in core.stdc.stdarg.
Fixes: https://github.com/dlang/dmd/issues/20334
After preprocessing, #defines in C code that are just string literals
are converted into D enums. As these are collected for use in D code,
they should behave like D string literals and not C string literals.
Resolves https://github.com/dlang/dmd/issues/20434
Allowing this gnu/clang extension actually removes lines of code as
we can unify the parsing and semantics of `_Alignof` and `sizeof`
and have the normal D machinery handle the difference later.
Fixes https://github.com/dlang/dmd/issues/20472
Arrays in C implicitly convert to a pointer to their first member,
so do the implicit conversion when using them in an arrow member lookup.
The gnu attribute aligned() allows specifying the alignment of an entire
struct, mostly as a syntatic convenience. This attribute allows
compile-time integer expressions, but the parser was trying to evaluate them
ahead of time by checking for an integer literal. Instead we need to
preserve the expression and defer it to a later semantic stage.
Accomplish this by emulating the behavior by specifying the alignment of
the first member of the struct.
I didn't change how __declspec(align(#)) parses as from the
documentation it seems to only allow integer literals. Some light
testing with cl.exe gives syntax errors when trying to use _Alignof() in
that position.
This reverts commit 6a7bd45a8e.
PR #17495 was originally merged in an incomplete state. Since there are
non-trivial obstacles to completing it, revert the incomplete changes
instead.
See PR #20670 for more information.
Introduced in PR #9331, this was changed from a normal bug fix to a
-preview switch because enabling it triggered a suprious "statement is
not reachable" warning in Phobos. That warning has since been removed
(in PR #15568).
Removes code in the lexer responsible for removing leading spaces in
triple slash doc comments.
This affects the test file for issue 14413; two more spaces appear, but
they are not significant in the HTML output.
While updating children's `minst` only going over `members` is not
enough: structs may also have generated methods that are not in
`members`.
As a result, if a generated method instantiates a template, it gets a
poentially wrong `minst`, so can be omitted from the compilation result.
Fixes Bugzilla Issue 24830.
* Document template instance duplication status as part of its field documentation. (#16643)
* Fix Bugzilla 24599 - Wrongly elided TypeInfo emission (#15868)
Reverting #14844, which caused such missing TypeInfos, *and* making
sure the special TypeInfo members are fully analyzed and ready for
codegen (otherwise hitting an assertion for the real-world project).
* Reorganize backend build files to match target and make more similar per line (#16672)
* Remove redundant suggestions on linker errors (#16711)
* Fix bugzilla 24337 - Segfault when printing an int[] cast from a string (#16729)
* Add BitFieldStyle.Gcc_Clang_ARM
Required for 32-bit ARM, and non-Apple 64-bit ARM targets.
The only difference to `Gcc_Clang` is that anonymous and 0-length
bit-fields do contribute to the aggregate alignment.
Caught by existing proper C interop tests in
runnable_cxx/testbitfields.d on such targets. The hardcoded bad tests
in runnable/{bitfieldsposix64.c,dbitfieldsposix64.d} however now fail
after the fix, on such targets again.
* [refactor to `TargetC.contributesToAggregateAlignment(BitFieldDeclaration)` hook]
* Fix Bugzilla Issue 24687 - [REG2.110] Cannot cast string-imports to select overload anymore
* Also make deprecationSupplemental adhere to error limit (#16779)
Co-authored-by: Dennis Korpel <dennis@sarc.nl>
* Fix bugzilla 24699 - [REG2.108] No short-circuit evaluation of mixing template bool argument
* Fix bugzilla 24731 - IFTI cannot handle integer expressions (#16822)
* Fix Bugzilla Issue 24760 - ICE on variadic after default argument
* Fix bugzilla 24790 - -vcg-ast ICE on lowered assign exp (#16914)
Co-authored-by: Dennis Korpel <dennis@sarc.nl>
* Fix bugzilla 24764 - ICE when -vcg-ast prints imported invariant (#16917)
Co-authored-by: Dennis Korpel <dennis@sarc.nl>
* Fix bugzilla 24431 - dmd -vcg-ast crashes printing failed template in… (#16916)
---------
Co-authored-by: Richard (Rikki) Andrew Cattermole <richard@cattermole.co.nz>
Co-authored-by: Martin Kinkelin <kinke@users.noreply.github.com>
Co-authored-by: Dennis <dkorpel@users.noreply.github.com>
Co-authored-by: Martin Kinkelin <mkinkelin@symmetryinvestments.com>
Co-authored-by: Martin Kinkelin <noone@nowhere.com>
Co-authored-by: RazvanN7 <razvan.nitu1305@gmail.com>
Co-authored-by: Dennis Korpel <dennis@sarc.nl>
Co-authored-by: Dennis Korpel <dkorpel@gmail.com>