<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 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>Yeah, my current take on it is: yeah, some 'explicit' on multi-arg ctors is probably accidental, but it's not pointless so removing it isn't entirely trivial. But adding explicit to every no-arg ctor you don't want to call with braced init seems... painfully verbose, so I've not taken a strong stance that we should do that either.<br><br>And I /think/ MSVC still doesn't support braced init, so it's all a bit of an abstract debate for the LLVM codebase for now anyway.<br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a> <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
<br></blockquote></div><br></div></div>