d: Warn when casting from a D class to a C++ class.
authorIain Buclaw <ibuclaw@gdcproject.org>
Tue, 8 Sep 2020 15:15:33 +0000 (17:15 +0200)
committerIain Buclaw <ibuclaw@gdcproject.org>
Thu, 10 Sep 2020 16:04:11 +0000 (18:04 +0200)
commit29ff25e70671ce2046aab5cf89bf519ec6cf2bed
tree0b0c7ca07dfe2772afb2b5f3b73b785e297efd3b
parente63eb26d22dbbbbb67f7f240ea5a7234cd2498cb
d: Warn when casting from a D class to a C++ class.

Before, the warning was only issued when casting in the other direction.
Now a warning is printed for both directions.

gcc/d/ChangeLog:

* d-convert.cc (convert_expr): Warn when casting from a D class to a
C++ class.

gcc/testsuite/ChangeLog:

* gdc.dg/Waddress.d: New test.
* gdc.dg/Wcastresult1.d: New test.
* gdc.dg/Wcastresult2.d: New test.
gcc/d/d-convert.cc
gcc/testsuite/gdc.dg/Waddress.d [new file with mode: 0644]
gcc/testsuite/gdc.dg/Wcastresult1.d [new file with mode: 0644]
gcc/testsuite/gdc.dg/Wcastresult2.d [new file with mode: 0644]