Revert "Fix #21024 - Optimize x^^c expressions (#21082)" (#21114)

This reverts commit fa1f860e4b.
This commit is contained in:
Dennis 2025-03-29 12:25:53 +01:00 committed by GitHub
parent fa1f860e4b
commit 8dcef66a5f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 0 additions and 151 deletions

View file

@ -1,38 +0,0 @@
/*
TEST_OUTPUT:
---
fail_compilation/powinline.d(25): Error: cannot implicitly convert expression `(a + 5.0) ^^ 2L` of type `double` to `int`
fail_compilation/powinline.d(26): Error: cannot implicitly convert expression `(1.0 / foo()) ^^ 2L` of type `double` to `int`
fail_compilation/powinline.d(31): Error: void has no value
fail_compilation/powinline.d(31): Error: incompatible types for `(5.0) * (bar())`: `double` and `void`
fail_compilation/powinline.d(37): Error: cannot modify `immutable` expression `a`
---
*/
double foo()
{
return 5.0;
}
void bar()
{
return;
}
void test1()
{
double a = 2.0;
int b = (a + 5.0) ^^ 2.0;
b = (1 / foo()) ^^ 2.0;
}
void test2()
{
double a = (5.0 * bar()) ^^ 2.0;
}
void test3()
{
immutable double a = 3.0;
(a ^^= 2.0) = 6;
}