Bug 8627 – ICE(cgcs.c): indexing a returned value of type float[1]
Status
RESOLVED
Resolution
DUPLICATE
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2012-09-07T01:44:00Z
Last change time
2012-09-13T07:49:33Z
Keywords
ice
Assigned to
nobody
Creator
blooh_
Comments
Comment #0 by blooh_ — 2012-09-07T01:44:05Z
The code below errors with an internal error:
// ------------------------------
import std.stdio;
class Test
{
public:
auto whatever()
{
float[1] tmp;
return tmp;
}
}
void main()
{
auto test = new Test;
writeln( test.whatever()[0] );
}
// ------------------------------
This looks quite simple, hopefully I'm not doing anything wrong?
It's working when I initialize tmp with a size of at least 3 elements.
Cheers,
Christopher.
Comment #1 by clugdbug — 2012-09-13T07:14:11Z
When you see an internal error, you're NEVER doing something wrong.
Reduced test case:
-------------------
float[1] bug8627()
{
float[1] tmp;
return tmp;
}
void test8627()
{
float f = bug8627()[0];
}
Internal error: ../ztc/cgcs.c 343
Dropping importance to normal, because the importance is already covered by the ICE keyword.
Comment #2 by clugdbug — 2012-09-13T07:49:33Z
And it's a duplicate anyway.
*** This issue has been marked as a duplicate of issue 4414 ***