Thread overview
[dmd-internals] Bring constructor declarations back in C++ header files
Jan 29, 2017
Johan Engelen
Jan 30, 2017
Martin Nowak
Jan 30, 2017
Johan Engelen
January 29, 2017
Hi all,
  Why were the constructor declarations removed in the C++ header files in
2.072?
It leads to massive warning spam, and enables default
constructors............

Please enable C++ warnings in your DMD development setups. There are other
serious errors in the header files that would have been easily caught with
warnings on, e.g.:
```
../ddmd/attrib.h:48:17: warning: 'AttribDeclaration::kind' hides overloaded
virtual function [-Woverloaded-virtual]
    const char *kind() const;
                ^
../ddmd/dsymbol.h:214:25: note: hidden overloaded virtual function
'Dsymbol::kind' declared here: different qualifiers (none vs const)
    virtual const char *kind();
```

Thanks,
  Johan


January 30, 2017
On 01/29/2017 10:43 PM, Johan Engelen via dmd-internals wrote:
> Hi all,
>   Why were the constructor declarations removed in the C++ header files
> in 2.072?

Because classes are always constructed by D code.
Guess it was simply an oversight.
How about deleting default constructors (like needs some alternative
macro for dmc support)?




January 30, 2017
On Mon, Jan 30, 2017 at 5:18 PM, Martin Nowak via dmd-internals < dmd-internals@puremagic.com> wrote:

> On 01/29/2017 10:43 PM, Johan Engelen via dmd-internals wrote:
> > Hi all,
> >   Why were the constructor declarations removed in the C++ header files
> > in 2.072?
>
> Because classes are always constructed by D code.
>

I was hoping there was a better reason than that.


> Guess it was simply an oversight.
> How about deleting default constructors (like needs some alternative
> macro for dmc support)?
>

Also works.