Can someone point me to the correct bug report?

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Can someone point me to the correct bug report?

Luca Bacci
Hi, I think I've hit a bug in g++ that has already been resolved recently,
because it works ok on current g++, but still I encounter it on older
supported distributions and in GitLab CI tests.

typedef int int_alias;

class A
{
public:
    operator int();
    operator int_alias() const;
};

A::operator int() {
    return 0;
}

A::operator int_alias() const {
    return 1;
}


When I copmpile it with older g++ I get the error:
error: prototype for ‘A::operator int_alias() const’ does not match any in
class ‘A’
error: candidates are: A::operator int()
error:                 A::operator int_alias() const

In reality, I am using Gtkmm3. and in my class I have user defined
conversion to Gtk::TreeModel::iterator and Gtk::TreeModel::const_iterator.
In Gtkmm3 Gtk::TreeModel::const_iterator is not a real different type, it
is just a typedef to Gtk::TreeModel::iterator. In Gtkmm4 const_iterator has
become a different type.

Can someone point me to the bug report for this? It would be great to add
this as reference in the commit message. Thank you very much.

Luca
Reply | Threaded
Open this post in threaded view
|

Re: Can someone point me to the correct bug report?

Jonathan Wakely-4
On Sat, 13 Oct 2018 at 13:01, Luca Bacci <[hidden email]> wrote:

>
> Hi, I think I've hit a bug in g++ that has already been resolved recently,
> because it works ok on current g++, but still I encounter it on older
> supported distributions and in GitLab CI tests.
>
> typedef int int_alias;
>
> class A
> {
> public:
>     operator int();
>     operator int_alias() const;
> };
>
> A::operator int() {
>     return 0;
> }
>
> A::operator int_alias() const {
>     return 1;
> }
>
>
> When I copmpile it with older g++ I get the error:
> error: prototype for ‘A::operator int_alias() const’ does not match any in
> class ‘A’
> error: candidates are: A::operator int()
> error:                 A::operator int_alias() const
>
> In reality, I am using Gtkmm3. and in my class I have user defined
> conversion to Gtk::TreeModel::iterator and Gtk::TreeModel::const_iterator.
> In Gtkmm3 Gtk::TreeModel::const_iterator is not a real different type, it
> is just a typedef to Gtk::TreeModel::iterator. In Gtkmm4 const_iterator has
> become a different type.
>
> Can someone point me to the bug report for this? It would be great to add
> this as reference in the commit message. Thank you very much.

It was fixed by commit https://gcc.gnu.org/r251340 which doesn't
reference any bug report.
Reply | Threaded
Open this post in threaded view
|

Re: Can someone point me to the correct bug report?

Luca Bacci
Allright, thank you very much!!

Luca


Il giorno sab 13 ott 2018 alle ore 14:07 Jonathan Wakely <
[hidden email]> ha scritto:

> On Sat, 13 Oct 2018 at 13:01, Luca Bacci <[hidden email]> wrote:
> >
> > Hi, I think I've hit a bug in g++ that has already been resolved
> recently,
> > because it works ok on current g++, but still I encounter it on older
> > supported distributions and in GitLab CI tests.
> >
> > typedef int int_alias;
> >
> > class A
> > {
> > public:
> >     operator int();
> >     operator int_alias() const;
> > };
> >
> > A::operator int() {
> >     return 0;
> > }
> >
> > A::operator int_alias() const {
> >     return 1;
> > }
> >
> >
> > When I copmpile it with older g++ I get the error:
> > error: prototype for ‘A::operator int_alias() const’ does not match any
> in
> > class ‘A’
> > error: candidates are: A::operator int()
> > error:                 A::operator int_alias() const
> >
> > In reality, I am using Gtkmm3. and in my class I have user defined
> > conversion to Gtk::TreeModel::iterator and
> Gtk::TreeModel::const_iterator.
> > In Gtkmm3 Gtk::TreeModel::const_iterator is not a real different type, it
> > is just a typedef to Gtk::TreeModel::iterator. In Gtkmm4 const_iterator
> has
> > become a different type.
> >
> > Can someone point me to the bug report for this? It would be great to add
> > this as reference in the commit message. Thank you very much.
>
> It was fixed by commit https://gcc.gnu.org/r251340 which doesn't
> reference any bug report.
>