https://gcc.gnu.org/bugzilla/show_bug.cgi?id=79307
--- Comment #4 from Szikra <steven.spark at gmail dot com> ---
> This is bug 44974.
>
> > Possible duplicate of bug #44859 or bug #51270.
>
> Looks more like bug 49974 to me.
>
> *** This bug has been marked as a duplicate of bug 44974 ***
Hi you are right, my first example is the same as in bug 49974:
struct Y {
Y(int& i) : r(i) { }
int& r;
};
If that were fixed, it would probably solve both problem.
Though my second case might be easier to detect, or it's more obviously wrong
:)
struct TestRefIntDirect {
TestRefIntDirect(int a) : a_(a) {};
const int& a_;
};
This is wrong by in itself, in this case temporary is always created and in the
same place where it is used.
But I have a problem:
Shouldn't this be marked as duplicate of bug 49974 and not bug 44974? :)