mirror of
https://github.com/dlang/dmd.git
synced 2025-04-26 13:10:12 +03:00
fix Issue 23574 - ICE: AssertError@src/dmd/optimize.d(866): Assertion failure (#14736)
This commit is contained in:
parent
89551057e6
commit
9b4c82e516
2 changed files with 43 additions and 1 deletions
|
@ -862,7 +862,8 @@ Expression Expression_optimize(Expression e, int result, bool keepLvalue)
|
|||
return returnE_e1(); // can always convert a class to Object
|
||||
// Need to determine correct offset before optimizing away the cast.
|
||||
// https://issues.dlang.org/show_bug.cgi?id=16980
|
||||
cdfrom.size(e.loc);
|
||||
if (cdfrom.size(e.loc) == SIZE_INVALID)
|
||||
return error();
|
||||
assert(cdfrom.sizeok == Sizeok.done);
|
||||
assert(cdto.sizeok == Sizeok.done || !cdto.isBaseOf(cdfrom, null));
|
||||
int offset;
|
||||
|
|
41
compiler/test/fail_compilation/fail23574.d
Normal file
41
compiler/test/fail_compilation/fail23574.d
Normal file
|
@ -0,0 +1,41 @@
|
|||
// https://issues.dlang.org/show_bug.cgi?id=23574
|
||||
/*
|
||||
TEST_OUTPUT:
|
||||
---
|
||||
fail_compilation/fail23574.d(26): Error: function `object._xopEquals` has no `return` statement, but is expected to return a value of type `bool`
|
||||
Error: undefined identifier `size_t` in module `object`
|
||||
fail_compilation/fail23574.d(34): Error: template instance `object.S17915!(MyClass)` error instantiating
|
||||
fail_compilation/fail23574.d(30): Error: function `object.SDL_GetKeyName` has no `return` statement, but is expected to return a value of type `const(char)`
|
||||
---
|
||||
*/
|
||||
module object;
|
||||
|
||||
class Object
|
||||
{
|
||||
}
|
||||
|
||||
bool opEquals(LHS, RHS)(LHS lhs, RHS)
|
||||
{
|
||||
opEquals(cast()lhs);
|
||||
}
|
||||
|
||||
class TypeInfo
|
||||
{
|
||||
}
|
||||
|
||||
bool _xopEquals()
|
||||
{
|
||||
}
|
||||
|
||||
const(char)SDL_GetKeyName()
|
||||
{
|
||||
class MyClass
|
||||
{
|
||||
S17915!MyClass m_member;
|
||||
}
|
||||
}
|
||||
|
||||
struct S17915(T)
|
||||
{
|
||||
T owner;
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue