Thread overview
[Issue 20339] isPOD returns true if sizeof is accessed inside struct declaration
Oct 31, 2019
Dlang Bot
Dec 17, 2022
Iain Buclaw
Dec 21, 2023
Tim
Dec 21, 2023
Dlang Bot
Dec 21, 2023
Dlang Bot
October 31, 2019
https://issues.dlang.org/show_bug.cgi?id=20339

Dlang Bot <dlang-bot@dlang.rocks> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull

--- Comment #1 from Dlang Bot <dlang-bot@dlang.rocks> ---
@SSoulaimane updated dlang/dmd pull request #10519 "Fix issue 20339 - recalculate isPOD at the end of semantic analysis" fixing this issue:

- Fix issue 20339 - Defer isPOD and argtypes calculation till the end of semantic analysis

  In addition to incorrect results being returned, the ABI is affected with
regards to argument passing.

https://github.com/dlang/dmd/pull/10519

--
December 17, 2022
https://issues.dlang.org/show_bug.cgi?id=20339

Iain Buclaw <ibuclaw@gdcproject.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Priority|P1                          |P3

--
December 21, 2023
https://issues.dlang.org/show_bug.cgi?id=20339

Tim <tim.dlang@t-online.de> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           See Also|                            |https://issues.dlang.org/sh
                   |                            |ow_bug.cgi?id=24292

--
December 21, 2023
https://issues.dlang.org/show_bug.cgi?id=20339

--- Comment #2 from Dlang Bot <dlang-bot@dlang.rocks> ---
@tim-dlang created dlang/dmd pull request #15939 "Calculate isPOD without information from semantic run" fixing this issue:

- Calculate isPOD without information from semantic run

  Fix issue 20339 - isPOD returns true if sizeof is accessed inside struct
declaration
  Fix issue 24292 - Struct with destructor wrongly returned in register

  Function StructDeclaration.isPOD can be called before the semantic run
  for the struct is finished. It then uses incomplete information about
  destructors, postblits and copy constructors. The result of isPOD is
  cached, so later calls will also return the wrong result.

  This commit changes isPOD, so it uses variables, which are already
  filled before the semantic run.

https://github.com/dlang/dmd/pull/15939

--
December 21, 2023
https://issues.dlang.org/show_bug.cgi?id=20339

Dlang Bot <dlang-bot@dlang.rocks> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #3 from Dlang Bot <dlang-bot@dlang.rocks> ---
dlang/dmd pull request #15939 "Fixes issues 20339, 24292: Calculate isPOD without information from semantic run" was merged into master:

- 3364291b569ea832091f576d354c6e4d598315ab by Tim Schendekehl:
  Fixes issues 20339, 24292: Calculate isPOD without information from semantic
run

  Issue 20339: isPOD returns true if sizeof is accessed inside struct
declaration
  Issue 24292: Struct with destructor wrongly returned in register

  Function StructDeclaration.isPOD can be called before the semantic run
  for the struct is finished. It then uses incomplete information about
  destructors, postblits and copy constructors. The result of isPOD is
  cached, so later calls will also return the wrong result.

  This commit changes isPOD, so it uses variables, which are already
  filled before the semantic run.

https://github.com/dlang/dmd/pull/15939

--