<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Mar 14, 2015 at 10:51 PM, Chandler Carruth <span dir="ltr"><<a href="mailto:chandlerc@google.com" target="_blank">chandlerc@google.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div><div class="h5"><br><div class="gmail_quote">On Sat, Mar 14, 2015 at 10:26 PM, Gabriel Dos Reis <span dir="ltr"><<a href="mailto:gdr@integrable-solutions.net" target="_blank">gdr@integrable-solutions.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi,<div><br></div><div>Some LLVM classes (e.g. ReturnInst) have explicit constructors with at least two parameters (with no default arguments).   Why is that?  E.g. what are they trying to prevent?</div><div><br></div><div>-- Gaby</div><div></div></div></blockquote></div><br></div></div>FWIW, I suspect that it is mostly an accident (IE, one of the arguments was added without removing the explicit or a default was removed, etc.)</div></div></blockquote><div><br></div><div>OK, that sounds like it; thanks.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><br></div><div class="gmail_extra">However, there are good reasons for this in C++11 -- making constructors explicit prevents them from being called in return statements like "return {a, b};".</div></div>
</blockquote></div><br></div><div class="gmail_extra">Err, if I can have "return T(a, b);", I am curious about what mistakes (in LLVM codebase) are being prevented by refusing "return { a, b };" -- I tend to write mostly only the brace these days, so I'm curious about where the potholes are.</div><div class="gmail_extra"><br></div><div class="gmail_extra"><br></div><div class="gmail_extra">-- Gaby</div><div class="gmail_extra"><br></div></div>