[cfe-dev] Missing warning when binding to const ref?

Nikola Smiljanic popizdeh at gmail.com
Tue Apr 7 18:11:50 PDT 2015


I'm surprised this doesn't produce a warning:

struct S
{
S(const int& i) : i(i) {}
const int& i;
};

void foo(long l)
{
S s(l); // binding a const ref to temporary
}

int main()
{
foo(1l);
}
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20150408/bad3b610/attachment.html>


More information about the cfe-dev mailing list