<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Tue, Sep 29, 2015 at 7:20 PM, Aaron Ballman <span dir="ltr"><<a href="mailto:aaron@aaronballman.com" target="_blank">aaron@aaronballman.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Tue, Sep 29, 2015 at 10:06 PM, Rui Ueyama via llvm-commits<br>
<<a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a>> wrote:<br>
> Author: ruiu<br>
> Date: Tue Sep 29 21:06:17 2015<br>
> New Revision: 248873<br>
><br>
> URL: <a href="http://llvm.org/viewvc/llvm-project?rev=248873&view=rev" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project?rev=248873&view=rev</a><br>
> Log:<br>
> Remove `explicit` from constructors that take more than one parameter.<br>
<br>
</span>Why? This still has effect for braced initialization, for instance.<br></blockquote><div><br></div><div>For consistency with other code in LLD. These classes or the other classes that don't have `explicit` needed to be changed.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
struct S {<br>
explicit S(int, float) {}<br>
};<br>
<br>
S foo() {<br>
return { 1, 2 }; // ill-formed because of the explicit constructor<br>
}<br>
<br>
int main() {<br>
S s = foo();<br>
}<br>
<span class="HOEnZb"><font color="#888888"><br>
~Aaron<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
><br>
> Modified:<br>
> lld/trunk/ELF/InputFiles.h<br>
> lld/trunk/ELF/Symbols.h<br>
><br>
> Modified: lld/trunk/ELF/InputFiles.h<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/InputFiles.h?rev=248873&r1=248872&r2=248873&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/InputFiles.h?rev=248873&r1=248872&r2=248873&view=diff</a><br>
> ==============================================================================<br>
> --- lld/trunk/ELF/InputFiles.h (original)<br>
> +++ lld/trunk/ELF/InputFiles.h Tue Sep 29 21:06:17 2015<br>
> @@ -41,7 +41,7 @@ public:<br>
> StringRef getName() const { return MB.getBufferIdentifier(); }<br>
><br>
> protected:<br>
> - explicit InputFile(Kind K, MemoryBufferRef M) : MB(M), FileKind(K) {}<br>
> + InputFile(Kind K, MemoryBufferRef M) : MB(M), FileKind(K) {}<br>
> MemoryBufferRef MB;<br>
><br>
> private:<br>
> @@ -52,7 +52,7 @@ enum ELFKind { ELF32LEKind, ELF32BEKind,<br>
><br>
> class ELFFileBase : public InputFile {<br>
> public:<br>
> - explicit ELFFileBase(Kind K, ELFKind EKind, MemoryBufferRef M)<br>
> + ELFFileBase(Kind K, ELFKind EKind, MemoryBufferRef M)<br>
> : InputFile(K, M), EKind(EKind) {}<br>
> static bool classof(const InputFile *F) {<br>
> Kind K = F->kind();<br>
> @@ -71,7 +71,7 @@ protected:<br>
> // .o file.<br>
> class ObjectFileBase : public ELFFileBase {<br>
> public:<br>
> - explicit ObjectFileBase(ELFKind EKind, MemoryBufferRef M)<br>
> + ObjectFileBase(ELFKind EKind, MemoryBufferRef M)<br>
> : ELFFileBase(ObjectKind, EKind, M) {}<br>
> static bool classof(const InputFile *F) { return F->kind() == ObjectKind; }<br>
><br>
> @@ -185,7 +185,7 @@ private:<br>
> // .so file.<br>
> class SharedFileBase : public ELFFileBase {<br>
> public:<br>
> - explicit SharedFileBase(ELFKind EKind, MemoryBufferRef M)<br>
> + SharedFileBase(ELFKind EKind, MemoryBufferRef M)<br>
> : ELFFileBase(SharedKind, EKind, M) {}<br>
> static bool classof(const InputFile *F) { return F->kind() == SharedKind; }<br>
> };<br>
><br>
> Modified: lld/trunk/ELF/Symbols.h<br>
> URL: <a href="http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Symbols.h?rev=248873&r1=248872&r2=248873&view=diff" rel="noreferrer" target="_blank">http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Symbols.h?rev=248873&r1=248872&r2=248873&view=diff</a><br>
> ==============================================================================<br>
> --- lld/trunk/ELF/Symbols.h (original)<br>
> +++ lld/trunk/ELF/Symbols.h Tue Sep 29 21:06:17 2015<br>
> @@ -149,7 +149,7 @@ protected:<br>
> typedef typename Base::Elf_Sym Elf_Sym;<br>
><br>
> public:<br>
> - explicit Defined(Kind K, StringRef N, const Elf_Sym &Sym)<br>
> + Defined(Kind K, StringRef N, const Elf_Sym &Sym)<br>
> : ELFSymbolBody<ELFT>(K, N, Sym) {}<br>
><br>
> static bool classof(const SymbolBody *S) { return S->isDefined(); }<br>
> @@ -162,7 +162,7 @@ template <class ELFT> class DefinedAbsol<br>
> public:<br>
> static Elf_Sym IgnoreUndef;<br>
><br>
> - explicit DefinedAbsolute(StringRef N, const Elf_Sym &Sym)<br>
> + DefinedAbsolute(StringRef N, const Elf_Sym &Sym)<br>
> : Defined<ELFT>(Base::DefinedAbsoluteKind, N, Sym) {}<br>
><br>
> static bool classof(const SymbolBody *S) {<br>
> @@ -180,7 +180,7 @@ template <class ELFT> class DefinedCommo<br>
> public:<br>
> typedef typename std::conditional<ELFT::Is64Bits, uint64_t, uint32_t>::type<br>
> uintX_t;<br>
> - explicit DefinedCommon(StringRef N, const Elf_Sym &Sym)<br>
> + DefinedCommon(StringRef N, const Elf_Sym &Sym)<br>
> : Defined<ELFT>(Base::DefinedCommonKind, N, Sym) {<br>
> MaxAlignment = Sym.st_value;<br>
> }<br>
> @@ -203,8 +203,7 @@ template <class ELFT> class DefinedRegul<br>
> typedef typename Base::Elf_Sym Elf_Sym;<br>
><br>
> public:<br>
> - explicit DefinedRegular(StringRef N, const Elf_Sym &Sym,<br>
> - InputSection<ELFT> &Section)<br>
> + DefinedRegular(StringRef N, const Elf_Sym &Sym, InputSection<ELFT> &Section)<br>
> : Defined<ELFT>(Base::DefinedRegularKind, N, Sym), Section(Section) {}<br>
><br>
> static bool classof(const SymbolBody *S) {<br>
> @@ -219,8 +218,8 @@ template <class ELFT> class DefinedSynth<br>
><br>
> public:<br>
> typedef typename Base::Elf_Sym Elf_Sym;<br>
> - explicit DefinedSynthetic(StringRef N, const Elf_Sym &Sym,<br>
> - OutputSection<ELFT> &Section)<br>
> + DefinedSynthetic(StringRef N, const Elf_Sym &Sym,<br>
> + OutputSection<ELFT> &Section)<br>
> : Defined<ELFT>(Base::DefinedSyntheticKind, N, Sym), Section(Section) {}<br>
><br>
> static bool classof(const SymbolBody *S) {<br>
> @@ -238,7 +237,7 @@ template <class ELFT> class Undefined :<br>
> public:<br>
> static Elf_Sym Synthetic;<br>
><br>
> - explicit Undefined(StringRef N, const Elf_Sym &Sym)<br>
> + Undefined(StringRef N, const Elf_Sym &Sym)<br>
> : ELFSymbolBody<ELFT>(Base::UndefinedKind, N, Sym) {}<br>
><br>
> static bool classof(const SymbolBody *S) {<br>
><br>
><br>
> _______________________________________________<br>
> llvm-commits mailing list<br>
> <a href="mailto:llvm-commits@lists.llvm.org">llvm-commits@lists.llvm.org</a><br>
> <a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits</a><br>
</div></div></blockquote></div><br></div></div>