Bug fix: Fixed a bug in class template compilation causing access violation in compiler.
Bug fix: Removed flashing console window when building projects in CmDevEnv.
Bug fix: JSON parser did not accept empty array and empty object.
Bug fix: Consider the following program:
using System;
abstract class Component
{
public Component()
{
}
public default virtual ~Component();
public string Addr()
{
return ToHexString(cast<ulong>(cast<void*>(this)));
}
public abstract void Boom();
}
class Container
{
public nothrow Container(Component* parent_) : parent(parent_)
{
}
public void Fail()
{
Console.Out() << ">Container.Fail()" << endl();
parent->Fail();
Console.Out() << "<Container.Fail()" << endl();
}
public Component* parent;
}
class ToFail : Component
{
public ToFail(const string& text_) : base(), text(text_), container(this)
{
}
public nothrow Container& GetContainer()
{
return container;
}
public ~ToFail()
{
Console.Out() << "destructor ~ToFail() " << Addr() << " called" << endl();
}
public override void Fail()
{
Console.Out() << ">ToFail.Fail: " << Addr() << endl();
Console.Out() << "<ToFail.Fail: " << Addr() << endl();
}
public string text;
public Container container;
}
void main()
{
Console.Out() << "start" << endl();
UniquePtr<ToFail> toFail(new ToFail(ToString(1)));
Console.Out() << "toFail addr is " << toFail->Addr() << endl();
Console.Out() << "toFail container parent addr is " << toFail->container.parent->Addr() << endl();
toFail->GetContainer().Fail();
Console.Out() << "end" << endl();
}
Because ToString(1) returns an rvalue, the compiler erroneously generated a move constructor for the ToFail class and called it after converting the string to a ToFail object. This has been fixed now so that move constructor is not generated and called, but ToFail.ToFail(const string&) constructor is just called with a string argument as expected.
Before the fix, the program above printed the following lines and crashed:
D:\work\bug>bin\debug\bug
start
destructor ~ToFail() 00000038913FF888 called
toFail addr is 00000210D28CC780
toFail container parent addr is 00000038913FF888
>Container.Fail() // <--- access violation
Now the program prints:
D:\work\bug>bin\debug\bug
start
toFail addr is 0000024F7DE191E0
toFail container parent addr is 0000024F7DE191E0
>Container.Fail()
>ToFail.Fail: 0000024F7DE191E0
<ToFail.Fail: 0000024F7DE191E0
<Container.Fail()
end
destructor ~ToFail() 0000024F7DE191E0 called
Fixed a couple of IDE bugs
The debugger has now conditional breakpoints.
New tool: supd for synchronizing parallel source code directory trees.
Decided to drop TLS support on Windows.
Installation instructions updated.
Includes first version of Cmajor Code, a new IDE for Windows written in Cmajor.
Instructions for setting up compiler development environment on Windows and compiling the compiler and tools from sources.
Occasionally you may get the following internal error when compiling the system library with the compiler with the C++ backend: "Error: class 'String