Commit graph

239 commits

Author SHA1 Message Date
Nick Treleaven
bb638373d6
Fix Issue 15436 - Compiler still refers to AliasSeq-s as "tuple"-s (#15363)
* Fix Issue 15436 - Compiler still refers to AliasSeq-s as "tuple"-s

Replace "tuple type" with "type sequence".
Replace "tuple" with "sequence".
Pretty print `AliasSeq!(args)`, not `tuple(args)`.
Leave json as "tuple" for now.
Also mention std.typecons.Tuple when trying to return a sequence.

Note: This does not rename any internal compiler symbols.

* Update runnable tests

* Update stringof tests

* Update remaining tests

* retrigger tests
2023-06-30 11:02:00 +03:00
Razvan Nitu
7247bb725c
Fix Issue 24017 - Bypassing nothrow with debug doesn’t work (#15355)
* Fix Issue 24017 - Bypassing  with  doesn’t work

* Update compiler/src/dmd/expressionsem.d

Co-authored-by: Dennis <dkorpel@users.noreply.github.com>

---------

Co-authored-by: Dennis <dkorpel@users.noreply.github.com>
2023-06-27 17:24:29 +02:00
FeepingCreature
9bf123c704
Fix issue 24018: set length manually via runtime function. (#15354)
* Fix issue 24018: make `array.length = n` `@system` if default construction is disabled on the array type.
This is needed as there is otherwise no good way to resize an array of non-constructable elements in user code at all.

* Fix issue 24018: instead of calling `array.length =`, call the runtime function that implements `array.length =` instead.
This skips the check for the element type being constructable, which is correct because concatenation doesn't expose unconstructed memory anyway.
2023-06-27 15:51:07 +03:00
Dennis
a612593c4d
Fix 20008 - __traits(allMembers) of packages is complete nonsense (#15335) 2023-06-27 09:45:00 +03:00
Dennis
530e41b7a0
Refer to bugzilla issues by hyperlink (#15328) 2023-06-16 14:48:47 +03:00
Iain Buclaw
b71237be65 Merge remote-tracking branch 'upstream/stable' into merge_stable 2023-06-15 22:13:48 +00:00
Martin Kinkelin
dce1331016
[stable] Fix compilable/stdcheaders.c for Linux AArch64 (#15320)
* Linux AArch64: Don't define _Float128/__float128 in importc.h

For LDC CI, on Ubuntu 20.04, this fixed:
```
/usr/include/aarch64-linux-gnu/bits/floatn.h(80): Error: illegal combination of type specifiers
/usr/include/aarch64-linux-gnu/bits/floatn.h(80): Error: illegal type combination
```
when testing `compilable/stdcheaders.c`.

* Linux AArch64: Don't include tgmath.h in compilable/stdcheaders.c
2023-06-14 08:42:57 +03:00
Walter Bright
342a226833
fix Issue 23988 - Conditional Exp does not bring enums to correct common type if one leg is const (#15316) 2023-06-13 15:04:26 +03:00
Dennis Korpel
eeaeb89ba5 Fix 23986 - ICE: dip1021 asserts on typeof(null) parameter 2023-06-11 06:52:08 +08:00
Dennis
167b050429
Fix 23978 - ICE: EscapeBy[] is malloced, but contains GC-allocated objects (#15302) 2023-06-10 20:15:55 +02:00
Dennis
5e1833a279
Fix 23979 - ICE on failed alias this attempt on pointer expression (#15300) 2023-06-10 19:32:52 +02:00
Ernesto Castellotti
d05cf56768
Fix issue 23948 - __FILE__ and __MODULE__ cannot be implicitly converted to const(char)* as default paramenter (#15283) 2023-05-31 13:37:05 +03:00
Walter Bright
2c9ee67429
fix Issue 23935 - ImportC: __pragma not allowed between struct and tag name (#15279) 2023-05-30 19:01:18 +03:00
Walter Bright
90e89fce06 fix Issue 23936 - ImportC: pragma pack is not working for structs 2023-05-30 08:40:47 +02:00
Razvan Nitu
a19be2d341
Fix Issue 23914 - auto ref resolution on return value prevented by noreturn (#15240) 2023-05-19 10:54:22 +03:00
Atila Neves
77acdca78c Make atomicStore work with -preview=nosharedaccess 2023-05-19 01:01:24 +02:00
RazvanN7
c67bb5945b Fix Issue 23912 - Destructor disables scope inference 2023-05-16 21:51:03 +02:00
Walter Bright
085980206a Revert "Revert "fix Issue 23875 23880 (#15172)" (#15196)"
This reverts commit 7da9317495.
2023-05-16 18:47:47 +03:00
Iain Buclaw
edfa97d800 Merge remote-tracking branch 'upstream/stable' into merge_stable 2023-05-16 10:17:06 +00:00
Walter Bright
16ec7b681b
fix Issue 23913 - __traits(getMember) fails for some C symbols (#15234) 2023-05-16 10:07:19 +03:00
Nick Treleaven
9e471ea9bd Remove deprecated test that is in fail_compilation 2023-05-10 23:19:39 +02:00
Dennis Korpel
928a03bd14 Turn overloading extern(C) functions into an error 2023-05-10 16:48:32 +02:00
Paul Backus
946079235d Allow alias this to use assignment-style syntax
When assignment-style syntax for alias declarations was first
implemented in DMD 2.061 [1][2], `alias this = identifier;` was accepted
as equivalent to the existing `alias identifier this;`. One release
later, in DMD 2.062, it was removed. [3]

The rationale for this change, given in both the changelog [4] and a
related spec PR thread [5], was to allow for the possibility that, in
the future, the syntax `alias this = super.this;` might be used to merge
a derived class's constructor overload set with that of its base class.
However, this proposal was never implemented, and seems to have been
abandoned in the intervening years.

For the sake of consistency, and since the rationale for its removal no
longer applies, this commit reinstates `alias this = identifier;` as
valid syntax for an `alias this` declaration.

[1] https://github.com/dlang/dmd/pull/1187
[2] https://dlang.org/changelog/2.061.html
[3] https://github.com/dlang/dmd/pull/1413
[4] https://dlang.org/changelog/2.062.html
[5] https://github.com/dlang/dlang.org/pull/200#issuecomment-11711854
2023-05-10 11:43:19 +02:00
Dennis
7da9317495
Revert "fix Issue 23875 23880 (#15172)" (#15196)
This reverts commit c3a960da8b.
2023-05-07 13:53:18 -07:00
Razvan Nitu
4a4adcd81a
Fix Issue 22760 - Segmentation fault in CppMangleVisitor.template_arg (#15099) 2023-05-05 11:05:27 +03:00
Walter Bright
c3a960da8b
fix Issue 23875 23880 (#15172) 2023-05-05 10:20:29 +03:00
Razvan Nitu
f467b26074
Fix Issue 23874 - -profile=gc segfaults / ICE regression (#15179) 2023-05-05 10:19:36 +03:00
Walter Bright
5dd9b1885f
fix Issue 23879 - ImportC: Windows system headers use __alignof (#15174) 2023-05-04 12:54:28 +03:00
RazvanN7
6d0a9a5607 Fix Issue 23874 - -profile=gc segfaults / ICE regression 2023-05-02 14:27:57 +02:00
Walter Bright
b584843046 fix Issue 23871 - ImportC: __attribute not recognized 2023-05-02 06:06:57 +02:00
Walter Bright
af9e8a0764 fix Issue 23870 - ImportC doesn't accept '\' followed by newline, whereas VC does 2023-05-02 00:10:31 +02:00
Iain Buclaw
57046d0aa6
Merge pull request #15156 from ibuclaw/merge_stable
merge stable
2023-05-01 21:33:31 +02:00
Iain Buclaw
0325bdcb9d Merge remote-tracking branch 'upstream/stable' into merge_stable 2023-05-01 17:22:00 +00:00
Dennis Korpel
760f297924 Fix 19454 - Name collisions with unnamed function parameters 2023-05-01 18:42:25 +02:00
Walter Bright
632a011f11 fix Issue 23866 - ImportC: Multiple __declspecs rejected 2023-04-30 10:17:12 +02:00
Razvan Nitu
d11ec36040
Fix Issue 23863 - typeof rejects AliasSeq!() as argument (#15140) 2023-04-29 22:35:14 +03:00
Teodor Dutu
1db1ba87fd
Translate _d_arraycatnTX to a template (#14550)
This brings the following changes:
- Improves the existing template `_d_arraycatnTX`, to now concatenates
both arrays and single elements
- Changes the lowerings to `_d_arraycatT` to use the new template
- Moves the lowering logic to `_d_arraycatnTX` to expressionsem.d
- Adds a new field to `CatExp` called `lowering` to store the template
  lowering
- Removes the old non-template `_d_arraycatnTX` and `_d_arraycatT` hooks
- Moves `test19688.d` from `runnable/` to `compilable/` until
https://issues.dlang.org/show_bug.cgi?id=23408 is fixed

Signed-off-by: Teodor Dutu <teodor.dutu@gmail.com>
2023-04-28 10:33:48 +03:00
Walter Bright
2d7091aa40
ImportC: support __attribute__((always_inline)) (#15134) 2023-04-27 12:05:56 -07:00
Walter Bright
0455553f82
fix Issue 23862 - with statement should accept an expression with enum type (#15131) 2023-04-26 11:58:59 +03:00
Razvan Nitu
7dfafe6dd9
Fix Issue 19706 - Attribute inference in struct fails (#15129) 2023-04-26 11:36:53 +03:00
Razvan Nitu
4531b0c6ca
Fix Issue 20090 - Header generation wrongfully outputs constructor bodies (#15115) 2023-04-19 13:26:11 +03:00
Walter Bright
3981bdcd15
fix Issue 22960 - importC: K&R-style functions assume variadic calling convention (#15107) 2023-04-19 10:51:31 +03:00
Dennis
8f9e710ff9
Fix 21667 - scope parameter causes 'no size because of forward references' (#14561) 2023-04-17 12:59:44 +03:00
Walter Bright
c170baf978
fix Issue 23427 - ImportC: some bitfield combinations lead to wrong size struct (#15110) 2023-04-17 12:42:44 +03:00
Razvan Nitu
bd23d5972b
Fix Issue 22739 - Segmentation fault in CppMangleVisitor.headOfType (#15098) 2023-04-13 18:11:04 +03:00
Walter Bright
c0badf0361
ImportC: support noinline (#15103) 2023-04-12 23:44:44 -07:00
Walter Bright
1ab73cecf5
ImportC: support dllimport, dllexport, naked attributes (#15048)
* ImportC: add more support for naked, dllimport, dllexport

* ImportC: support dllimport, dllexport, naked attributes
2023-04-12 13:04:15 -07:00
Walter Bright
5cd6f80d06
fix Issue 23715 - ImportC: No rejection of _Thread_local variables declared at function scope without 'static' as per C11 6.2.4-5 (#15094) 2023-04-10 16:53:38 -07:00
Walter Bright
b571a1a118
fix Issue 23509 - ImportC: need statement expressions extension for GLibC's assert() (#15093) 2023-04-10 10:35:55 -07:00
Walter Bright
c32e70d7b5
ImportC: support __attribute__((aligned(N))) (#15047) 2023-04-09 15:33:06 -07:00